summaryrefslogtreecommitdiffstats
path: root/fs/kernfs/symlink.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-12-29 15:58:39 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2015-12-30 13:01:03 -0500
commitfceef393a538134f03b778c5d2519e670269342f (patch)
treecd43c9afdc07852d286965ad4d11772f6c275d1a /fs/kernfs/symlink.c
parentcd3417c8fc9504cc1afe944515f338aff9ec286b (diff)
downloadlinux-fceef393a538134f03b778c5d2519e670269342f.tar.bz2
switch ->get_link() to delayed_call, kill ->put_link()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/kernfs/symlink.c')
-rw-r--r--fs/kernfs/symlink.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/kernfs/symlink.c b/fs/kernfs/symlink.c
index f9efdaeda7b0..117b8b3416f9 100644
--- a/fs/kernfs/symlink.c
+++ b/fs/kernfs/symlink.c
@@ -113,22 +113,24 @@ static int kernfs_getlink(struct dentry *dentry, char *path)
}
static const char *kernfs_iop_get_link(struct dentry *dentry,
- struct inode *inode, void **cookie)
+ struct inode *inode,
+ struct delayed_call *done)
{
- int error = -ENOMEM;
- char *page;
+ char *body;
+ int error;
if (!dentry)
return ERR_PTR(-ECHILD);
- page = kzalloc(PAGE_SIZE, GFP_KERNEL);
- if (!page)
+ body = kzalloc(PAGE_SIZE, GFP_KERNEL);
+ if (!body)
return ERR_PTR(-ENOMEM);
- error = kernfs_getlink(dentry, page);
+ error = kernfs_getlink(dentry, body);
if (unlikely(error < 0)) {
- kfree(page);
+ kfree(body);
return ERR_PTR(error);
}
- return *cookie = page;
+ set_delayed_call(done, kfree_link, body);
+ return body;
}
const struct inode_operations kernfs_symlink_iops = {
@@ -138,7 +140,6 @@ const struct inode_operations kernfs_symlink_iops = {
.listxattr = kernfs_iop_listxattr,
.readlink = generic_readlink,
.get_link = kernfs_iop_get_link,
- .put_link = kfree_put_link,
.setattr = kernfs_iop_setattr,
.getattr = kernfs_iop_getattr,
.permission = kernfs_iop_permission,