xdr_set_scratch_buffer(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 the xdr_stream struct, your main character rn πŸ‘‘
  • buf β€” pointer to an empty buffer, gotta be empty, it's a scratch buffer okurrr πŸ™ˆ
  • buflen β€” the size of buf, 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 🫢:

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