]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
SUNRPC: Introduce xdr_set_scratch_folio()
authorAnna Schumaker <anna.schumaker@oracle.com>
Mon, 30 Jun 2025 14:04:54 +0000 (10:04 -0400)
committerAnna Schumaker <anna.schumaker@oracle.com>
Tue, 23 Sep 2025 17:29:50 +0000 (13:29 -0400)
This will replace xdr_set_scratch_page() when we switch pages to folios.

Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
include/linux/sunrpc/xdr.h

index 8a9ec617cf666b947cb8377a3e60e05d1c4b395e..3ce17321689a247d60dcfb80e482c3a43a7c70f2 100644 (file)
@@ -300,6 +300,19 @@ xdr_set_scratch_page(struct xdr_stream *xdr, struct page *page)
        xdr_set_scratch_buffer(xdr, page_address(page), PAGE_SIZE);
 }
 
+/**
+ * xdr_set_scratch_folio - Attach a scratch buffer for decoding data
+ * @xdr: pointer to xdr_stream struct
+ * @page: an anonymous folio
+ *
+ * See xdr_set_scratch_buffer().
+ */
+static inline void
+xdr_set_scratch_folio(struct xdr_stream *xdr, struct folio *folio)
+{
+       xdr_set_scratch_buffer(xdr, folio_address(folio), folio_size(folio));
+}
+
 /**
  * xdr_reset_scratch_buffer - Clear scratch buffer information
  * @xdr: pointer to xdr_stream struct