Skip to content

Commit 1a33b62

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

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

fs/nfs/filelayout/filelayout.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -646,19 +646,19 @@ filelayout_decode_layout(struct pnfs_layout_hdr *flo,
646646
{
647647
struct xdr_stream stream;
648648
struct xdr_buf buf;
649-
struct page *scratch;
649+
struct folio *scratch;
650650
__be32 *p;
651651
uint32_t nfl_util;
652652
int i;
653653

654654
dprintk("%s: set_layout_map Begin\n", __func__);
655655

656-
scratch = alloc_page(gfp_flags);
656+
scratch = folio_alloc(gfp_flags, 0);
657657
if (!scratch)
658658
return -ENOMEM;
659659

660660
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);
662662

663663
/* 20 = ufl_util (4), first_stripe_index (4), pattern_offset (8),
664664
* num_fh (4) */
@@ -724,11 +724,11 @@ filelayout_decode_layout(struct pnfs_layout_hdr *flo,
724724
fl->fh_array[i]->size);
725725
}
726726

727-
__free_page(scratch);
727+
folio_put(scratch);
728728
return 0;
729729

730730
out_err:
731-
__free_page(scratch);
731+
folio_put(scratch);
732732
return -EIO;
733733
}
734734

fs/nfs/filelayout/filelayoutdev.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,18 @@ nfs4_fl_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
7373
struct nfs4_file_layout_dsaddr *dsaddr = NULL;
7474
struct xdr_stream stream;
7575
struct xdr_buf buf;
76-
struct page *scratch;
76+
struct folio *scratch;
7777
struct list_head dsaddrs;
7878
struct nfs4_pnfs_ds_addr *da;
7979
struct net *net = server->nfs_client->cl_net;
8080

8181
/* set up xdr stream */
82-
scratch = alloc_page(gfp_flags);
82+
scratch = folio_alloc(gfp_flags, 0);
8383
if (!scratch)
8484
goto out_err;
8585

8686
xdr_init_decode_pages(&stream, &buf, pdev->pages, pdev->pglen);
87-
xdr_set_scratch_page(&stream, scratch);
87+
xdr_set_scratch_folio(&stream, scratch);
8888

8989
/* Get the stripe count (number of stripe index) */
9090
p = xdr_inline_decode(&stream, 4);
@@ -186,7 +186,7 @@ nfs4_fl_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
186186
}
187187
}
188188

189-
__free_page(scratch);
189+
folio_put(scratch);
190190
return dsaddr;
191191

192192
out_err_drain_dsaddrs:
@@ -204,7 +204,7 @@ nfs4_fl_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
204204
out_err_free_stripe_indices:
205205
kfree(stripe_indices);
206206
out_err_free_scratch:
207-
__free_page(scratch);
207+
folio_put(scratch);
208208
out_err:
209209
dprintk("%s ERROR: returning NULL\n", __func__);
210210
return NULL;

0 commit comments

Comments
 (0)