Commit e6218d39 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] knfsd: nfsd4: encode_dirent: simplify nfs4_encode_dirent_fattr

Make nfsd4_encode_dirent_fattr() slightly more concise.
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b5d85ce8
...@@ -1778,10 +1778,8 @@ nfsd4_encode_dirent_fattr(struct nfsd4_readdir *cd, ...@@ -1778,10 +1778,8 @@ nfsd4_encode_dirent_fattr(struct nfsd4_readdir *cd,
int nfserr; int nfserr;
dentry = lookup_one_len(name, cd->rd_fhp->fh_dentry, namlen); dentry = lookup_one_len(name, cd->rd_fhp->fh_dentry, namlen);
if (IS_ERR(dentry)) { if (IS_ERR(dentry))
nfserr = nfserrno(PTR_ERR(dentry)); return nfserrno(PTR_ERR(dentry));
return nfserr;
}
exp_get(exp); exp_get(exp);
if (d_mountpoint(dentry)) { if (d_mountpoint(dentry)) {
...@@ -1793,10 +1791,8 @@ nfsd4_encode_dirent_fattr(struct nfsd4_readdir *cd, ...@@ -1793,10 +1791,8 @@ nfsd4_encode_dirent_fattr(struct nfsd4_readdir *cd,
* options on exp. When the answer comes back, * options on exp. When the answer comes back,
* this call will be retried. * this call will be retried.
*/ */
dput(dentry);
exp_put(exp);
nfserr = nfserr_dropit; nfserr = nfserr_dropit;
return nfserr; goto out_put;
} }
} }
...@@ -1804,6 +1800,7 @@ nfsd4_encode_dirent_fattr(struct nfsd4_readdir *cd, ...@@ -1804,6 +1800,7 @@ nfsd4_encode_dirent_fattr(struct nfsd4_readdir *cd,
nfserr = nfsd4_encode_fattr(NULL, exp, nfserr = nfsd4_encode_fattr(NULL, exp,
dentry, p, buflen, cd->rd_bmval, dentry, p, buflen, cd->rd_bmval,
cd->rd_rqstp); cd->rd_rqstp);
out_put:
dput(dentry); dput(dentry);
exp_put(exp); exp_put(exp);
return nfserr; return nfserr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment