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

new helper: free_page_put_link()

similar to kfree_put_link()

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

Al Viro ecc087ff 5f2c4179

+10 -18
+1 -6
fs/configfs/symlink.c
··· 296 296 return ERR_PTR(error); 297 297 } 298 298 299 - static void configfs_put_link(struct inode *unused, void *cookie) 300 - { 301 - free_page((unsigned long)cookie); 302 - } 303 - 304 299 const struct inode_operations configfs_symlink_inode_operations = { 305 300 .follow_link = configfs_follow_link, 306 301 .readlink = generic_readlink, 307 - .put_link = configfs_put_link, 302 + .put_link = free_page_put_link, 308 303 .setattr = configfs_setattr, 309 304 }; 310 305
+1 -6
fs/fuse/dir.c
··· 1395 1395 return link; 1396 1396 } 1397 1397 1398 - static void fuse_put_link(struct inode *unused, void *cookie) 1399 - { 1400 - free_page((unsigned long) cookie); 1401 - } 1402 - 1403 1398 static int fuse_dir_open(struct inode *inode, struct file *file) 1404 1399 { 1405 1400 return fuse_open_common(inode, file, true); ··· 1910 1915 static const struct inode_operations fuse_symlink_inode_operations = { 1911 1916 .setattr = fuse_setattr, 1912 1917 .follow_link = fuse_follow_link, 1913 - .put_link = fuse_put_link, 1918 + .put_link = free_page_put_link, 1914 1919 .readlink = generic_readlink, 1915 1920 .getattr = fuse_getattr, 1916 1921 .setxattr = fuse_setxattr,
+1 -6
fs/kernfs/symlink.c
··· 126 126 return *cookie = (char *)page; 127 127 } 128 128 129 - static void kernfs_iop_put_link(struct inode *unused, void *cookie) 130 - { 131 - free_page((unsigned long)cookie); 132 - } 133 - 134 129 const struct inode_operations kernfs_symlink_iops = { 135 130 .setxattr = kernfs_iop_setxattr, 136 131 .removexattr = kernfs_iop_removexattr, ··· 133 138 .listxattr = kernfs_iop_listxattr, 134 139 .readlink = generic_readlink, 135 140 .follow_link = kernfs_iop_follow_link, 136 - .put_link = kernfs_iop_put_link, 141 + .put_link = free_page_put_link, 137 142 .setattr = kernfs_iop_setattr, 138 143 .getattr = kernfs_iop_getattr, 139 144 .permission = kernfs_iop_permission,
+6
fs/libfs.c
··· 1030 1030 } 1031 1031 EXPORT_SYMBOL(kfree_put_link); 1032 1032 1033 + void free_page_put_link(struct inode *unused, void *cookie) 1034 + { 1035 + free_page((unsigned long) cookie); 1036 + } 1037 + EXPORT_SYMBOL(free_page_put_link); 1038 + 1033 1039 /* 1034 1040 * nop .set_page_dirty method so that people can use .page_mkwrite on 1035 1041 * anon inodes.
+1
include/linux/fs.h
··· 2712 2712 extern int page_symlink(struct inode *inode, const char *symname, int len); 2713 2713 extern const struct inode_operations page_symlink_inode_operations; 2714 2714 extern void kfree_put_link(struct inode *, void *); 2715 + extern void free_page_put_link(struct inode *, void *); 2715 2716 extern int generic_readlink(struct dentry *, char __user *, int); 2716 2717 extern void generic_fillattr(struct inode *, struct kstat *); 2717 2718 int vfs_getattr_nosec(struct path *path, struct kstat *stat);