summaryrefslogtreecommitdiffstats
path: root/fs/nfs/flexfilelayout
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2020-11-11 15:52:47 -0500
committerChuck Lever <chuck.lever@oracle.com>2020-11-30 14:46:35 -0500
commit0ae4c3e8a64ace1b8d7de033b0751afe43024416 (patch)
tree605b7f98f2df64da9a17d3176a8fee8d5a06a0a0 /fs/nfs/flexfilelayout
parent231307df246eb29f30092836524ebb1fcb8f5b25 (diff)
downloadlinux-0ae4c3e8a64ace1b8d7de033b0751afe43024416.tar.gz
linux-0ae4c3e8a64ace1b8d7de033b0751afe43024416.tar.bz2
linux-0ae4c3e8a64ace1b8d7de033b0751afe43024416.zip
SUNRPC: Add xdr_set_scratch_page() and xdr_reset_scratch_buffer()
Clean up: De-duplicate some frequently-used code. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfs/flexfilelayout')
-rw-r--r--fs/nfs/flexfilelayout/flexfilelayout.c2
-rw-r--r--fs/nfs/flexfilelayout/flexfilelayoutdev.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
index a163533446fa..d7010686d39a 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.c
+++ b/fs/nfs/flexfilelayout/flexfilelayout.c
@@ -378,7 +378,7 @@ ff_layout_alloc_lseg(struct pnfs_layout_hdr *lh,
xdr_init_decode_pages(&stream, &buf, lgr->layoutp->pages,
lgr->layoutp->len);
- xdr_set_scratch_buffer(&stream, page_address(scratch), PAGE_SIZE);
+ xdr_set_scratch_page(&stream, scratch);
/* stripe unit and mirror_array_cnt */
rc = -EIO;
diff --git a/fs/nfs/flexfilelayout/flexfilelayoutdev.c b/fs/nfs/flexfilelayout/flexfilelayoutdev.c
index 3eda40a320a5..c9b61b818ec1 100644
--- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c
+++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c
@@ -69,7 +69,7 @@ nfs4_ff_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
INIT_LIST_HEAD(&dsaddrs);
xdr_init_decode_pages(&stream, &buf, pdev->pages, pdev->pglen);
- xdr_set_scratch_buffer(&stream, page_address(scratch), PAGE_SIZE);
+ xdr_set_scratch_page(&stream, scratch);
/* multipath count */
p = xdr_inline_decode(&stream, 4);