]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
NFS: Update the filelayout to use xdr_set_scratch_folio()
authorAnna Schumaker <anna.schumaker@oracle.com>
Mon, 30 Jun 2025 17:19:26 +0000 (13:19 -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/filelayout/filelayout.c
fs/nfs/filelayout/filelayoutdev.c

index d39a1f58e18d9dc71eb36333deec6a5d6bcc9af6..5c4551117c58c0783d7d58f0155bfd370cf825a1 100644 (file)
@@ -646,19 +646,19 @@ filelayout_decode_layout(struct pnfs_layout_hdr *flo,
 {
        struct xdr_stream stream;
        struct xdr_buf buf;
-       struct page *scratch;
+       struct folio *scratch;
        __be32 *p;
        uint32_t nfl_util;
        int i;
 
        dprintk("%s: set_layout_map Begin\n", __func__);
 
-       scratch = alloc_page(gfp_flags);
+       scratch = folio_alloc(gfp_flags, 0);
        if (!scratch)
                return -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);
 
        /* 20 = ufl_util (4), first_stripe_index (4), pattern_offset (8),
         * num_fh (4) */
@@ -724,11 +724,11 @@ filelayout_decode_layout(struct pnfs_layout_hdr *flo,
                        fl->fh_array[i]->size);
        }
 
-       __free_page(scratch);
+       folio_put(scratch);
        return 0;
 
 out_err:
-       __free_page(scratch);
+       folio_put(scratch);
        return -EIO;
 }
 
index 29d9234d5c085f3feda9abf6a98cd5e272f22613..df79aeb68db4286d42f5e3db8e825fc508e8740b 100644 (file)
@@ -73,18 +73,18 @@ nfs4_fl_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
        struct nfs4_file_layout_dsaddr *dsaddr = NULL;
        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 net *net = server->nfs_client->cl_net;
 
        /* set up xdr stream */
-       scratch = alloc_page(gfp_flags);
+       scratch = folio_alloc(gfp_flags, 0);
        if (!scratch)
                goto out_err;
 
        xdr_init_decode_pages(&stream, &buf, pdev->pages, pdev->pglen);
-       xdr_set_scratch_page(&stream, scratch);
+       xdr_set_scratch_folio(&stream, scratch);
 
        /* Get the stripe count (number of stripe index) */
        p = xdr_inline_decode(&stream, 4);
@@ -186,7 +186,7 @@ nfs4_fl_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
                }
        }
 
-       __free_page(scratch);
+       folio_put(scratch);
        return dsaddr;
 
 out_err_drain_dsaddrs:
@@ -204,7 +204,7 @@ out_err_free_deviceid:
 out_err_free_stripe_indices:
        kfree(stripe_indices);
 out_err_free_scratch:
-       __free_page(scratch);
+       folio_put(scratch);
 out_err:
        dprintk("%s ERROR: returning NULL\n", __func__);
        return NULL;