Commit 76bebcc7 authored by Chuck Lever's avatar Chuck Lever

NFSD: Add nfsd4_encode_count4()

This is a synonym for nfsd4_encode_uint32_t() that matches the
name of the XDR type. It will get at least one more use in a
subsequent patch.
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent ae1131d4
...@@ -4619,12 +4619,17 @@ nfsd4_encode_write(struct nfsd4_compoundres *resp, __be32 nfserr, ...@@ -4619,12 +4619,17 @@ nfsd4_encode_write(struct nfsd4_compoundres *resp, __be32 nfserr,
union nfsd4_op_u *u) union nfsd4_op_u *u)
{ {
struct nfsd4_write *write = &u->write; struct nfsd4_write *write = &u->write;
struct xdr_stream *xdr = resp->xdr;
if (xdr_stream_encode_u32(resp->xdr, write->wr_bytes_written) < 0) /* count */
return nfserr_resource; nfserr = nfsd4_encode_count4(xdr, write->wr_bytes_written);
if (xdr_stream_encode_u32(resp->xdr, write->wr_how_written) < 0) if (nfserr)
return nfserr;
/* committed */
if (xdr_stream_encode_u32(xdr, write->wr_how_written) != XDR_UNIT)
return nfserr_resource; return nfserr_resource;
return nfsd4_encode_verifier4(resp->xdr, &write->wr_verifier); /* writeverf */
return nfsd4_encode_verifier4(xdr, &write->wr_verifier);
} }
static __be32 static __be32
......
...@@ -93,6 +93,7 @@ nfsd4_encode_uint32_t(struct xdr_stream *xdr, u32 val) ...@@ -93,6 +93,7 @@ nfsd4_encode_uint32_t(struct xdr_stream *xdr, u32 val)
#define nfsd4_encode_aceflag4(x, v) nfsd4_encode_uint32_t(x, v) #define nfsd4_encode_aceflag4(x, v) nfsd4_encode_uint32_t(x, v)
#define nfsd4_encode_acemask4(x, v) nfsd4_encode_uint32_t(x, v) #define nfsd4_encode_acemask4(x, v) nfsd4_encode_uint32_t(x, v)
#define nfsd4_encode_acetype4(x, v) nfsd4_encode_uint32_t(x, v) #define nfsd4_encode_acetype4(x, v) nfsd4_encode_uint32_t(x, v)
#define nfsd4_encode_count4(x, v) nfsd4_encode_uint32_t(x, v)
#define nfsd4_encode_mode4(x, v) nfsd4_encode_uint32_t(x, v) #define nfsd4_encode_mode4(x, v) nfsd4_encode_uint32_t(x, v)
#define nfsd4_encode_nfs_lease4(x, v) nfsd4_encode_uint32_t(x, v) #define nfsd4_encode_nfs_lease4(x, v) nfsd4_encode_uint32_t(x, v)
......
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