diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2023-10-09 21:30:29 +0300 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2023-10-16 19:44:37 +0300 |
commit | 1f121e2de4857258ac9ecf6d1844f2d581612395 (patch) | |
tree | dfb3fccbd9c9140ede71023506d095b296dc2687 /fs/nfsd/nfs4xdr.c | |
parent | b609ad60b7adcb0594fa2278f1d8ffecc4fd07d4 (diff) | |
download | linux-1f121e2de4857258ac9ecf6d1844f2d581612395.tar.xz |
NFSD: Clean up nfsd4_encode_seek()
Use modern XDR encoder utilities.
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/nfs4xdr.c')
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index aa477ba2a654..ec4ed6206df1 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -5279,13 +5279,14 @@ nfsd4_encode_seek(struct nfsd4_compoundres *resp, __be32 nfserr, union nfsd4_op_u *u) { struct nfsd4_seek *seek = &u->seek; - __be32 *p; - - p = xdr_reserve_space(resp->xdr, 4 + 8); - *p++ = cpu_to_be32(seek->seek_eof); - p = xdr_encode_hyper(p, seek->seek_pos); + struct xdr_stream *xdr = resp->xdr; - return 0; + /* sr_eof */ + nfserr = nfsd4_encode_bool(xdr, seek->seek_eof); + if (nfserr != nfs_ok) + return nfserr; + /* sr_offset */ + return nfsd4_encode_offset4(xdr, seek->seek_pos); } static __be32 |