xdr_init_encode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« xdr_init_encode β€” kernel API manual, bestie edition πŸ’«

okay so real talk, this one is from the Kernel API Manual, and yes the title is literally xdr_init_encode(9). Let's get into it 🫢


✨ NAME ✨

xdr_init_encode β€” initialize a struct xdr_stream so it's ready to send data. it's giving setup era, main character energy πŸ’…


🌸 SYNOPSIS 🌸

void xdr_init_encode (struct xdr_stream *xdr , struct xdr_buf *buf ,
       __be32 *p , struct rpc_rqst *rqst );

πŸŽ€ ARGUMENTS πŸŽ€

  • xdr β€” pointer to the xdr_stream struct. this is the little guy we're initializing πŸ’–
  • buf β€” pointer to the XDR buffer where the data is actually gonna get encoded into 🌸
  • p β€” the current pointer inside that XDR buffer. like, we're here rn bestie πŸ“
  • rqst β€” pointer to the controlling rpc_rqst, and it's there strictly for debugging. that's its whole job, no cap πŸ”

πŸ¦‹ NOTE πŸ¦‹

so at the moment, the RPC client only passes the length of our scratch buffer in the xdr_buf's header kvec. previously that meant we had to call xdr_adjust_iovec after encoding the data β€” annoying, honestly 😭

but with the new scheme? the xdr_stream manages all the details of the buffer length and takes care of adjusting the kvec length for us. it literally ate and left no crumbs πŸ‘‘


🌈 SEE ALSO 🌈

kernel file ./net/sunrpc/xdr.c β€” and all of these besties πŸ‘‡


and that's the whole page, bestie!! 🧚 this iconic little entry lives in the source ./net/sunrpc, dated October 2026 β€” see you in the next manpage, mwah πŸ’œπŸŽ€

πŸ“¦ where this page comes from