Skip to content

Commit 4b7c3b4

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

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

fs/nfs/flexfilelayout/flexfilelayout.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,20 +388,20 @@ ff_layout_alloc_lseg(struct pnfs_layout_hdr *lh,
388388
struct nfs4_ff_layout_segment *fls = NULL;
389389
struct xdr_stream stream;
390390
struct xdr_buf buf;
391-
struct page *scratch;
391+
struct folio *scratch;
392392
u64 stripe_unit;
393393
u32 mirror_array_cnt;
394394
__be32 *p;
395395
int i, rc;
396396

397397
dprintk("--> %s\n", __func__);
398-
scratch = alloc_page(gfp_flags);
398+
scratch = folio_alloc(gfp_flags, 0);
399399
if (!scratch)
400400
return ERR_PTR(-ENOMEM);
401401

402402
xdr_init_decode_pages(&stream, &buf, lgr->layoutp->pages,
403403
lgr->layoutp->len);
404-
xdr_set_scratch_page(&stream, scratch);
404+
xdr_set_scratch_folio(&stream, scratch);
405405

406406
/* stripe unit and mirror_array_cnt */
407407
rc = -EIO;
@@ -564,7 +564,7 @@ ff_layout_alloc_lseg(struct pnfs_layout_hdr *lh,
564564
ret = &fls->generic_hdr;
565565
dprintk("<-- %s (success)\n", __func__);
566566
out_free_page:
567-
__free_page(scratch);
567+
folio_put(scratch);
568568
return ret;
569569
out_err_free:
570570
_ff_layout_free_lseg(fls);

fs/nfs/flexfilelayout/flexfilelayoutdev.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ nfs4_ff_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
4444
{
4545
struct xdr_stream stream;
4646
struct xdr_buf buf;
47-
struct page *scratch;
47+
struct folio *scratch;
4848
struct list_head dsaddrs;
4949
struct nfs4_pnfs_ds_addr *da;
5050
struct nfs4_ff_layout_ds *new_ds = NULL;
@@ -56,7 +56,7 @@ nfs4_ff_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
5656
int i, ret = -ENOMEM;
5757

5858
/* set up xdr stream */
59-
scratch = alloc_page(gfp_flags);
59+
scratch = folio_alloc(gfp_flags, 0);
6060
if (!scratch)
6161
goto out_err;
6262

@@ -70,7 +70,7 @@ nfs4_ff_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
7070
INIT_LIST_HEAD(&dsaddrs);
7171

7272
xdr_init_decode_pages(&stream, &buf, pdev->pages, pdev->pglen);
73-
xdr_set_scratch_page(&stream, scratch);
73+
xdr_set_scratch_folio(&stream, scratch);
7474

7575
/* multipath count */
7676
p = xdr_inline_decode(&stream, 4);
@@ -163,7 +163,7 @@ nfs4_ff_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
163163
kfree(da);
164164
}
165165

166-
__free_page(scratch);
166+
folio_put(scratch);
167167
return new_ds;
168168

169169
out_err_drain_dsaddrs:
@@ -177,7 +177,7 @@ nfs4_ff_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
177177

178178
kfree(ds_versions);
179179
out_scratch:
180-
__free_page(scratch);
180+
folio_put(scratch);
181181
out_err:
182182
kfree(new_ds);
183183

0 commit comments

Comments
 (0)