NFSD: Replace READ* macros in nfsd4_decode_lock()
[ Upstream commit 7c59deed5cd2e1cfc6cbecf06f4584ac53755f53 ] Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
4f0ad736dc
commit
9618fd094a
1 changed files with 10 additions and 14 deletions
|
@ -878,21 +878,17 @@ nfsd4_decode_locker4(struct nfsd4_compoundargs *argp, struct nfsd4_lock *lock)
|
||||||
static __be32
|
static __be32
|
||||||
nfsd4_decode_lock(struct nfsd4_compoundargs *argp, struct nfsd4_lock *lock)
|
nfsd4_decode_lock(struct nfsd4_compoundargs *argp, struct nfsd4_lock *lock)
|
||||||
{
|
{
|
||||||
DECODE_HEAD;
|
if (xdr_stream_decode_u32(argp->xdr, &lock->lk_type) < 0)
|
||||||
|
return nfserr_bad_xdr;
|
||||||
/*
|
|
||||||
* type, reclaim(boolean), offset, length, new_lock_owner(boolean)
|
|
||||||
*/
|
|
||||||
READ_BUF(28);
|
|
||||||
lock->lk_type = be32_to_cpup(p++);
|
|
||||||
if ((lock->lk_type < NFS4_READ_LT) || (lock->lk_type > NFS4_WRITEW_LT))
|
if ((lock->lk_type < NFS4_READ_LT) || (lock->lk_type > NFS4_WRITEW_LT))
|
||||||
goto xdr_error;
|
return nfserr_bad_xdr;
|
||||||
lock->lk_reclaim = be32_to_cpup(p++);
|
if (xdr_stream_decode_bool(argp->xdr, &lock->lk_reclaim) < 0)
|
||||||
p = xdr_decode_hyper(p, &lock->lk_offset);
|
return nfserr_bad_xdr;
|
||||||
p = xdr_decode_hyper(p, &lock->lk_length);
|
if (xdr_stream_decode_u64(argp->xdr, &lock->lk_offset) < 0)
|
||||||
status = nfsd4_decode_locker4(argp, lock);
|
return nfserr_bad_xdr;
|
||||||
|
if (xdr_stream_decode_u64(argp->xdr, &lock->lk_length) < 0)
|
||||||
DECODE_TAIL;
|
return nfserr_bad_xdr;
|
||||||
|
return nfsd4_decode_locker4(argp, lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __be32
|
static __be32
|
||||||
|
|
Loading…
Add table
Reference in a new issue