NFSD: Replace READ* macros in nfsd4_decode_clone()
[ Upstream commit 3dfd0b0e15671e2b4047ccb9222432f0b2d930be ] Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
a2f6c16ad1
commit
b719fc9375
@@ -575,18 +575,6 @@ nfsd4_decode_fattr4(struct nfsd4_compoundargs *argp, u32 *bmval, u32 bmlen,
|
|||||||
return nfs_ok;
|
return nfs_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __be32
|
|
||||||
nfsd4_decode_stateid(struct nfsd4_compoundargs *argp, stateid_t *sid)
|
|
||||||
{
|
|
||||||
DECODE_HEAD;
|
|
||||||
|
|
||||||
READ_BUF(sizeof(stateid_t));
|
|
||||||
sid->si_generation = be32_to_cpup(p++);
|
|
||||||
COPYMEM(&sid->si_opaque, sizeof(stateid_opaque_t));
|
|
||||||
|
|
||||||
DECODE_TAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static __be32
|
static __be32
|
||||||
nfsd4_decode_stateid4(struct nfsd4_compoundargs *argp, stateid_t *sid)
|
nfsd4_decode_stateid4(struct nfsd4_compoundargs *argp, stateid_t *sid)
|
||||||
{
|
{
|
||||||
@@ -1919,25 +1907,6 @@ nfsd4_decode_fallocate(struct nfsd4_compoundargs *argp,
|
|||||||
return nfs_ok;
|
return nfs_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __be32
|
|
||||||
nfsd4_decode_clone(struct nfsd4_compoundargs *argp, struct nfsd4_clone *clone)
|
|
||||||
{
|
|
||||||
DECODE_HEAD;
|
|
||||||
|
|
||||||
status = nfsd4_decode_stateid(argp, &clone->cl_src_stateid);
|
|
||||||
if (status)
|
|
||||||
return status;
|
|
||||||
status = nfsd4_decode_stateid(argp, &clone->cl_dst_stateid);
|
|
||||||
if (status)
|
|
||||||
return status;
|
|
||||||
|
|
||||||
READ_BUF(8 + 8 + 8);
|
|
||||||
p = xdr_decode_hyper(p, &clone->cl_src_pos);
|
|
||||||
p = xdr_decode_hyper(p, &clone->cl_dst_pos);
|
|
||||||
p = xdr_decode_hyper(p, &clone->cl_count);
|
|
||||||
DECODE_TAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static __be32 nfsd4_decode_nl4_server(struct nfsd4_compoundargs *argp,
|
static __be32 nfsd4_decode_nl4_server(struct nfsd4_compoundargs *argp,
|
||||||
struct nl4_server *ns)
|
struct nl4_server *ns)
|
||||||
{
|
{
|
||||||
@@ -2067,6 +2036,27 @@ nfsd4_decode_seek(struct nfsd4_compoundargs *argp, struct nfsd4_seek *seek)
|
|||||||
return nfs_ok;
|
return nfs_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static __be32
|
||||||
|
nfsd4_decode_clone(struct nfsd4_compoundargs *argp, struct nfsd4_clone *clone)
|
||||||
|
{
|
||||||
|
__be32 status;
|
||||||
|
|
||||||
|
status = nfsd4_decode_stateid4(argp, &clone->cl_src_stateid);
|
||||||
|
if (status)
|
||||||
|
return status;
|
||||||
|
status = nfsd4_decode_stateid4(argp, &clone->cl_dst_stateid);
|
||||||
|
if (status)
|
||||||
|
return status;
|
||||||
|
if (xdr_stream_decode_u64(argp->xdr, &clone->cl_src_pos) < 0)
|
||||||
|
return nfserr_bad_xdr;
|
||||||
|
if (xdr_stream_decode_u64(argp->xdr, &clone->cl_dst_pos) < 0)
|
||||||
|
return nfserr_bad_xdr;
|
||||||
|
if (xdr_stream_decode_u64(argp->xdr, &clone->cl_count) < 0)
|
||||||
|
return nfserr_bad_xdr;
|
||||||
|
|
||||||
|
return nfs_ok;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* XDR data that is more than PAGE_SIZE in size is normally part of a
|
* XDR data that is more than PAGE_SIZE in size is normally part of a
|
||||||
* read or write. However, the size of extended attributes is limited
|
* read or write. However, the size of extended attributes is limited
|
||||||
|
Reference in New Issue
Block a user