aboutsummaryrefslogtreecommitdiffstats
path: root/fs/configfs
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/configfs
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/configfs')
-rw-r--r--fs/configfs/symlink.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/configfs/symlink.c b/fs/configfs/symlink.c
index e9de962e518d..db6d69289608 100644
--- a/fs/configfs/symlink.c
+++ b/fs/configfs/symlink.c
@@ -280,31 +280,32 @@ static int configfs_getlink(struct dentry *dentry, char * path)
280} 280}
281 281
282static const char *configfs_get_link(struct dentry *dentry, 282static const char *configfs_get_link(struct dentry *dentry,
283 struct inode *inode, void **cookie) 283 struct inode *inode,
284 struct delayed_call *done)
284{ 285{
285 char *page; 286 char *body;
286 int error; 287 int error;
287 288
288 if (!dentry) 289 if (!dentry)
289 return ERR_PTR(-ECHILD); 290 return ERR_PTR(-ECHILD);
290 291
291 page = kzalloc(PAGE_SIZE, GFP_KERNEL); 292 body = kzalloc(PAGE_SIZE, GFP_KERNEL);
292 if (!page) 293 if (!body)
293 return ERR_PTR(-ENOMEM); 294 return ERR_PTR(-ENOMEM);
294 295
295 error = configfs_getlink(dentry, page); 296 error = configfs_getlink(dentry, body);
296 if (!error) { 297 if (!error) {
297 return *cookie = page; 298 set_delayed_call(done, kfree_link, body);
299 return body;
298 } 300 }
299 301
300 kfree(page); 302 kfree(body);
301 return ERR_PTR(error); 303 return ERR_PTR(error);
302} 304}
303 305
304const struct inode_operations configfs_symlink_inode_operations = { 306const struct inode_operations configfs_symlink_inode_operations = {
305 .get_link = configfs_get_link, 307 .get_link = configfs_get_link,
306 .readlink = generic_readlink, 308 .readlink = generic_readlink,
307 .put_link = kfree_put_link,
308 .setattr = configfs_setattr, 309 .setattr = configfs_setattr,
309}; 310};
310 311