summaryrefslogtreecommitdiff
path: root/fs/nfsd
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2020-11-01 12:04:06 -0500
committerChuck Lever <chuck.lever@oracle.com>2020-11-30 14:46:39 -0500
commit61e5e0b3ec713d1365008c8af3fe5fdd262e2a60 (patch)
treeefb61d2938135dcc2e4ebd46e132c3b7d4e0181b /fs/nfsd
parent1708e50b0145f393acbec9e319bdf0e33f765d25 (diff)
NFSD: Replace READ* macros in nfsd4_decode_open()
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4xdr.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index c15d5f8ef191..ece7af152fb1 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -1124,7 +1124,7 @@ nfsd4_decode_open_claim4(struct nfsd4_compoundargs *argp,
static __be32
nfsd4_decode_open(struct nfsd4_compoundargs *argp, struct nfsd4_open *open)
{
- DECODE_HEAD;
+ __be32 status;
u32 dummy;
memset(open->op_bmval, 0, sizeof(open->op_bmval));
@@ -1132,28 +1132,24 @@ nfsd4_decode_open(struct nfsd4_compoundargs *argp, struct nfsd4_open *open)
open->op_openowner = NULL;
open->op_xdr_error = 0;
- /* seqid, share_access, share_deny, clientid, ownerlen */
- READ_BUF(4);
- open->op_seqid = be32_to_cpup(p++);
- /* decode, yet ignore deleg_when until supported */
+ if (xdr_stream_decode_u32(argp->xdr, &open->op_seqid) < 0)
+ return nfserr_bad_xdr;
+ /* deleg_want is ignored */
status = nfsd4_decode_share_access(argp, &open->op_share_access,
&open->op_deleg_want, &dummy);
if (status)
- goto xdr_error;
+ return status;
status = nfsd4_decode_share_deny(argp, &open->op_share_deny);
if (status)
- goto xdr_error;
- READ_BUF(sizeof(clientid_t));
- COPYMEM(&open->op_clientid, sizeof(clientid_t));
- status = nfsd4_decode_opaque(argp, &open->op_owner);
+ return status;
+ status = nfsd4_decode_state_owner4(argp, &open->op_clientid,
+ &open->op_owner);
if (status)
- goto xdr_error;
+ return status;
status = nfsd4_decode_openflag4(argp, open);
if (status)
return status;
- status = nfsd4_decode_open_claim4(argp, open);
-
- DECODE_TAIL;
+ return nfsd4_decode_open_claim4(argp, open);
}
static __be32