aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/export.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2009-04-18 02:42:05 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2009-06-11 21:36:00 -0400
commit91c9fa8f75877c0c1e455c23e8f8206c91c8f77f (patch)
treeee26e614577b079102327393832b2ed503a4b527 /fs/nfsd/export.c
parent5bf3bd2b5cb68ba43c91f5bd0ac043543fba2558 (diff)
switch rqst_exp_get_by_name()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nfsd/export.c')
-rw-r--r--fs/nfsd/export.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 5149dabde555..84f5e5cb0863 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -1240,18 +1240,15 @@ __be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp)
1240 * use exp_get_by_name() or exp_find(). 1240 * use exp_get_by_name() or exp_find().
1241 */ 1241 */
1242struct svc_export * 1242struct svc_export *
1243rqst_exp_get_by_name(struct svc_rqst *rqstp, struct vfsmount *mnt, 1243rqst_exp_get_by_name(struct svc_rqst *rqstp, struct path *path)
1244 struct dentry *dentry)
1245{ 1244{
1246 struct svc_export *gssexp, *exp = ERR_PTR(-ENOENT); 1245 struct svc_export *gssexp, *exp = ERR_PTR(-ENOENT);
1247 struct path path = {.mnt = mnt, .dentry = dentry};
1248 1246
1249 if (rqstp->rq_client == NULL) 1247 if (rqstp->rq_client == NULL)
1250 goto gss; 1248 goto gss;
1251 1249
1252 /* First try the auth_unix client: */ 1250 /* First try the auth_unix client: */
1253 exp = exp_get_by_name(rqstp->rq_client, &path, 1251 exp = exp_get_by_name(rqstp->rq_client, path, &rqstp->rq_chandle);
1254 &rqstp->rq_chandle);
1255 if (PTR_ERR(exp) == -ENOENT) 1252 if (PTR_ERR(exp) == -ENOENT)
1256 goto gss; 1253 goto gss;
1257 if (IS_ERR(exp)) 1254 if (IS_ERR(exp))
@@ -1263,8 +1260,7 @@ gss:
1263 /* Otherwise, try falling back on gss client */ 1260 /* Otherwise, try falling back on gss client */
1264 if (rqstp->rq_gssclient == NULL) 1261 if (rqstp->rq_gssclient == NULL)
1265 return exp; 1262 return exp;
1266 gssexp = exp_get_by_name(rqstp->rq_gssclient, &path, 1263 gssexp = exp_get_by_name(rqstp->rq_gssclient, path, &rqstp->rq_chandle);
1267 &rqstp->rq_chandle);
1268 if (PTR_ERR(gssexp) == -ENOENT) 1264 if (PTR_ERR(gssexp) == -ENOENT)
1269 return exp; 1265 return exp;
1270 if (!IS_ERR(exp)) 1266 if (!IS_ERR(exp))
@@ -1307,9 +1303,10 @@ rqst_exp_parent(struct svc_rqst *rqstp, struct vfsmount *mnt,
1307 struct dentry *dentry) 1303 struct dentry *dentry)
1308{ 1304{
1309 struct svc_export *exp; 1305 struct svc_export *exp;
1306 struct path path = {.mnt = mnt, .dentry = dentry};
1310 1307
1311 dget(dentry); 1308 dget(dentry);
1312 exp = rqst_exp_get_by_name(rqstp, mnt, dentry); 1309 exp = rqst_exp_get_by_name(rqstp, &path);
1313 1310
1314 while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(dentry)) { 1311 while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(dentry)) {
1315 struct dentry *parent; 1312 struct dentry *parent;
@@ -1317,7 +1314,7 @@ rqst_exp_parent(struct svc_rqst *rqstp, struct vfsmount *mnt,
1317 parent = dget_parent(dentry); 1314 parent = dget_parent(dentry);
1318 dput(dentry); 1315 dput(dentry);
1319 dentry = parent; 1316 dentry = parent;
1320 exp = rqst_exp_get_by_name(rqstp, mnt, dentry); 1317 exp = rqst_exp_get_by_name(rqstp, &path);
1321 } 1318 }
1322 dput(dentry); 1319 dput(dentry);
1323 return exp; 1320 return exp;