aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/nfs4xdr.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 00630f42a2b4..f69aafc23d44 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -2433,11 +2433,6 @@ static int nfs4_xdr_enc_get_lease_time(struct rpc_rqst *req, uint32_t *p,
2433 * task to translate them into Linux-specific versions which are more 2433 * task to translate them into Linux-specific versions which are more
2434 * consistent with the style used in NFSv2/v3... 2434 * consistent with the style used in NFSv2/v3...
2435 */ 2435 */
2436#define COPYMEM(x,nbytes) do { \
2437 memcpy((x), p, nbytes); \
2438 p += XDR_QUADLEN(nbytes); \
2439} while (0)
2440
2441#define READ_BUF(nbytes) do { \ 2436#define READ_BUF(nbytes) do { \
2442 p = xdr_inline_decode(xdr, nbytes); \ 2437 p = xdr_inline_decode(xdr, nbytes); \
2443 if (unlikely(!p)) { \ 2438 if (unlikely(!p)) { \
@@ -3607,7 +3602,7 @@ static int decode_getfh(struct xdr_stream *xdr, struct nfs_fh *fh)
3607 return -EIO; 3602 return -EIO;
3608 fh->size = len; 3603 fh->size = len;
3609 READ_BUF(len); 3604 READ_BUF(len);
3610 COPYMEM(fh->data, len); 3605 memcpy(fh->data, p, len);
3611 return 0; 3606 return 0;
3612} 3607}
3613 3608
@@ -4097,7 +4092,7 @@ static int decode_setclientid(struct xdr_stream *xdr, struct nfs_client *clp)
4097 if (nfserr == NFS_OK) { 4092 if (nfserr == NFS_OK) {
4098 READ_BUF(8 + NFS4_VERIFIER_SIZE); 4093 READ_BUF(8 + NFS4_VERIFIER_SIZE);
4099 p = xdr_decode_hyper(p, &clp->cl_clientid); 4094 p = xdr_decode_hyper(p, &clp->cl_clientid);
4100 COPYMEM(clp->cl_confirm.data, NFS4_VERIFIER_SIZE); 4095 memcpy(clp->cl_confirm.data, p, NFS4_VERIFIER_SIZE);
4101 } else if (nfserr == NFSERR_CLID_INUSE) { 4096 } else if (nfserr == NFSERR_CLID_INUSE) {
4102 uint32_t len; 4097 uint32_t len;
4103 4098
@@ -4134,7 +4129,7 @@ static int decode_write(struct xdr_stream *xdr, struct nfs_writeres *res)
4134 READ_BUF(16); 4129 READ_BUF(16);
4135 res->count = be32_to_cpup(p++); 4130 res->count = be32_to_cpup(p++);
4136 res->verf->committed = be32_to_cpup(p++); 4131 res->verf->committed = be32_to_cpup(p++);
4137 COPYMEM(res->verf->verifier, 8); 4132 memcpy(res->verf->verifier, p, 8);
4138 return 0; 4133 return 0;
4139} 4134}
4140 4135