Commit 87915c64 authored by J. Bruce Fields's avatar J. Bruce Fields

nfsd4: encode_rdattr_error cleanup

There's a simpler way to write this.
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 6b6d8137
...@@ -2620,17 +2620,14 @@ nfsd4_encode_dirent_fattr(struct nfsd4_readdir *cd, ...@@ -2620,17 +2620,14 @@ nfsd4_encode_dirent_fattr(struct nfsd4_readdir *cd,
static __be32 * static __be32 *
nfsd4_encode_rdattr_error(__be32 *p, int buflen, __be32 nfserr) nfsd4_encode_rdattr_error(__be32 *p, int buflen, __be32 nfserr)
{ {
__be32 *attrlenp;
if (buflen < 6) if (buflen < 6)
return NULL; return NULL;
*p++ = htonl(2); *p++ = htonl(2);
*p++ = htonl(FATTR4_WORD0_RDATTR_ERROR); /* bmval0 */ *p++ = htonl(FATTR4_WORD0_RDATTR_ERROR); /* bmval0 */
*p++ = htonl(0); /* bmval1 */ *p++ = htonl(0); /* bmval1 */
attrlenp = p++; *p++ = htonl(4); /* attribute length */
*p++ = nfserr; /* no htonl */ *p++ = nfserr; /* no htonl */
*attrlenp = htonl((char *)p - (char *)attrlenp - 4);
return p; return p;
} }
......
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