Skip to content

Commit cf28909

Browse files
author
Anna Schumaker
committed
NFS: Update the blocklayout to use xdr_set_scratch_folio()
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
1 parent c9cefd7 commit cf28909

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

fs/nfs/blocklayout/blocklayout.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ bl_alloc_lseg(struct pnfs_layout_hdr *lo, struct nfs4_layoutget_res *lgr,
676676
struct pnfs_layout_segment *lseg;
677677
struct xdr_buf buf;
678678
struct xdr_stream xdr;
679-
struct page *scratch;
679+
struct folio *scratch;
680680
int status, i;
681681
uint32_t count;
682682
__be32 *p;
@@ -689,13 +689,13 @@ bl_alloc_lseg(struct pnfs_layout_hdr *lo, struct nfs4_layoutget_res *lgr,
689689
return ERR_PTR(-ENOMEM);
690690

691691
status = -ENOMEM;
692-
scratch = alloc_page(gfp_mask);
692+
scratch = folio_alloc(gfp_mask, 0);
693693
if (!scratch)
694694
goto out;
695695

696696
xdr_init_decode_pages(&xdr, &buf,
697697
lgr->layoutp->pages, lgr->layoutp->len);
698-
xdr_set_scratch_page(&xdr, scratch);
698+
xdr_set_scratch_folio(&xdr, scratch);
699699

700700
status = -EIO;
701701
p = xdr_inline_decode(&xdr, 4);
@@ -744,7 +744,7 @@ bl_alloc_lseg(struct pnfs_layout_hdr *lo, struct nfs4_layoutget_res *lgr,
744744
}
745745

746746
out_free_scratch:
747-
__free_page(scratch);
747+
folio_put(scratch);
748748
out:
749749
dprintk("%s returns %d\n", __func__, status);
750750
switch (status) {

fs/nfs/blocklayout/dev.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -541,16 +541,16 @@ bl_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
541541
struct pnfs_block_dev *top;
542542
struct xdr_stream xdr;
543543
struct xdr_buf buf;
544-
struct page *scratch;
544+
struct folio *scratch;
545545
int nr_volumes, ret, i;
546546
__be32 *p;
547547

548-
scratch = alloc_page(gfp_mask);
548+
scratch = folio_alloc(gfp_mask, 0);
549549
if (!scratch)
550550
goto out;
551551

552552
xdr_init_decode_pages(&xdr, &buf, pdev->pages, pdev->pglen);
553-
xdr_set_scratch_page(&xdr, scratch);
553+
xdr_set_scratch_folio(&xdr, scratch);
554554

555555
p = xdr_inline_decode(&xdr, sizeof(__be32));
556556
if (!p)
@@ -582,7 +582,7 @@ bl_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
582582
out_free_volumes:
583583
kfree(volumes);
584584
out_free_scratch:
585-
__free_page(scratch);
585+
folio_put(scratch);
586586
out:
587587
return node;
588588
}

0 commit comments

Comments
 (0)