Skip to content

Commit 5bf3bd2

Browse files
author
Al Viro
committed
switch exp_parent() to struct path
... and lose the always-NULL last argument (non-NULL case had been split off a while ago). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 55430e2 commit 5bf3bd2

1 file changed

Lines changed: 12 additions & 16 deletions

File tree

‎fs/nfsd/export.c‎

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -871,23 +871,19 @@ static svc_export *exp_get_by_name(svc_client *clp, const struct path *path,
871871
/*
872872
* Find the export entry for a given dentry.
873873
*/
874-
static struct svc_export *exp_parent(svc_client *clp, struct vfsmount *mnt,
875-
struct dentry *dentry,
876-
struct cache_req *reqp)
874+
static struct svc_export *exp_parent(svc_client *clp, struct path *path)
877875
{
878-
struct path path = {.mnt = mnt, .dentry = dentry};
879-
svc_export *exp;
880-
881-
dget(path.dentry);
882-
exp = exp_get_by_name(clp, &path, reqp);
883-
884-
while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path.dentry)) {
885-
struct dentry *parent = dget_parent(path.dentry);
886-
dput(path.dentry);
887-
path.dentry = parent;
888-
exp = exp_get_by_name(clp, &path, reqp);
876+
struct dentry *saved = dget(path->dentry);
877+
svc_export *exp = exp_get_by_name(clp, path, NULL);
878+
879+
while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path->dentry)) {
880+
struct dentry *parent = dget_parent(path->dentry);
881+
dput(path->dentry);
882+
path->dentry = parent;
883+
exp = exp_get_by_name(clp, path, NULL);
889884
}
890-
dput(path.dentry);
885+
dput(path->dentry);
886+
path->dentry = saved;
891887
return exp;
892888
}
893889

@@ -1174,7 +1170,7 @@ exp_rootfh(svc_client *clp, char *name, struct knfsd_fh *f, int maxsize)
11741170
dprintk("nfsd: exp_rootfh(%s [%p] %s:%s/%ld)\n",
11751171
name, path.dentry, clp->name,
11761172
inode->i_sb->s_id, inode->i_ino);
1177-
exp = exp_parent(clp, path.mnt, path.dentry, NULL);
1173+
exp = exp_parent(clp, &path);
11781174
if (IS_ERR(exp)) {
11791175
err = PTR_ERR(exp);
11801176
goto out;

0 commit comments

Comments
 (0)