summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-05-07 11:19:14 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2015-05-11 08:13:13 -0400
commitecc087ff14352aed52b8e775b4511e7f9cfc64ec (patch)
tree46a1845f647b8d59e28c49be683949a179b2ecdd /fs
parent5f2c4179e129bdc47870a81a65d0aff85aa18293 (diff)
downloadop-kernel-dev-ecc087ff14352aed52b8e775b4511e7f9cfc64ec.zip
op-kernel-dev-ecc087ff14352aed52b8e775b4511e7f9cfc64ec.tar.gz
new helper: free_page_put_link()
similar to kfree_put_link() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/configfs/symlink.c7
-rw-r--r--fs/fuse/dir.c7
-rw-r--r--fs/kernfs/symlink.c7
-rw-r--r--fs/libfs.c6
4 files changed, 9 insertions, 18 deletions
diff --git a/fs/configfs/symlink.c b/fs/configfs/symlink.c
index bc464c2..ec5c832 100644
--- a/fs/configfs/symlink.c
+++ b/fs/configfs/symlink.c
@@ -296,15 +296,10 @@ static const char *configfs_follow_link(struct dentry *dentry, void **cookie)
return ERR_PTR(error);
}
-static void configfs_put_link(struct inode *unused, void *cookie)
-{
- free_page((unsigned long)cookie);
-}
-
const struct inode_operations configfs_symlink_inode_operations = {
.follow_link = configfs_follow_link,
.readlink = generic_readlink,
- .put_link = configfs_put_link,
+ .put_link = free_page_put_link,
.setattr = configfs_setattr,
};
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 9e704c1..5e2e087 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -1395,11 +1395,6 @@ static const char *fuse_follow_link(struct dentry *dentry, void **cookie)
return link;
}
-static void fuse_put_link(struct inode *unused, void *cookie)
-{
- free_page((unsigned long) cookie);
-}
-
static int fuse_dir_open(struct inode *inode, struct file *file)
{
return fuse_open_common(inode, file, true);
@@ -1915,7 +1910,7 @@ static const struct inode_operations fuse_common_inode_operations = {
static const struct inode_operations fuse_symlink_inode_operations = {
.setattr = fuse_setattr,
.follow_link = fuse_follow_link,
- .put_link = fuse_put_link,
+ .put_link = free_page_put_link,
.readlink = generic_readlink,
.getattr = fuse_getattr,
.setxattr = fuse_setxattr,
diff --git a/fs/kernfs/symlink.c b/fs/kernfs/symlink.c
index f6aa2e5..db27252 100644
--- a/fs/kernfs/symlink.c
+++ b/fs/kernfs/symlink.c
@@ -126,11 +126,6 @@ static const char *kernfs_iop_follow_link(struct dentry *dentry, void **cookie)
return *cookie = (char *)page;
}
-static void kernfs_iop_put_link(struct inode *unused, void *cookie)
-{
- free_page((unsigned long)cookie);
-}
-
const struct inode_operations kernfs_symlink_iops = {
.setxattr = kernfs_iop_setxattr,
.removexattr = kernfs_iop_removexattr,
@@ -138,7 +133,7 @@ const struct inode_operations kernfs_symlink_iops = {
.listxattr = kernfs_iop_listxattr,
.readlink = generic_readlink,
.follow_link = kernfs_iop_follow_link,
- .put_link = kernfs_iop_put_link,
+ .put_link = free_page_put_link,
.setattr = kernfs_iop_setattr,
.getattr = kernfs_iop_getattr,
.permission = kernfs_iop_permission,
diff --git a/fs/libfs.c b/fs/libfs.c
index 01c337b..65e1fec 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -1030,6 +1030,12 @@ void kfree_put_link(struct inode *unused, void *cookie)
}
EXPORT_SYMBOL(kfree_put_link);
+void free_page_put_link(struct inode *unused, void *cookie)
+{
+ free_page((unsigned long) cookie);
+}
+EXPORT_SYMBOL(free_page_put_link);
+
/*
* nop .set_page_dirty method so that people can use .page_mkwrite on
* anon inodes.
OpenPOWER on IntegriCloud