summaryrefslogtreecommitdiffstats
path: root/fs/configfs/symlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/configfs/symlink.c')
-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