Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1481911 > unrolled thread

[PATCH 02/17] ovl: use generic_readlink

Started byMiklos Szeredi <mszeredi@redhat.com>
First post2016-09-12 21:40 +0200
Last post2016-09-12 21:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 02/17] ovl: use generic_readlink Miklos Szeredi <mszeredi@redhat.com> - 2016-09-12 21:40 +0200

#1481911 — [PATCH 02/17] ovl: use generic_readlink

FromMiklos Szeredi <mszeredi@redhat.com>
Date2016-09-12 21:40 +0200
Subject[PATCH 02/17] ovl: use generic_readlink
Message-ID<sgFfc-7H4-25@gated-at.bofh.it>
This will allow us to move the generic readlink logic into the VFS and get
rid of the readlink method.

All filesystems that are backers for overlayfs would also use
generic_readlink().  Move this logic to the overlay itself, which is a nice
cleanup in itself.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
---
 fs/overlayfs/inode.c | 21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c
index c75625c1efa3..3b636e3acda4 100644
--- a/fs/overlayfs/inode.c
+++ b/fs/overlayfs/inode.c
@@ -173,25 +173,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,
@@ -378,7 +359,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,
-- 
2.5.5

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web