Skip to content

Commit cc6ac66

Browse files
author
Anna Schumaker
committed
SUNRPC: Update gssx_accept_sec_context() to use xdr_set_scratch_folio()
This was the last caller of xdr_set_scratch_page(), so I remove this function while I'm at it. Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
1 parent d57e43b commit cc6ac66

2 files changed

Lines changed: 4 additions & 17 deletions

File tree

include/linux/sunrpc/xdr.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -287,19 +287,6 @@ xdr_set_scratch_buffer(struct xdr_stream *xdr, void *buf, size_t buflen)
287287
xdr->scratch.iov_len = buflen;
288288
}
289289

290-
/**
291-
* xdr_set_scratch_page - Attach a scratch buffer for decoding data
292-
* @xdr: pointer to xdr_stream struct
293-
* @page: an anonymous page
294-
*
295-
* See xdr_set_scratch_buffer().
296-
*/
297-
static inline void
298-
xdr_set_scratch_page(struct xdr_stream *xdr, struct page *page)
299-
{
300-
xdr_set_scratch_buffer(xdr, page_address(page), PAGE_SIZE);
301-
}
302-
303290
/**
304291
* xdr_set_scratch_folio - Attach a scratch buffer for decoding data
305292
* @xdr: pointer to xdr_stream struct

net/sunrpc/auth_gss/gss_rpc_xdr.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -794,12 +794,12 @@ int gssx_dec_accept_sec_context(struct rpc_rqst *rqstp,
794794
struct gssx_res_accept_sec_context *res = data;
795795
u32 value_follows;
796796
int err;
797-
struct page *scratch;
797+
struct folio *scratch;
798798

799-
scratch = alloc_page(GFP_KERNEL);
799+
scratch = folio_alloc(GFP_KERNEL, 0);
800800
if (!scratch)
801801
return -ENOMEM;
802-
xdr_set_scratch_page(xdr, scratch);
802+
xdr_set_scratch_folio(xdr, scratch);
803803

804804
/* res->status */
805805
err = gssx_dec_status(xdr, &res->status);
@@ -844,6 +844,6 @@ int gssx_dec_accept_sec_context(struct rpc_rqst *rqstp,
844844
err = gssx_dec_option_array(xdr, &res->options);
845845

846846
out_free:
847-
__free_page(scratch);
847+
folio_put(scratch);
848848
return err;
849849
}

0 commit comments

Comments
 (0)