mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-02 10:43:57 +08:00
NFSD: Replace READ* macros in nfsd4_decode_setclientid()
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
parent
44592fe947
commit
92fa6c08c2
@ -1310,31 +1310,46 @@ nfsd4_decode_setattr(struct nfsd4_compoundargs *argp, struct nfsd4_setattr *seta
|
|||||||
static __be32
|
static __be32
|
||||||
nfsd4_decode_setclientid(struct nfsd4_compoundargs *argp, struct nfsd4_setclientid *setclientid)
|
nfsd4_decode_setclientid(struct nfsd4_compoundargs *argp, struct nfsd4_setclientid *setclientid)
|
||||||
{
|
{
|
||||||
DECODE_HEAD;
|
__be32 *p, status;
|
||||||
|
|
||||||
if (argp->minorversion >= 1)
|
if (argp->minorversion >= 1)
|
||||||
return nfserr_notsupp;
|
return nfserr_notsupp;
|
||||||
|
|
||||||
READ_BUF(NFS4_VERIFIER_SIZE);
|
status = nfsd4_decode_verifier4(argp, &setclientid->se_verf);
|
||||||
COPYMEM(setclientid->se_verf.data, NFS4_VERIFIER_SIZE);
|
if (status)
|
||||||
|
return status;
|
||||||
status = nfsd4_decode_opaque(argp, &setclientid->se_name);
|
status = nfsd4_decode_opaque(argp, &setclientid->se_name);
|
||||||
if (status)
|
if (status)
|
||||||
|
return status;
|
||||||
|
if (xdr_stream_decode_u32(argp->xdr, &setclientid->se_callback_prog) < 0)
|
||||||
return nfserr_bad_xdr;
|
return nfserr_bad_xdr;
|
||||||
READ_BUF(8);
|
if (xdr_stream_decode_u32(argp->xdr, &setclientid->se_callback_netid_len) < 0)
|
||||||
setclientid->se_callback_prog = be32_to_cpup(p++);
|
return nfserr_bad_xdr;
|
||||||
setclientid->se_callback_netid_len = be32_to_cpup(p++);
|
p = xdr_inline_decode(argp->xdr, setclientid->se_callback_netid_len);
|
||||||
READ_BUF(setclientid->se_callback_netid_len);
|
if (!p)
|
||||||
SAVEMEM(setclientid->se_callback_netid_val, setclientid->se_callback_netid_len);
|
return nfserr_bad_xdr;
|
||||||
READ_BUF(4);
|
setclientid->se_callback_netid_val = svcxdr_tmpalloc(argp,
|
||||||
setclientid->se_callback_addr_len = be32_to_cpup(p++);
|
setclientid->se_callback_netid_len);
|
||||||
|
if (!setclientid->se_callback_netid_val)
|
||||||
|
return nfserr_jukebox;
|
||||||
|
memcpy(setclientid->se_callback_netid_val, p,
|
||||||
|
setclientid->se_callback_netid_len);
|
||||||
|
|
||||||
READ_BUF(setclientid->se_callback_addr_len);
|
if (xdr_stream_decode_u32(argp->xdr, &setclientid->se_callback_addr_len) < 0)
|
||||||
SAVEMEM(setclientid->se_callback_addr_val, setclientid->se_callback_addr_len);
|
return nfserr_bad_xdr;
|
||||||
READ_BUF(4);
|
p = xdr_inline_decode(argp->xdr, setclientid->se_callback_addr_len);
|
||||||
setclientid->se_callback_ident = be32_to_cpup(p++);
|
if (!p)
|
||||||
|
return nfserr_bad_xdr;
|
||||||
|
setclientid->se_callback_addr_val = svcxdr_tmpalloc(argp,
|
||||||
|
setclientid->se_callback_addr_len);
|
||||||
|
if (!setclientid->se_callback_addr_val)
|
||||||
|
return nfserr_jukebox;
|
||||||
|
memcpy(setclientid->se_callback_addr_val, p,
|
||||||
|
setclientid->se_callback_addr_len);
|
||||||
|
if (xdr_stream_decode_u32(argp->xdr, &setclientid->se_callback_ident) < 0)
|
||||||
|
return nfserr_bad_xdr;
|
||||||
|
|
||||||
DECODE_TAIL;
|
return nfs_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __be32
|
static __be32
|
||||||
|
Loading…
Reference in New Issue
Block a user