diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-12-29 16:03:53 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-12-29 16:03:53 -0500 |
commit | cd3417c8fc9504cc1afe944515f338aff9ec286b (patch) | |
tree | c60b8132b9deff6d5a5c3f229cce2efd9ac135a3 | |
parent | 0d0def49d05ae988936268b0e57d19aeef8c3ad2 (diff) |
kill free_page_put_link()
all callers are better off with kfree_put_link()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/configfs/symlink.c | 12 | ||||
-rw-r--r-- | fs/fuse/dir.c | 6 | ||||
-rw-r--r-- | fs/kernfs/symlink.c | 12 | ||||
-rw-r--r-- | fs/libfs.c | 6 | ||||
-rw-r--r-- | include/linux/fs.h | 1 |
5 files changed, 15 insertions, 22 deletions
diff --git a/fs/configfs/symlink.c b/fs/configfs/symlink.c index b91c01ebb688..e9de962e518d 100644 --- a/fs/configfs/symlink.c +++ b/fs/configfs/symlink.c | |||
@@ -282,29 +282,29 @@ static int configfs_getlink(struct dentry *dentry, char * path) | |||
282 | static const char *configfs_get_link(struct dentry *dentry, | 282 | static const char *configfs_get_link(struct dentry *dentry, |
283 | struct inode *inode, void **cookie) | 283 | struct inode *inode, void **cookie) |
284 | { | 284 | { |
285 | unsigned long page; | 285 | char *page; |
286 | int error; | 286 | int error; |
287 | 287 | ||
288 | if (!dentry) | 288 | if (!dentry) |
289 | return ERR_PTR(-ECHILD); | 289 | return ERR_PTR(-ECHILD); |
290 | 290 | ||
291 | page = get_zeroed_page(GFP_KERNEL); | 291 | page = kzalloc(PAGE_SIZE, GFP_KERNEL); |
292 | if (!page) | 292 | if (!page) |
293 | return ERR_PTR(-ENOMEM); | 293 | return ERR_PTR(-ENOMEM); |
294 | 294 | ||
295 | error = configfs_getlink(dentry, (char *)page); | 295 | error = configfs_getlink(dentry, page); |
296 | if (!error) { | 296 | if (!error) { |
297 | return *cookie = (void *)page; | 297 | return *cookie = page; |
298 | } | 298 | } |
299 | 299 | ||
300 | free_page(page); | 300 | kfree(page); |
301 | return ERR_PTR(error); | 301 | return ERR_PTR(error); |
302 | } | 302 | } |
303 | 303 | ||
304 | const struct inode_operations configfs_symlink_inode_operations = { | 304 | const struct inode_operations configfs_symlink_inode_operations = { |
305 | .get_link = configfs_get_link, | 305 | .get_link = configfs_get_link, |
306 | .readlink = generic_readlink, | 306 | .readlink = generic_readlink, |
307 | .put_link = free_page_put_link, | 307 | .put_link = kfree_put_link, |
308 | .setattr = configfs_setattr, | 308 | .setattr = configfs_setattr, |
309 | }; | 309 | }; |
310 | 310 | ||
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 148e8ef7c541..def0a4d082bc 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
@@ -1376,7 +1376,7 @@ static const char *fuse_get_link(struct dentry *dentry, | |||
1376 | if (!dentry) | 1376 | if (!dentry) |
1377 | return ERR_PTR(-ECHILD); | 1377 | return ERR_PTR(-ECHILD); |
1378 | 1378 | ||
1379 | link = (char *) __get_free_page(GFP_KERNEL); | 1379 | link = kmalloc(PAGE_SIZE, GFP_KERNEL); |
1380 | if (!link) | 1380 | if (!link) |
1381 | return ERR_PTR(-ENOMEM); | 1381 | return ERR_PTR(-ENOMEM); |
1382 | 1382 | ||
@@ -1388,7 +1388,7 @@ static const char *fuse_get_link(struct dentry *dentry, | |||
1388 | args.out.args[0].value = link; | 1388 | args.out.args[0].value = link; |
1389 | ret = fuse_simple_request(fc, &args); | 1389 | ret = fuse_simple_request(fc, &args); |
1390 | if (ret < 0) { | 1390 | if (ret < 0) { |
1391 | free_page((unsigned long) link); | 1391 | kfree(link); |
1392 | link = ERR_PTR(ret); | 1392 | link = ERR_PTR(ret); |
1393 | } else { | 1393 | } else { |
1394 | link[ret] = '\0'; | 1394 | link[ret] = '\0'; |
@@ -1913,7 +1913,7 @@ static const struct inode_operations fuse_common_inode_operations = { | |||
1913 | static const struct inode_operations fuse_symlink_inode_operations = { | 1913 | static const struct inode_operations fuse_symlink_inode_operations = { |
1914 | .setattr = fuse_setattr, | 1914 | .setattr = fuse_setattr, |
1915 | .get_link = fuse_get_link, | 1915 | .get_link = fuse_get_link, |
1916 | .put_link = free_page_put_link, | 1916 | .put_link = kfree_put_link, |
1917 | .readlink = generic_readlink, | 1917 | .readlink = generic_readlink, |
1918 | .getattr = fuse_getattr, | 1918 | .getattr = fuse_getattr, |
1919 | .setxattr = fuse_setxattr, | 1919 | .setxattr = fuse_setxattr, |
diff --git a/fs/kernfs/symlink.c b/fs/kernfs/symlink.c index ffae8579045d..f9efdaeda7b0 100644 --- a/fs/kernfs/symlink.c +++ b/fs/kernfs/symlink.c | |||
@@ -116,19 +116,19 @@ static const char *kernfs_iop_get_link(struct dentry *dentry, | |||
116 | struct inode *inode, void **cookie) | 116 | struct inode *inode, void **cookie) |
117 | { | 117 | { |
118 | int error = -ENOMEM; | 118 | int error = -ENOMEM; |
119 | unsigned long page; | 119 | char *page; |
120 | 120 | ||
121 | if (!dentry) | 121 | if (!dentry) |
122 | return ERR_PTR(-ECHILD); | 122 | return ERR_PTR(-ECHILD); |
123 | page = get_zeroed_page(GFP_KERNEL); | 123 | page = kzalloc(PAGE_SIZE, GFP_KERNEL); |
124 | if (!page) | 124 | if (!page) |
125 | return ERR_PTR(-ENOMEM); | 125 | return ERR_PTR(-ENOMEM); |
126 | error = kernfs_getlink(dentry, (char *)page); | 126 | error = kernfs_getlink(dentry, page); |
127 | if (unlikely(error < 0)) { | 127 | if (unlikely(error < 0)) { |
128 | free_page((unsigned long)page); | 128 | kfree(page); |
129 | return ERR_PTR(error); | 129 | return ERR_PTR(error); |
130 | } | 130 | } |
131 | return *cookie = (char *)page; | 131 | return *cookie = page; |
132 | } | 132 | } |
133 | 133 | ||
134 | const struct inode_operations kernfs_symlink_iops = { | 134 | const struct inode_operations kernfs_symlink_iops = { |
@@ -138,7 +138,7 @@ const struct inode_operations kernfs_symlink_iops = { | |||
138 | .listxattr = kernfs_iop_listxattr, | 138 | .listxattr = kernfs_iop_listxattr, |
139 | .readlink = generic_readlink, | 139 | .readlink = generic_readlink, |
140 | .get_link = kernfs_iop_get_link, | 140 | .get_link = kernfs_iop_get_link, |
141 | .put_link = free_page_put_link, | 141 | .put_link = kfree_put_link, |
142 | .setattr = kernfs_iop_setattr, | 142 | .setattr = kernfs_iop_setattr, |
143 | .getattr = kernfs_iop_getattr, | 143 | .getattr = kernfs_iop_getattr, |
144 | .permission = kernfs_iop_permission, | 144 | .permission = kernfs_iop_permission, |
diff --git a/fs/libfs.c b/fs/libfs.c index 8dc37fc4b6df..fec7ab0632dc 100644 --- a/fs/libfs.c +++ b/fs/libfs.c | |||
@@ -1025,12 +1025,6 @@ void kfree_put_link(struct inode *unused, void *cookie) | |||
1025 | } | 1025 | } |
1026 | EXPORT_SYMBOL(kfree_put_link); | 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 | * nop .set_page_dirty method so that people can use .page_mkwrite on | 1029 | * nop .set_page_dirty method so that people can use .page_mkwrite on |
1036 | * anon inodes. | 1030 | * anon inodes. |
diff --git a/include/linux/fs.h b/include/linux/fs.h index d2fdf09a4407..138e206df2fc 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -2743,7 +2743,6 @@ extern int __page_symlink(struct inode *inode, const char *symname, int len, | |||
2743 | extern int page_symlink(struct inode *inode, const char *symname, int len); | 2743 | extern int page_symlink(struct inode *inode, const char *symname, int len); |
2744 | extern const struct inode_operations page_symlink_inode_operations; | 2744 | extern const struct inode_operations page_symlink_inode_operations; |
2745 | extern void kfree_put_link(struct inode *, void *); | 2745 | extern void kfree_put_link(struct inode *, void *); |
2746 | extern void free_page_put_link(struct inode *, void *); | ||
2747 | extern int generic_readlink(struct dentry *, char __user *, int); | 2746 | extern int generic_readlink(struct dentry *, char __user *, int); |
2748 | extern void generic_fillattr(struct inode *, struct kstat *); | 2747 | extern void generic_fillattr(struct inode *, struct kstat *); |
2749 | int vfs_getattr_nosec(struct path *path, struct kstat *stat); | 2748 | int vfs_getattr_nosec(struct path *path, struct kstat *stat); |