aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ecryptfs/inode.c')
-rw-r--r--fs/ecryptfs/inode.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index 92c5dae576b1..040aa879d634 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -672,16 +672,24 @@ out:
672 return rc ? ERR_PTR(rc) : buf; 672 return rc ? ERR_PTR(rc) : buf;
673} 673}
674 674
675static const char *ecryptfs_follow_link(struct dentry *dentry, void **cookie) 675static const char *ecryptfs_get_link(struct dentry *dentry,
676 struct inode *inode,
677 struct delayed_call *done)
676{ 678{
677 size_t len; 679 size_t len;
678 char *buf = ecryptfs_readlink_lower(dentry, &len); 680 char *buf;
681
682 if (!dentry)
683 return ERR_PTR(-ECHILD);
684
685 buf = ecryptfs_readlink_lower(dentry, &len);
679 if (IS_ERR(buf)) 686 if (IS_ERR(buf))
680 return buf; 687 return buf;
681 fsstack_copy_attr_atime(d_inode(dentry), 688 fsstack_copy_attr_atime(d_inode(dentry),
682 d_inode(ecryptfs_dentry_to_lower(dentry))); 689 d_inode(ecryptfs_dentry_to_lower(dentry)));
683 buf[len] = '\0'; 690 buf[len] = '\0';
684 return *cookie = buf; 691 set_delayed_call(done, kfree_link, buf);
692 return buf;
685} 693}
686 694
687/** 695/**
@@ -1093,8 +1101,7 @@ out:
1093 1101
1094const struct inode_operations ecryptfs_symlink_iops = { 1102const struct inode_operations ecryptfs_symlink_iops = {
1095 .readlink = generic_readlink, 1103 .readlink = generic_readlink,
1096 .follow_link = ecryptfs_follow_link, 1104 .get_link = ecryptfs_get_link,
1097 .put_link = kfree_put_link,
1098 .permission = ecryptfs_permission, 1105 .permission = ecryptfs_permission,
1099 .setattr = ecryptfs_setattr, 1106 .setattr = ecryptfs_setattr,
1100 .getattr = ecryptfs_getattr_link, 1107 .getattr = ecryptfs_getattr_link,