]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
NFS: Update the blocklayout to use xdr_set_scratch_folio()
authorAnna Schumaker <anna.schumaker@oracle.com>
Mon, 30 Jun 2025 16:56:33 +0000 (12:56 -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/blocklayout/blocklayout.c
fs/nfs/blocklayout/dev.c

index 5d6edafbed202ae730443d7e3f95721a40bf0eda..0e4c67373e4f995bcdb73326409bbeb42f5f9fa3 100644 (file)
@@ -676,7 +676,7 @@ bl_alloc_lseg(struct pnfs_layout_hdr *lo, struct nfs4_layoutget_res *lgr,
        struct pnfs_layout_segment *lseg;
        struct xdr_buf buf;
        struct xdr_stream xdr;
-       struct page *scratch;
+       struct folio *scratch;
        int status, i;
        uint32_t count;
        __be32 *p;
@@ -689,13 +689,13 @@ bl_alloc_lseg(struct pnfs_layout_hdr *lo, struct nfs4_layoutget_res *lgr,
                return ERR_PTR(-ENOMEM);
 
        status = -ENOMEM;
-       scratch = alloc_page(gfp_mask);
+       scratch = folio_alloc(gfp_mask, 0);
        if (!scratch)
                goto out;
 
        xdr_init_decode_pages(&xdr, &buf,
                        lgr->layoutp->pages, lgr->layoutp->len);
-       xdr_set_scratch_page(&xdr, scratch);
+       xdr_set_scratch_folio(&xdr, scratch);
 
        status = -EIO;
        p = xdr_inline_decode(&xdr, 4);
@@ -744,7 +744,7 @@ process_extents:
        }
 
 out_free_scratch:
-       __free_page(scratch);
+       folio_put(scratch);
 out:
        dprintk("%s returns %d\n", __func__, status);
        switch (status) {
index 44306ac22353bed51d521cb0b5308cf12b5c3bd5..ab76120705e206c2b079bcbb9678e9f0e3511cb1 100644 (file)
@@ -541,16 +541,16 @@ bl_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
        struct pnfs_block_dev *top;
        struct xdr_stream xdr;
        struct xdr_buf buf;
-       struct page *scratch;
+       struct folio *scratch;
        int nr_volumes, ret, i;
        __be32 *p;
 
-       scratch = alloc_page(gfp_mask);
+       scratch = folio_alloc(gfp_mask, 0);
        if (!scratch)
                goto out;
 
        xdr_init_decode_pages(&xdr, &buf, pdev->pages, pdev->pglen);
-       xdr_set_scratch_page(&xdr, scratch);
+       xdr_set_scratch_folio(&xdr, scratch);
 
        p = xdr_inline_decode(&xdr, sizeof(__be32));
        if (!p)
@@ -582,7 +582,7 @@ bl_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
 out_free_volumes:
        kfree(volumes);
 out_free_scratch:
-       __free_page(scratch);
+       folio_put(scratch);
 out:
        return node;
 }