Skip to content

Commit c8a1275

Browse files
author
Anna Schumaker
committed
SUNRPC: Introduce xdr_set_scratch_folio()
This will replace xdr_set_scratch_page() when we switch pages to folios. Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
1 parent 040058a commit c8a1275

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

  • include/linux/sunrpc

include/linux/sunrpc/xdr.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,19 @@ xdr_set_scratch_page(struct xdr_stream *xdr, struct page *page)
300300
xdr_set_scratch_buffer(xdr, page_address(page), PAGE_SIZE);
301301
}
302302

303+
/**
304+
* xdr_set_scratch_folio - Attach a scratch buffer for decoding data
305+
* @xdr: pointer to xdr_stream struct
306+
* @page: an anonymous folio
307+
*
308+
* See xdr_set_scratch_buffer().
309+
*/
310+
static inline void
311+
xdr_set_scratch_folio(struct xdr_stream *xdr, struct folio *folio)
312+
{
313+
xdr_set_scratch_buffer(xdr, folio_address(folio), folio_size(folio));
314+
}
315+
303316
/**
304317
* xdr_reset_scratch_buffer - Clear scratch buffer information
305318
* @xdr: pointer to xdr_stream struct

0 commit comments

Comments
 (0)