nfsd4: encode_rdattr_error cleanup
authorJ. Bruce Fields <bfields@redhat.com>
Wed, 16 Jan 2013 22:33:28 +0000 (17:33 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Tue, 7 Jan 2014 21:01:18 +0000 (16:01 -0500)
There's a simpler way to write this.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4xdr.c

index 3bffba6..67b4496 100644 (file)
@@ -2620,17 +2620,14 @@ out_put:
 static __be32 *
 nfsd4_encode_rdattr_error(__be32 *p, int buflen, __be32 nfserr)
 {
-       __be32 *attrlenp;
-
        if (buflen < 6)
                return NULL;
        *p++ = htonl(2);
        *p++ = htonl(FATTR4_WORD0_RDATTR_ERROR); /* bmval0 */
        *p++ = htonl(0);                         /* bmval1 */
 
-       attrlenp = p++;
+       *p++ = htonl(4);     /* attribute length */
        *p++ = nfserr;       /* no htonl */
-       *attrlenp = htonl((char *)p - (char *)attrlenp - 4);
        return p;
 }