aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2021-04-01 19:00:57 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2021-04-07 13:56:43 -0400
commitffb37ca3bd16ce6ea2df2f87fde9a31e94ebb54b (patch)
tree3181f65f00970c041c87262309e5737b8139b080 /fs/namei.c
parentLOOKUP_MOUNTPOINT: we are cleaning "jumped" flag too late (diff)
downloadlinux-dev-ffb37ca3bd16ce6ea2df2f87fde9a31e94ebb54b.tar.xz
linux-dev-ffb37ca3bd16ce6ea2df2f87fde9a31e94ebb54b.zip
switch file_open_root() to struct path
... and provide file_open_root_mnt(), using the root of given mount. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 48a2f288e802..4b6cf4974dd7 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3533,7 +3533,7 @@ struct file *do_filp_open(int dfd, struct filename *pathname,
return filp;
}
-struct file *do_file_open_root(struct dentry *dentry, struct vfsmount *mnt,
+struct file *do_file_open_root(const struct path *root,
const char *name, const struct open_flags *op)
{
struct nameidata nd;
@@ -3541,16 +3541,14 @@ struct file *do_file_open_root(struct dentry *dentry, struct vfsmount *mnt,
struct filename *filename;
int flags = op->lookup_flags | LOOKUP_ROOT;
- nd.root.mnt = mnt;
- nd.root.dentry = dentry;
-
- if (d_is_symlink(dentry) && op->intent & LOOKUP_OPEN)
+ if (d_is_symlink(root->dentry) && op->intent & LOOKUP_OPEN)
return ERR_PTR(-ELOOP);
filename = getname_kernel(name);
if (IS_ERR(filename))
return ERR_CAST(filename);
+ nd.root = *root;
set_nameidata(&nd, -1, filename);
file = path_openat(&nd, op, flags | LOOKUP_RCU);
if (unlikely(file == ERR_PTR(-ECHILD)))