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

NFS: Update the flexfilelayout driver to use xdr_set_scratch_folio()

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

+9 -9
+4 -4
fs/nfs/flexfilelayout/flexfilelayout.c
··· 388 388 struct nfs4_ff_layout_segment *fls = NULL; 389 389 struct xdr_stream stream; 390 390 struct xdr_buf buf; 391 - struct page *scratch; 391 + struct folio *scratch; 392 392 u64 stripe_unit; 393 393 u32 mirror_array_cnt; 394 394 __be32 *p; 395 395 int i, rc; 396 396 397 397 dprintk("--> %s\n", __func__); 398 - scratch = alloc_page(gfp_flags); 398 + scratch = folio_alloc(gfp_flags, 0); 399 399 if (!scratch) 400 400 return ERR_PTR(-ENOMEM); 401 401 402 402 xdr_init_decode_pages(&stream, &buf, lgr->layoutp->pages, 403 403 lgr->layoutp->len); 404 - xdr_set_scratch_page(&stream, scratch); 404 + xdr_set_scratch_folio(&stream, scratch); 405 405 406 406 /* stripe unit and mirror_array_cnt */ 407 407 rc = -EIO; ··· 564 564 ret = &fls->generic_hdr; 565 565 dprintk("<-- %s (success)\n", __func__); 566 566 out_free_page: 567 - __free_page(scratch); 567 + folio_put(scratch); 568 568 return ret; 569 569 out_err_free: 570 570 _ff_layout_free_lseg(fls);
+5 -5
fs/nfs/flexfilelayout/flexfilelayoutdev.c
··· 44 44 { 45 45 struct xdr_stream stream; 46 46 struct xdr_buf buf; 47 - struct page *scratch; 47 + struct folio *scratch; 48 48 struct list_head dsaddrs; 49 49 struct nfs4_pnfs_ds_addr *da; 50 50 struct nfs4_ff_layout_ds *new_ds = NULL; ··· 56 56 int i, ret = -ENOMEM; 57 57 58 58 /* set up xdr stream */ 59 - scratch = alloc_page(gfp_flags); 59 + scratch = folio_alloc(gfp_flags, 0); 60 60 if (!scratch) 61 61 goto out_err; 62 62 ··· 70 70 INIT_LIST_HEAD(&dsaddrs); 71 71 72 72 xdr_init_decode_pages(&stream, &buf, pdev->pages, pdev->pglen); 73 - xdr_set_scratch_page(&stream, scratch); 73 + xdr_set_scratch_folio(&stream, scratch); 74 74 75 75 /* multipath count */ 76 76 p = xdr_inline_decode(&stream, 4); ··· 163 163 kfree(da); 164 164 } 165 165 166 - __free_page(scratch); 166 + folio_put(scratch); 167 167 return new_ds; 168 168 169 169 out_err_drain_dsaddrs: ··· 177 177 178 178 kfree(ds_versions); 179 179 out_scratch: 180 - __free_page(scratch); 180 + folio_put(scratch); 181 181 out_err: 182 182 kfree(new_ds); 183 183