Skip to content

Commit 1f121e2

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

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
@@ -5279,13 +5279,14 @@ nfsd4_encode_seek(struct nfsd4_compoundres *resp, __be32 nfserr,
52795279
union nfsd4_op_u *u)
52805280
{
52815281
struct nfsd4_seek *seek = &u->seek;
5282-
__be32 *p;
5283-
5284-
p = xdr_reserve_space(resp->xdr, 4 + 8);
5285-
*p++ = cpu_to_be32(seek->seek_eof);
5286-
p = xdr_encode_hyper(p, seek->seek_pos);
5282+
struct xdr_stream *xdr = resp->xdr;
52875283

5288-
return 0;
5284+
/* sr_eof */
5285+
nfserr = nfsd4_encode_bool(xdr, seek->seek_eof);
5286+
if (nfserr != nfs_ok)
5287+
return nfserr;
5288+
/* sr_offset */
5289+
return nfsd4_encode_offset4(xdr, seek->seek_pos);
52895290
}
52905291

52915292
static __be32

0 commit comments

Comments
 (0)