aboutsummaryrefslogtreecommitdiffstats
path: root/fs/kernfs
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
parentcd3417c8fc9504cc1afe944515f338aff9ec286b (diff)
switch ->get_link() to delayed_call, kill ->put_link()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/kernfs')
-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)
113} 113}
114 114
115static const char *kernfs_iop_get_link(struct dentry *dentry, 115static const char *kernfs_iop_get_link(struct dentry *dentry,
116 struct inode *inode, void **cookie) 116 struct inode *inode,
117 struct delayed_call *done)
117{ 118{
118 int error = -ENOMEM; 119 char *body;
119 char *page; 120 int error;
120 121
121 if (!dentry) 122 if (!dentry)
122 return ERR_PTR(-ECHILD); 123 return ERR_PTR(-ECHILD);
123 page = kzalloc(PAGE_SIZE, GFP_KERNEL); 124 body = kzalloc(PAGE_SIZE, GFP_KERNEL);
124 if (!page) 125 if (!body)
125 return ERR_PTR(-ENOMEM); 126 return ERR_PTR(-ENOMEM);
126 error = kernfs_getlink(dentry, page); 127 error = kernfs_getlink(dentry, body);
127 if (unlikely(error < 0)) { 128 if (unlikely(error < 0)) {
128 kfree(page); 129 kfree(body);
129 return ERR_PTR(error); 130 return ERR_PTR(error);
130 } 131 }
131 return *cookie = page; 132 set_delayed_call(done, kfree_link, body);
133 return body;
132} 134}
133 135
134const struct inode_operations kernfs_symlink_iops = { 136const struct inode_operations kernfs_symlink_iops = {
@@ -138,7 +140,6 @@ const struct inode_operations kernfs_symlink_iops = {
138 .listxattr = kernfs_iop_listxattr, 140 .listxattr = kernfs_iop_listxattr,
139 .readlink = generic_readlink, 141 .readlink = generic_readlink,
140 .get_link = kernfs_iop_get_link, 142 .get_link = kernfs_iop_get_link,
141 .put_link = kfree_put_link,
142 .setattr = kernfs_iop_setattr, 143 .setattr = kernfs_iop_setattr,
143 .getattr = kernfs_iop_getattr, 144 .getattr = kernfs_iop_getattr,
144 .permission = kernfs_iop_permission, 145 .permission = kernfs_iop_permission,