xdr_init_encode(9)
π« 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 thexdr_streamstruct. 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 controllingrpc_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 π
xdr_encode_opaque_fixed(9)xdr_encode_opaque(9)xdr_terminate_string(9)xdr_buf_to_bvec(9)xdr_buf_to_sg(9)xdr_buf_to_sg_alloc(9)xdr_inline_pages(9)_shift_data_left_pages(9)_shift_data_right_pages(9)_copy_to_pages(9)_copy_from_pages(9)xdr_buf_pages_zero(9)xdr_shrink_bufhead(9)xdr_shrink_pagelen(9)xdr_stream_pos(9)xdr_page_pos(9)xdr_init_encode_pages(9)__xdr_commit_encode(9)xdr_reserve_space(9)xdr_reserve_space_vec(9)xdr_truncate_encode(9)xdr_truncate_decode(9)xdr_restrict_buflen(9)xdr_write_pages(9)xdr_init_decode(9)xdr_init_decode_pages(9)xdr_finish_decode(9)xdr_inline_decode(9)xdr_read_pages(9)xdr_set_pagelen(9)xdr_enter_page(9)xdr_buf_subsegment(9)xdr_stream_subsegment(9)xdr_stream_move_subsegment(9)xdr_stream_zero(9)xdr_buf_trim(9)xdr_stream_decode_string_dup(9)xdr_stream_decode_opaque_auth(9)xdr_stream_encode_opaque_auth(9)
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
- 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