Skip to content

Commit df547ef

Browse files
J. Bruce FieldsLinus Torvalds
authored andcommitted
knfsd: nfsd4: simplify exp_pseudoroot arguments
We're passing three arguments to exp_pseudoroot, two of which are just fields of the svc_rqst. Soon we'll want to pass in a third field as well. So let's just give up and pass in the whole struct svc_rqst. Also sneak in some minor style cleanups while we're at it. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent e677bfe commit df547ef

4 files changed

Lines changed: 7 additions & 9 deletions

File tree

‎fs/nfsd/export.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,16 +1235,15 @@ exp_find(struct auth_domain *clp, int fsid_type, u32 *fsidv,
12351235
* export point with fsid==0
12361236
*/
12371237
__be32
1238-
exp_pseudoroot(struct auth_domain *clp, struct svc_fh *fhp,
1239-
struct cache_req *creq)
1238+
exp_pseudoroot(struct svc_rqst *rqstp, struct svc_fh *fhp)
12401239
{
12411240
struct svc_export *exp;
12421241
__be32 rv;
12431242
u32 fsidv[2];
12441243

12451244
mk_fsid(FSID_NUM, fsidv, 0, 0, 0, NULL);
12461245

1247-
exp = exp_find(clp, FSID_NUM, fsidv, creq);
1246+
exp = exp_find(rqstp->rq_client, FSID_NUM, fsidv, rqstp->rq_chandle);
12481247
if (PTR_ERR(exp) == -ENOENT)
12491248
return nfserr_perm;
12501249
if (IS_ERR(exp))

‎fs/nfsd/nfs4proc.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,7 @@ nfsd4_putrootfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
286286
__be32 status;
287287

288288
fh_put(&cstate->current_fh);
289-
status = exp_pseudoroot(rqstp->rq_client, &cstate->current_fh,
290-
&rqstp->rq_chandle);
289+
status = exp_pseudoroot(rqstp, &cstate->current_fh);
291290
return status;
292291
}
293292

@@ -474,8 +473,8 @@ nfsd4_lookupp(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
474473
__be32 ret;
475474

476475
fh_init(&tmp_fh, NFS4_FHSIZE);
477-
if((ret = exp_pseudoroot(rqstp->rq_client, &tmp_fh,
478-
&rqstp->rq_chandle)) != 0)
476+
ret = exp_pseudoroot(rqstp, &tmp_fh);
477+
if (ret)
479478
return ret;
480479
if (tmp_fh.fh_dentry == cstate->current_fh.fh_dentry) {
481480
fh_put(&tmp_fh);

‎fs/nfsd/nfs4xdr.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1296,7 +1296,7 @@ static char *nfsd4_path(struct svc_rqst *rqstp, struct svc_export *exp, __be32 *
12961296
char *path, *rootpath;
12971297

12981298
fh_init(&tmp_fh, NFS4_FHSIZE);
1299-
*stat = exp_pseudoroot(rqstp->rq_client, &tmp_fh, &rqstp->rq_chandle);
1299+
*stat = exp_pseudoroot(rqstp, &tmp_fh);
13001300
if (*stat)
13011301
return NULL;
13021302
rootpath = tmp_fh.fh_export->ex_path;

‎include/linux/nfsd/export.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ struct svc_export * exp_parent(struct auth_domain *clp,
135135
struct cache_req *reqp);
136136
int exp_rootfh(struct auth_domain *,
137137
char *path, struct knfsd_fh *, int maxsize);
138-
__be32 exp_pseudoroot(struct auth_domain *, struct svc_fh *fhp, struct cache_req *creq);
138+
__be32 exp_pseudoroot(struct svc_rqst *, struct svc_fh *);
139139
__be32 nfserrno(int errno);
140140

141141
extern struct cache_detail svc_export_cache;

0 commit comments

Comments
 (0)