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