xdr_set_scratch_buffer(9)
β¨ xdr_set_scratch_buffer β¨
okay bestie, welcome to section 9 of the Kernel API Manual β yes we're in kernel-land, yes it's giving big-brain energy, and yes this one's actually short and sweet π
π NAME π
xdr_set_scratch_buffer β attach a scratch buffer for decoding data, no cap π
πΈ SYNOPSIS πΈ
void xdr_set_scratch_buffer (struct xdr_stream *xdr , void *buf , size_t
buflen );
literally that's the whole signature, copy it exactly, don't @ me π«Ά
π¦ ARGUMENTS π¦
xdrβ pointer to thexdr_streamstruct, your main character rn πbufβ pointer to an empty buffer, gotta be empty, it's a scratch buffer okurrr πbuflenβ the size ofbuf, i.e. how much room your buffer actually has β¨
π DESCRIPTION π
so here's the tea β β the scratch buffer gets used when you're decoding from an array of pages π
if an xdr_inline_decode call spans across page boundaries π (the audacity), then we copy the data into the scratch buffer so you get linear access π« iconic behaviour honestly, very slay, very "i made it work" energy.
lowkey the whole point: pages are chopped up, your decode needs it in one piece, so the scratch buffer is the middleman π€
π SEE ALSO π
kernel file ./include/linux/sunrpc/xdr.h and honestly the whole friend group π«Ά:
xdr_set_scratch_folio(9)xdr_reset_scratch_buffer(9)xdr_commit_encode(9)xdr_stream_remaining(9)xdr_align_size(9)xdr_pad_size(9)xdr_stream_encode_item_present(9)xdr_stream_encode_item_absent(9)xdr_encode_bool(9)xdr_stream_encode_bool(9)xdr_stream_encode_u32(9)xdr_stream_encode_be32(9)xdr_stream_encode_u64(9)xdr_stream_encode_opaque_inline(9)xdr_stream_encode_opaque_fixed(9)xdr_stream_encode_opaque(9)xdr_stream_encode_uint32_array(9)xdr_item_is_absent(9)xdr_item_is_present(9)xdr_stream_decode_bool(9)xdr_stream_decode_u32(9)xdr_stream_decode_be32(9)xdr_stream_decode_u64(9)xdr_stream_decode_opaque_fixed(9)xdr_stream_decode_opaque_inline(9)xdr_stream_decode_uint32_array(9)
the way that's a whole roster π go read them, bestie, i believe in you π§
that's the page!! from ./include/linux/sunrpc, dated October 2026, source vibes and all π mwah, go decode something pretty πΈβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms