From d52c94ba333b051d8c84532443e7c60c6720e66f Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 18 Apr 2009 02:14:32 -0400 Subject: [PATCH] --- yaml --- r: 147815 b: refs/heads/master c: 5bf3bd2b5cb68ba43c91f5bd0ac043543fba2558 h: refs/heads/master i: 147813: 2763c4a9410da465c4816f4e93ef76e4669493ca 147811: dd3f01c9ebef4019e94ec38d0c9830ca156c2fe0 147807: 08cb5d131e9f6ddd4aedf221166f63e1e6fe8666 v: v3 --- [refs] | 2 +- trunk/fs/nfsd/export.c | 28 ++++++++++++---------------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/[refs] b/[refs] index d702759dff4d..95e4ad1aac47 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 55430e2ecee574e729c12d4063b3ecabfa98fa82 +refs/heads/master: 5bf3bd2b5cb68ba43c91f5bd0ac043543fba2558 diff --git a/trunk/fs/nfsd/export.c b/trunk/fs/nfsd/export.c index 3f6d51b8c3ef..5149dabde555 100644 --- a/trunk/fs/nfsd/export.c +++ b/trunk/fs/nfsd/export.c @@ -871,23 +871,19 @@ static svc_export *exp_get_by_name(svc_client *clp, const struct path *path, /* * Find the export entry for a given dentry. */ -static struct svc_export *exp_parent(svc_client *clp, struct vfsmount *mnt, - struct dentry *dentry, - struct cache_req *reqp) +static struct svc_export *exp_parent(svc_client *clp, struct path *path) { - struct path path = {.mnt = mnt, .dentry = dentry}; - svc_export *exp; - - dget(path.dentry); - exp = exp_get_by_name(clp, &path, reqp); - - while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path.dentry)) { - struct dentry *parent = dget_parent(path.dentry); - dput(path.dentry); - path.dentry = parent; - exp = exp_get_by_name(clp, &path, reqp); + struct dentry *saved = dget(path->dentry); + svc_export *exp = exp_get_by_name(clp, path, NULL); + + while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path->dentry)) { + struct dentry *parent = dget_parent(path->dentry); + dput(path->dentry); + path->dentry = parent; + exp = exp_get_by_name(clp, path, NULL); } - dput(path.dentry); + dput(path->dentry); + path->dentry = saved; return exp; } @@ -1174,7 +1170,7 @@ exp_rootfh(svc_client *clp, char *name, struct knfsd_fh *f, int maxsize) dprintk("nfsd: exp_rootfh(%s [%p] %s:%s/%ld)\n", name, path.dentry, clp->name, inode->i_sb->s_id, inode->i_ino); - exp = exp_parent(clp, path.mnt, path.dentry, NULL); + exp = exp_parent(clp, &path); if (IS_ERR(exp)) { err = PTR_ERR(exp); goto out;