Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFS: Update the blocklayout to use xdr_set_scratch_folio()

Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>

+8 -8
+4 -4
fs/nfs/blocklayout/blocklayout.c
··· 676 676 struct pnfs_layout_segment *lseg; 677 677 struct xdr_buf buf; 678 678 struct xdr_stream xdr; 679 - struct page *scratch; 679 + struct folio *scratch; 680 680 int status, i; 681 681 uint32_t count; 682 682 __be32 *p; ··· 689 689 return ERR_PTR(-ENOMEM); 690 690 691 691 status = -ENOMEM; 692 - scratch = alloc_page(gfp_mask); 692 + scratch = folio_alloc(gfp_mask, 0); 693 693 if (!scratch) 694 694 goto out; 695 695 696 696 xdr_init_decode_pages(&xdr, &buf, 697 697 lgr->layoutp->pages, lgr->layoutp->len); 698 - xdr_set_scratch_page(&xdr, scratch); 698 + xdr_set_scratch_folio(&xdr, scratch); 699 699 700 700 status = -EIO; 701 701 p = xdr_inline_decode(&xdr, 4); ··· 744 744 } 745 745 746 746 out_free_scratch: 747 - __free_page(scratch); 747 + folio_put(scratch); 748 748 out: 749 749 dprintk("%s returns %d\n", __func__, status); 750 750 switch (status) {
+4 -4
fs/nfs/blocklayout/dev.c
··· 541 541 struct pnfs_block_dev *top; 542 542 struct xdr_stream xdr; 543 543 struct xdr_buf buf; 544 - struct page *scratch; 544 + struct folio *scratch; 545 545 int nr_volumes, ret, i; 546 546 __be32 *p; 547 547 548 - scratch = alloc_page(gfp_mask); 548 + scratch = folio_alloc(gfp_mask, 0); 549 549 if (!scratch) 550 550 goto out; 551 551 552 552 xdr_init_decode_pages(&xdr, &buf, pdev->pages, pdev->pglen); 553 - xdr_set_scratch_page(&xdr, scratch); 553 + xdr_set_scratch_folio(&xdr, scratch); 554 554 555 555 p = xdr_inline_decode(&xdr, sizeof(__be32)); 556 556 if (!p) ··· 582 582 out_free_volumes: 583 583 kfree(volumes); 584 584 out_free_scratch: 585 - __free_page(scratch); 585 + folio_put(scratch); 586 586 out: 587 587 return node; 588 588 }