diff options
author | J.Bruce Fields <bfields@fieldses.org> | 2006-10-04 05:16:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-04 10:55:19 -0400 |
commit | f38b20c64519bb812a49b9ef4e10d90367a5af5c (patch) | |
tree | 84aae3534f4c1d00e56bac39adab2b8b1d530b91 /fs/nfsd/export.c | |
parent | 8f8e05c5708d7e9017c47f395f8b1498f7f52922 (diff) |
[PATCH] knfsd: nfsd4: refactor exp_pseudoroot
We could be using more common code in exp_pseudoroot(). This will also
simplify some changes we need to make later.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/nfsd/export.c')
-rw-r--r-- | fs/nfsd/export.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index cfe141e5d759..ac5149d25372 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c | |||
@@ -1048,30 +1048,24 @@ int | |||
1048 | exp_pseudoroot(struct auth_domain *clp, struct svc_fh *fhp, | 1048 | exp_pseudoroot(struct auth_domain *clp, struct svc_fh *fhp, |
1049 | struct cache_req *creq) | 1049 | struct cache_req *creq) |
1050 | { | 1050 | { |
1051 | struct svc_expkey *fsid_key; | ||
1052 | struct svc_export *exp; | 1051 | struct svc_export *exp; |
1053 | int rv; | 1052 | int rv; |
1054 | u32 fsidv[2]; | 1053 | u32 fsidv[2]; |
1055 | 1054 | ||
1056 | mk_fsid_v1(fsidv, 0); | 1055 | mk_fsid_v1(fsidv, 0); |
1057 | 1056 | ||
1058 | fsid_key = exp_find_key(clp, 1, fsidv, creq); | 1057 | exp = exp_find(clp, 1, fsidv, creq); |
1059 | if (IS_ERR(fsid_key) && PTR_ERR(fsid_key) == -EAGAIN) | 1058 | if (IS_ERR(exp) && PTR_ERR(exp) == -EAGAIN) |
1060 | return nfserr_dropit; | 1059 | return nfserr_dropit; |
1061 | if (!fsid_key || IS_ERR(fsid_key)) | ||
1062 | return nfserr_perm; | ||
1063 | |||
1064 | exp = exp_get_by_name(clp, fsid_key->ek_mnt, fsid_key->ek_dentry, creq); | ||
1065 | if (exp == NULL) | 1060 | if (exp == NULL) |
1066 | rv = nfserr_perm; | 1061 | rv = nfserr_perm; |
1067 | else if (IS_ERR(exp)) | 1062 | else if (IS_ERR(exp)) |
1068 | rv = nfserrno(PTR_ERR(exp)); | 1063 | rv = nfserrno(PTR_ERR(exp)); |
1069 | else { | 1064 | else { |
1070 | rv = fh_compose(fhp, exp, | 1065 | rv = fh_compose(fhp, exp, |
1071 | fsid_key->ek_dentry, NULL); | 1066 | exp->ex_dentry, NULL); |
1072 | exp_put(exp); | 1067 | exp_put(exp); |
1073 | } | 1068 | } |
1074 | cache_put(&fsid_key->h, &svc_expkey_cache); | ||
1075 | return rv; | 1069 | return rv; |
1076 | } | 1070 | } |
1077 | 1071 | ||