提交 f38b20c6 编写于 作者: J J.Bruce Fields 提交者: Linus Torvalds

[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: NJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: NNeil Brown <neilb@suse.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 8f8e05c5
...@@ -1048,30 +1048,24 @@ int ...@@ -1048,30 +1048,24 @@ int
exp_pseudoroot(struct auth_domain *clp, struct svc_fh *fhp, exp_pseudoroot(struct auth_domain *clp, struct svc_fh *fhp,
struct cache_req *creq) struct cache_req *creq)
{ {
struct svc_expkey *fsid_key;
struct svc_export *exp; struct svc_export *exp;
int rv; int rv;
u32 fsidv[2]; u32 fsidv[2];
mk_fsid_v1(fsidv, 0); mk_fsid_v1(fsidv, 0);
fsid_key = exp_find_key(clp, 1, fsidv, creq); exp = exp_find(clp, 1, fsidv, creq);
if (IS_ERR(fsid_key) && PTR_ERR(fsid_key) == -EAGAIN) if (IS_ERR(exp) && PTR_ERR(exp) == -EAGAIN)
return nfserr_dropit; return nfserr_dropit;
if (!fsid_key || IS_ERR(fsid_key))
return nfserr_perm;
exp = exp_get_by_name(clp, fsid_key->ek_mnt, fsid_key->ek_dentry, creq);
if (exp == NULL) if (exp == NULL)
rv = nfserr_perm; rv = nfserr_perm;
else if (IS_ERR(exp)) else if (IS_ERR(exp))
rv = nfserrno(PTR_ERR(exp)); rv = nfserrno(PTR_ERR(exp));
else { else {
rv = fh_compose(fhp, exp, rv = fh_compose(fhp, exp,
fsid_key->ek_dentry, NULL); exp->ex_dentry, NULL);
exp_put(exp); exp_put(exp);
} }
cache_put(&fsid_key->h, &svc_expkey_cache);
return rv; return rv;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册