xdr_write_pages(9)
β¨ xdr_write_pages β the kernel API manual, bestie edition β¨
okay so this is xdr_write_pages(9) from the Kernel API Manual, and it is literally the function that slides a whole pile of pages into your XDR buffer so they can go out on the wire. it's giving "packing my little bag for sending" energy π
πΈ NAME πΈ
xdr_write_pages β Insert a list of pages into an XDR buffer for sending
like, that's the whole vibe. you have pages. you put them in the buffer. you send them. slay. π
β¨ SYNOPSIS β¨
void xdr_write_pages (struct xdr_stream *xdr , struct page **pages ,
unsigned int base , unsigned int len );
no return value, it's a void king, it just does the thing and moves on. main character behavior fr fr π
π¦ ARGUMENTS π¦
xdrβ pointer toxdr_stream. this is your stream bestie, the thing you're writing into.pagesβ array of pages to insert. yes, the actual pages, plural, an array of them, we're being efficient today πbaseβ starting offset of first data byte inpages. like where in the page does the tea actually start βlenβ number of data bytes inpagesto insert. how much of it we're actually taking.
π DESCRIPTION π
so here's what goes down, no cap:
After the pages are added, the tail iovec is instantiated pointing to end of the head buffer β okay so picture it, the tail iovec gets born and it's pointing right at the end of the head buffer, iconic β and the stream is set up to encode subsequent items into the tail. so everything you encode after this just flows straight into the tail like it was always meant to be there. obsessed. π
π₯ SEE ALSO π₯
the whole friend group, assembled. Kernel file ./net/sunrpc/xdr.c and:
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_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)
that's thirty-nine (39) whole functions, a whole group chat. go read them, iykyk π«Ά
aaaaand that's the page!! mwah π this one lives in ./net/sunrpc and it's dated October 2026 β so yeah, mark your calendar bestie, see you then, stay hydrated and keep your XDR buffers tidy ππ§π
π¦ 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