fput: Don't reinvent the wheel but use existing llist API

Although llist provides proper APIs, they are not used. Make them used.

Signed-off-by: Byungchul Park <byungchul.park@lge.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

authored by Byungchul Park and committed by Al Viro b9ea557e 29785735

+5 -7
+5 -7
fs/file_table.c
··· 233 static void delayed_fput(struct work_struct *unused) 234 { 235 struct llist_node *node = llist_del_all(&delayed_fput_list); 236 - struct llist_node *next; 237 238 - for (; node; node = next) { 239 - next = llist_next(node); 240 - __fput(llist_entry(node, struct file, f_u.fu_llist)); 241 - } 242 } 243 244 static void ____fput(struct callback_head *work) ··· 310 } 311 312 void __init files_init(void) 313 - { 314 filp_cachep = kmem_cache_create("filp", sizeof(struct file), 0, 315 SLAB_HWCACHE_ALIGN | SLAB_PANIC, NULL); 316 percpu_counter_init(&nr_files, 0, GFP_KERNEL); ··· 329 n = ((totalram_pages - memreserve) * (PAGE_SIZE / 1024)) / 10; 330 331 files_stat.max_files = max_t(unsigned long, n, NR_FILE); 332 - }
··· 233 static void delayed_fput(struct work_struct *unused) 234 { 235 struct llist_node *node = llist_del_all(&delayed_fput_list); 236 + struct file *f, *t; 237 238 + llist_for_each_entry_safe(f, t, node, f_u.fu_llist) 239 + __fput(f); 240 } 241 242 static void ____fput(struct callback_head *work) ··· 312 } 313 314 void __init files_init(void) 315 + { 316 filp_cachep = kmem_cache_create("filp", sizeof(struct file), 0, 317 SLAB_HWCACHE_ALIGN | SLAB_PANIC, NULL); 318 percpu_counter_init(&nr_files, 0, GFP_KERNEL); ··· 331 n = ((totalram_pages - memreserve) * (PAGE_SIZE / 1024)) / 10; 332 333 files_stat.max_files = max_t(unsigned long, n, NR_FILE); 334 + }