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