Skip to content

Commit b609ad6

Browse files
committed
NFSD: Clean up nfsd4_encode_offset_status()
Use modern XDR encoder utilities. Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 21d316a commit b609ad6

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

fs/nfsd/nfs4xdr.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5189,14 +5189,15 @@ nfsd4_encode_offload_status(struct nfsd4_compoundres *resp, __be32 nfserr,
51895189
{
51905190
struct nfsd4_offload_status *os = &u->offload_status;
51915191
struct xdr_stream *xdr = resp->xdr;
5192-
__be32 *p;
51935192

5194-
p = xdr_reserve_space(xdr, 8 + 4);
5195-
if (!p)
5193+
/* osr_count */
5194+
nfserr = nfsd4_encode_length4(xdr, os->count);
5195+
if (nfserr != nfs_ok)
5196+
return nfserr;
5197+
/* osr_complete<1> */
5198+
if (xdr_stream_encode_u32(xdr, 0) != XDR_UNIT)
51965199
return nfserr_resource;
5197-
p = xdr_encode_hyper(p, os->count);
5198-
*p++ = cpu_to_be32(0);
5199-
return nfserr;
5200+
return nfs_ok;
52005201
}
52015202

52025203
static __be32

0 commit comments

Comments
 (0)