aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2009-04-18 02:14:32 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2009-06-11 21:36:00 -0400
commit5bf3bd2b5cb68ba43c91f5bd0ac043543fba2558 (patch)
treea8804b29b2e025a2d0f5a81d5f286b2c5d3fd84e /fs
parent55430e2ecee574e729c12d4063b3ecabfa98fa82 (diff)
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/export.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 3f6d51b8c3ef..5149dabde555 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -871,23 +871,19 @@ static svc_export *exp_get_by_name(svc_client *clp, const struct path *path,
871/* 871/*
872 * Find the export entry for a given dentry. 872 * Find the export entry for a given dentry.
873 */ 873 */
874static struct svc_export *exp_parent(svc_client *clp, struct vfsmount *mnt, 874static struct svc_export *exp_parent(svc_client *clp, struct path *path)
875 struct dentry *dentry,
876 struct cache_req *reqp)
877{ 875{
878 struct path path = {.mnt = mnt, .dentry = dentry}; 876 struct dentry *saved = dget(path->dentry);
879 svc_export *exp; 877 svc_export *exp = exp_get_by_name(clp, path, NULL);
880 878
881 dget(path.dentry); 879 while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path->dentry)) {
882 exp = exp_get_by_name(clp, &path, reqp); 880 struct dentry *parent = dget_parent(path->dentry);
883 881 dput(path->dentry);
884 while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path.dentry)) { 882 path->dentry = parent;
885 struct dentry *parent = dget_parent(path.dentry); 883 exp = exp_get_by_name(clp, path, NULL);
886 dput(path.dentry);
887 path.dentry = parent;
888 exp = exp_get_by_name(clp, &path, reqp);
889 } 884 }
890 dput(path.dentry); 885 dput(path->dentry);
886 path->dentry = saved;
891 return exp; 887 return exp;
892} 888}
893 889
@@ -1174,7 +1170,7 @@ exp_rootfh(svc_client *clp, char *name, struct knfsd_fh *f, int maxsize)
1174 dprintk("nfsd: exp_rootfh(%s [%p] %s:%s/%ld)\n", 1170 dprintk("nfsd: exp_rootfh(%s [%p] %s:%s/%ld)\n",
1175 name, path.dentry, clp->name, 1171 name, path.dentry, clp->name,
1176 inode->i_sb->s_id, inode->i_ino); 1172 inode->i_sb->s_id, inode->i_ino);
1177 exp = exp_parent(clp, path.mnt, path.dentry, NULL); 1173 exp = exp_parent(clp, &path);
1178 if (IS_ERR(exp)) { 1174 if (IS_ERR(exp)) {
1179 err = PTR_ERR(exp); 1175 err = PTR_ERR(exp);
1180 goto out; 1176 goto out;