summaryrefslogtreecommitdiffstats
path: root/fs/overlayfs/inode.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2016-10-04 14:40:44 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2016-10-14 11:16:46 +0200
commit78a3fa4f3249055b472983065b30c02392cf7e2a (patch)
tree3a63686b48a69da9ae623c39047e76f9f523466a /fs/overlayfs/inode.c
parentovl: explain error values when removing acl from workdir (diff)
downloadlinux-78a3fa4f3249055b472983065b30c02392cf7e2a.tar.xz
linux-78a3fa4f3249055b472983065b30c02392cf7e2a.zip
ovl: use generic_readlink
All filesystems that are backers for overlayfs would also use generic_readlink(). Move this logic to the overlay itself, which is a nice cleanup. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to '')
-rw-r--r--fs/overlayfs/inode.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c
index ce5d7dfaf769..50dc214c44f2 100644
--- a/fs/overlayfs/inode.c
+++ b/fs/overlayfs/inode.c
@@ -176,25 +176,6 @@ static const char *ovl_get_link(struct dentry *dentry,
return p;
}
-static int ovl_readlink(struct dentry *dentry, char __user *buf, int bufsiz)
-{
- struct path realpath;
- struct inode *realinode;
- const struct cred *old_cred;
- int err;
-
- ovl_path_real(dentry, &realpath);
- realinode = realpath.dentry->d_inode;
-
- if (!realinode->i_op->readlink)
- return -EINVAL;
-
- old_cred = ovl_override_creds(dentry->d_sb);
- err = realinode->i_op->readlink(realpath.dentry, buf, bufsiz);
- revert_creds(old_cred);
- return err;
-}
-
bool ovl_is_private_xattr(const char *name)
{
return strncmp(name, OVL_XATTR_PREFIX,
@@ -381,7 +362,7 @@ static const struct inode_operations ovl_file_inode_operations = {
static const struct inode_operations ovl_symlink_inode_operations = {
.setattr = ovl_setattr,
.get_link = ovl_get_link,
- .readlink = ovl_readlink,
+ .readlink = generic_readlink,
.getattr = ovl_getattr,
.setxattr = generic_setxattr,
.getxattr = generic_getxattr,