Commit 74f1778d authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] knfsd: nfsd4 encode_dirent cleanup

No sensible client is ever going to request only the RDATTR_ERROR attribute, so
there's no point optimizing for that case.
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 831804e6
......@@ -1805,11 +1805,7 @@ nfsd4_encode_dirent(struct readdir_cd *ccd, const char *name, int namlen,
*/
bmval0 = cd->rd_bmval[0];
bmval1 = cd->rd_bmval[1];
if ((bmval0 & ~(FATTR4_WORD0_RDATTR_ERROR)) || bmval1) {
/*
* "Heavyweight" case: we have no choice except to
* call nfsd4_encode_fattr().
*/
dentry = lookup_one_len(name, cd->rd_fhp->fh_dentry, namlen);
if (IS_ERR(dentry)) {
nfserr = nfserrno(PTR_ERR(dentry));
......@@ -1864,14 +1860,7 @@ nfsd4_encode_dirent(struct readdir_cd *ccd, const char *name, int namlen,
bmval0 = FATTR4_WORD0_RDATTR_ERROR;
bmval1 = 0;
/* falling through here will do the right thing... */
}
/*
* In the common "lightweight" case, we avoid
* the overhead of nfsd4_encode_fattr() by assembling
* a small fattr by hand.
*/
if (buflen < 6)
goto nospc;
*p++ = htonl(2);
......@@ -1879,7 +1868,6 @@ nfsd4_encode_dirent(struct readdir_cd *ccd, const char *name, int namlen,
*p++ = htonl(bmval1);
attrlenp = p++;
if (bmval0 & FATTR4_WORD0_RDATTR_ERROR)
*p++ = nfserr; /* no htonl */
*attrlenp = htonl((char *)p - (char *)attrlenp - 4);
......
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