summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorThorsten Blum <thorsten.blum@linux.dev>2026-04-05 12:32:14 +0200
committerTrond Myklebust <trond.myklebust@hammerspace.com>2026-04-22 08:53:23 -0400
commit43ea7036ee50b5368b1c361e8a3591aa0f1455d9 (patch)
tree3ab7fdad1305542c10603cea650a0393b6a58488 /fs
parent8c787b286f39c7584440b97b92f87cbe934c13ff (diff)
nfs: use memcpy_and_pad in decode_fh
Use memcpy_and_pad() instead of memcpy() followed by memset() to simplify decode_fh(). Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/callback_xdr.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
index 176873f45677..4382baddc9ee 100644
--- a/fs/nfs/callback_xdr.c
+++ b/fs/nfs/callback_xdr.c
@@ -96,8 +96,7 @@ static __be32 decode_fh(struct xdr_stream *xdr, struct nfs_fh *fh)
p = xdr_inline_decode(xdr, fh->size);
if (unlikely(p == NULL))
return htonl(NFS4ERR_RESOURCE);
- memcpy(&fh->data[0], p, fh->size);
- memset(&fh->data[fh->size], 0, sizeof(fh->data) - fh->size);
+ memcpy_and_pad(fh->data, sizeof(fh->data), p, fh->size, 0);
return 0;
}