]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
NFS: Update the flexfilelayout driver to use xdr_set_scratch_folio()
authorAnna Schumaker <anna.schumaker@oracle.com>
Mon, 30 Jun 2025 17:42:51 +0000 (13:42 -0400)
committerAnna Schumaker <anna.schumaker@oracle.com>
Tue, 23 Sep 2025 17:29:50 +0000 (13:29 -0400)
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
fs/nfs/flexfilelayout/flexfilelayout.c
fs/nfs/flexfilelayout/flexfilelayoutdev.c

index 9edb5f9b0c4e4796686f9c2699971434c1e5bd6d..15658a0316bf7900bdbb8b09c9089755284e4dfe 100644 (file)
@@ -388,20 +388,20 @@ ff_layout_alloc_lseg(struct pnfs_layout_hdr *lh,
        struct nfs4_ff_layout_segment *fls = NULL;
        struct xdr_stream stream;
        struct xdr_buf buf;
-       struct page *scratch;
+       struct folio *scratch;
        u64 stripe_unit;
        u32 mirror_array_cnt;
        __be32 *p;
        int i, rc;
 
        dprintk("--> %s\n", __func__);
-       scratch = alloc_page(gfp_flags);
+       scratch = folio_alloc(gfp_flags, 0);
        if (!scratch)
                return ERR_PTR(-ENOMEM);
 
        xdr_init_decode_pages(&stream, &buf, lgr->layoutp->pages,
                              lgr->layoutp->len);
-       xdr_set_scratch_page(&stream, scratch);
+       xdr_set_scratch_folio(&stream, scratch);
 
        /* stripe unit and mirror_array_cnt */
        rc = -EIO;
@@ -564,7 +564,7 @@ out_sort_mirrors:
        ret = &fls->generic_hdr;
        dprintk("<-- %s (success)\n", __func__);
 out_free_page:
-       __free_page(scratch);
+       folio_put(scratch);
        return ret;
 out_err_free:
        _ff_layout_free_lseg(fls);
index 30365ec782bb1b42823ce462179cd2d3bdcdc796..ae4e2eec633069301da6b539d75d0ab222c983a1 100644 (file)
@@ -44,7 +44,7 @@ nfs4_ff_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
 {
        struct xdr_stream stream;
        struct xdr_buf buf;
-       struct page *scratch;
+       struct folio *scratch;
        struct list_head dsaddrs;
        struct nfs4_pnfs_ds_addr *da;
        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,
        int i, ret = -ENOMEM;
 
        /* set up xdr stream */
-       scratch = alloc_page(gfp_flags);
+       scratch = folio_alloc(gfp_flags, 0);
        if (!scratch)
                goto out_err;
 
@@ -70,7 +70,7 @@ nfs4_ff_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
        INIT_LIST_HEAD(&dsaddrs);
 
        xdr_init_decode_pages(&stream, &buf, pdev->pages, pdev->pglen);
-       xdr_set_scratch_page(&stream, scratch);
+       xdr_set_scratch_folio(&stream, scratch);
 
        /* multipath count */
        p = xdr_inline_decode(&stream, 4);
@@ -163,7 +163,7 @@ nfs4_ff_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
                kfree(da);
        }
 
-       __free_page(scratch);
+       folio_put(scratch);
        return new_ds;
 
 out_err_drain_dsaddrs:
@@ -177,7 +177,7 @@ out_err_drain_dsaddrs:
 
        kfree(ds_versions);
 out_scratch:
-       __free_page(scratch);
+       folio_put(scratch);
 out_err:
        kfree(new_ds);