xdr_inline_decode(9)
π xdr_inline_decode β bestie, it's a section 9 kernel page
okay so first things first: this is xdr_inline_decode, and she lives in section 9 of the kernel API manual π«Ά (that's the kernel-internals girlies, not your regular command-line girlies). buckle up, we're decoding XDR together and honestly? it's kinda iconic.
β¨ NAME β¨
xdr_inline_decode β grab the XDR data so you can decode it. that's the whole vibe. retrieve, then decode. periodt. π
πΈ SYNOPSIS πΈ
__be32 * xdr_inline_decode (struct xdr_stream *xdr , size_t nbytes );
like, she returns a __be32 * β that's the pointer to where the data's at β and you hand her an xdr_stream struct pointer plus a byte count. no cap, that's it. π
β ARGUMENTS β
xdrβ pointer to thexdr_streamstruct. literally the stream we're working with, she's the main character here πnbytesβ number of bytes of data to decode. how many bytes we're trying to read, bestie. just count 'em π
π DESCRIPTION π
okay so here's the tea β: this function does a vibe check on the input buffer first β it checks whether the buffer is long enough to let us actually decode. that's the whole gatekeeping moment, and honestly she's right to do it π
if the buffer passes the vibe check? she returns the current pointer, and then she updates the current pointer position to reflect that we've moved along. so like, pointer go brrr and now it's somewhere new. that's the entire flow, no notes β¨π₯
ngl, the important part is the order: check length β return current pointer β update current pointer position. don't get it twisted π
π¦ SEE ALSO π¦
Kernel file: ./net/sunrpc/xdr.c
and now the friend group, because XDR in the kernel has, like, a lot of cousins and we're not leaving a single one out π«Ά β all of these are section 9 pages too, iykyk:
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(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_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 page, bestie πβ¨ this lil drop comes to you from ./net/sunrpc, dated October 2026 β screenshot it, cite it, frame it, do whatever π mwah, go decode something iconic ππ
π¦ 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