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

Configure Feed

Select the types of activity you want to include in your feed.

NFS: Update the filelayout to use xdr_set_scratch_folio()

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

+10 -10
+5 -5
fs/nfs/filelayout/filelayout.c
··· 646 646 { 647 647 struct xdr_stream stream; 648 648 struct xdr_buf buf; 649 - struct page *scratch; 649 + struct folio *scratch; 650 650 __be32 *p; 651 651 uint32_t nfl_util; 652 652 int i; 653 653 654 654 dprintk("%s: set_layout_map Begin\n", __func__); 655 655 656 - scratch = alloc_page(gfp_flags); 656 + scratch = folio_alloc(gfp_flags, 0); 657 657 if (!scratch) 658 658 return -ENOMEM; 659 659 660 660 xdr_init_decode_pages(&stream, &buf, lgr->layoutp->pages, lgr->layoutp->len); 661 - xdr_set_scratch_page(&stream, scratch); 661 + xdr_set_scratch_folio(&stream, scratch); 662 662 663 663 /* 20 = ufl_util (4), first_stripe_index (4), pattern_offset (8), 664 664 * num_fh (4) */ ··· 724 724 fl->fh_array[i]->size); 725 725 } 726 726 727 - __free_page(scratch); 727 + folio_put(scratch); 728 728 return 0; 729 729 730 730 out_err: 731 - __free_page(scratch); 731 + folio_put(scratch); 732 732 return -EIO; 733 733 } 734 734
+5 -5
fs/nfs/filelayout/filelayoutdev.c
··· 73 73 struct nfs4_file_layout_dsaddr *dsaddr = NULL; 74 74 struct xdr_stream stream; 75 75 struct xdr_buf buf; 76 - struct page *scratch; 76 + struct folio *scratch; 77 77 struct list_head dsaddrs; 78 78 struct nfs4_pnfs_ds_addr *da; 79 79 struct net *net = server->nfs_client->cl_net; 80 80 81 81 /* set up xdr stream */ 82 - scratch = alloc_page(gfp_flags); 82 + scratch = folio_alloc(gfp_flags, 0); 83 83 if (!scratch) 84 84 goto out_err; 85 85 86 86 xdr_init_decode_pages(&stream, &buf, pdev->pages, pdev->pglen); 87 - xdr_set_scratch_page(&stream, scratch); 87 + xdr_set_scratch_folio(&stream, scratch); 88 88 89 89 /* Get the stripe count (number of stripe index) */ 90 90 p = xdr_inline_decode(&stream, 4); ··· 186 186 } 187 187 } 188 188 189 - __free_page(scratch); 189 + folio_put(scratch); 190 190 return dsaddr; 191 191 192 192 out_err_drain_dsaddrs: ··· 204 204 out_err_free_stripe_indices: 205 205 kfree(stripe_indices); 206 206 out_err_free_scratch: 207 - __free_page(scratch); 207 + folio_put(scratch); 208 208 out_err: 209 209 dprintk("%s ERROR: returning NULL\n", __func__); 210 210 return NULL;