Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kill free_page_put_link()

all callers are better off with kfree_put_link()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro cd3417c8 0d0def49

+15 -22
+6 -6
fs/configfs/symlink.c
··· 282 282 static const char *configfs_get_link(struct dentry *dentry, 283 283 struct inode *inode, void **cookie) 284 284 { 285 - unsigned long page; 285 + char *page; 286 286 int error; 287 287 288 288 if (!dentry) 289 289 return ERR_PTR(-ECHILD); 290 290 291 - page = get_zeroed_page(GFP_KERNEL); 291 + page = kzalloc(PAGE_SIZE, GFP_KERNEL); 292 292 if (!page) 293 293 return ERR_PTR(-ENOMEM); 294 294 295 - error = configfs_getlink(dentry, (char *)page); 295 + error = configfs_getlink(dentry, page); 296 296 if (!error) { 297 - return *cookie = (void *)page; 297 + return *cookie = page; 298 298 } 299 299 300 - free_page(page); 300 + kfree(page); 301 301 return ERR_PTR(error); 302 302 } 303 303 304 304 const struct inode_operations configfs_symlink_inode_operations = { 305 305 .get_link = configfs_get_link, 306 306 .readlink = generic_readlink, 307 - .put_link = free_page_put_link, 307 + .put_link = kfree_put_link, 308 308 .setattr = configfs_setattr, 309 309 }; 310 310
+3 -3
fs/fuse/dir.c
··· 1376 1376 if (!dentry) 1377 1377 return ERR_PTR(-ECHILD); 1378 1378 1379 - link = (char *) __get_free_page(GFP_KERNEL); 1379 + link = kmalloc(PAGE_SIZE, GFP_KERNEL); 1380 1380 if (!link) 1381 1381 return ERR_PTR(-ENOMEM); 1382 1382 ··· 1388 1388 args.out.args[0].value = link; 1389 1389 ret = fuse_simple_request(fc, &args); 1390 1390 if (ret < 0) { 1391 - free_page((unsigned long) link); 1391 + kfree(link); 1392 1392 link = ERR_PTR(ret); 1393 1393 } else { 1394 1394 link[ret] = '\0'; ··· 1913 1913 static const struct inode_operations fuse_symlink_inode_operations = { 1914 1914 .setattr = fuse_setattr, 1915 1915 .get_link = fuse_get_link, 1916 - .put_link = free_page_put_link, 1916 + .put_link = kfree_put_link, 1917 1917 .readlink = generic_readlink, 1918 1918 .getattr = fuse_getattr, 1919 1919 .setxattr = fuse_setxattr,
+6 -6
fs/kernfs/symlink.c
··· 116 116 struct inode *inode, void **cookie) 117 117 { 118 118 int error = -ENOMEM; 119 - unsigned long page; 119 + char *page; 120 120 121 121 if (!dentry) 122 122 return ERR_PTR(-ECHILD); 123 - page = get_zeroed_page(GFP_KERNEL); 123 + page = kzalloc(PAGE_SIZE, GFP_KERNEL); 124 124 if (!page) 125 125 return ERR_PTR(-ENOMEM); 126 - error = kernfs_getlink(dentry, (char *)page); 126 + error = kernfs_getlink(dentry, page); 127 127 if (unlikely(error < 0)) { 128 - free_page((unsigned long)page); 128 + kfree(page); 129 129 return ERR_PTR(error); 130 130 } 131 - return *cookie = (char *)page; 131 + return *cookie = page; 132 132 } 133 133 134 134 const struct inode_operations kernfs_symlink_iops = { ··· 138 138 .listxattr = kernfs_iop_listxattr, 139 139 .readlink = generic_readlink, 140 140 .get_link = kernfs_iop_get_link, 141 - .put_link = free_page_put_link, 141 + .put_link = kfree_put_link, 142 142 .setattr = kernfs_iop_setattr, 143 143 .getattr = kernfs_iop_getattr, 144 144 .permission = kernfs_iop_permission,
-6
fs/libfs.c
··· 1025 1025 } 1026 1026 EXPORT_SYMBOL(kfree_put_link); 1027 1027 1028 - void free_page_put_link(struct inode *unused, void *cookie) 1029 - { 1030 - free_page((unsigned long) cookie); 1031 - } 1032 - EXPORT_SYMBOL(free_page_put_link); 1033 - 1034 1028 /* 1035 1029 * nop .set_page_dirty method so that people can use .page_mkwrite on 1036 1030 * anon inodes.
-1
include/linux/fs.h
··· 2743 2743 extern int page_symlink(struct inode *inode, const char *symname, int len); 2744 2744 extern const struct inode_operations page_symlink_inode_operations; 2745 2745 extern void kfree_put_link(struct inode *, void *); 2746 - extern void free_page_put_link(struct inode *, void *); 2747 2746 extern int generic_readlink(struct dentry *, char __user *, int); 2748 2747 extern void generic_fillattr(struct inode *, struct kstat *); 2749 2748 int vfs_getattr_nosec(struct path *path, struct kstat *stat);