Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull misc leftovers from Al Viro.

* 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
fix the __user misannotations in asm-generic get_user/put_user
fput: Don't reinvent the wheel but use existing llist API
namespace.c: Don't reinvent the wheel but use existing llist API

+12 -16
+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 + }
+3 -5
fs/namespace.c
··· 1182 static void delayed_mntput(struct work_struct *unused) 1183 { 1184 struct llist_node *node = llist_del_all(&delayed_mntput_list); 1185 - struct llist_node *next; 1186 1187 - for (; node; node = next) { 1188 - next = llist_next(node); 1189 - cleanup_mnt(llist_entry(node, struct mount, mnt_llist)); 1190 - } 1191 } 1192 static DECLARE_DELAYED_WORK(delayed_mntput_work, delayed_mntput); 1193
··· 1182 static void delayed_mntput(struct work_struct *unused) 1183 { 1184 struct llist_node *node = llist_del_all(&delayed_mntput_list); 1185 + struct mount *m, *t; 1186 1187 + llist_for_each_entry_safe(m, t, node, mnt_llist) 1188 + cleanup_mnt(m); 1189 } 1190 static DECLARE_DELAYED_WORK(delayed_mntput_work, delayed_mntput); 1191
+4 -4
include/asm-generic/uaccess.h
··· 75 76 #define put_user(x, ptr) \ 77 ({ \ 78 - void *__p = (ptr); \ 79 might_fault(); \ 80 access_ok(VERIFY_WRITE, __p, sizeof(*ptr)) ? \ 81 - __put_user((x), ((__typeof__(*(ptr)) *)__p)) : \ 82 -EFAULT; \ 83 }) 84 ··· 137 138 #define get_user(x, ptr) \ 139 ({ \ 140 - const void *__p = (ptr); \ 141 might_fault(); \ 142 access_ok(VERIFY_READ, __p, sizeof(*ptr)) ? \ 143 - __get_user((x), (__typeof__(*(ptr)) *)__p) : \ 144 ((x) = (__typeof__(*(ptr)))0,-EFAULT); \ 145 }) 146
··· 75 76 #define put_user(x, ptr) \ 77 ({ \ 78 + void __user *__p = (ptr); \ 79 might_fault(); \ 80 access_ok(VERIFY_WRITE, __p, sizeof(*ptr)) ? \ 81 + __put_user((x), ((__typeof__(*(ptr)) __user *)__p)) : \ 82 -EFAULT; \ 83 }) 84 ··· 137 138 #define get_user(x, ptr) \ 139 ({ \ 140 + const void __user *__p = (ptr); \ 141 might_fault(); \ 142 access_ok(VERIFY_READ, __p, sizeof(*ptr)) ? \ 143 + __get_user((x), (__typeof__(*(ptr)) __user *)__p) :\ 144 ((x) = (__typeof__(*(ptr)))0,-EFAULT); \ 145 }) 146