xdr_set_pagelen(9)
π xdr_set_pagelen(9) β the Kernel API Manual glow-up π
okay so bestie, you're in the Kernel API Manual section and the function we're stanning today is xdr_set_pagelen(9) β yes that's her name, she sets the length of the XDR pages, and honestly? iconic behavior. let's get into it π
β¨ NAME β¨
xdr_set_pagelen β sets the length of the XDR pages πΈ
β¨ SYNOPSIS β¨
void xdr_set_pagelen (struct xdr_stream *xdr , unsigned int len );
that's the whole vibe. no cap, that's it. π«Ά
β¨ ARGUMENTS β¨
xdrβ pointer to thexdr_streamstruct π§ like, the stream we're messing with, bestielenβ the new length of the XDR page data π the actual number of bytes we wantpagelento be
β¨ DESCRIPTION β¨
so the whole gig is this: xdr_set_pagelen either grows or shrinks the length of the xdr pages by setting pagelen to len bytes. both directions are valid, it's giving versatile π
here's the deets, and don't skip them:
- when shrinking, any extra data is moved into
buf->tailπ¦ - when growing, any data beyond the current pointer is moved into the tail π
and the return situation? the page says it returns True if the operation was successful, and False otherwise. periodt. (yes the synopsis says void and the description talks about returns β not me noticing, not me saying anything, we're just reporting the facts as written π the docs said what they said, iykyk π)
lowkey important: this is a kernel API page, so treat thoseTrue/Falsewords as the official text. don't @ me, @ the source π
β¨ SEE ALSO β¨
the source file lives at kernel file ./net/sunrpc/xdr.c, and the whole friend group is here β literally the entire group chat, no one left out:
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_inline_decode(9)xdr_read_pages(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 π go forth and set those page lengths responsibly. this came to you from ./net/sunrpc, October 2026 β mwah, signing off π«Άβ¨π
π¦ 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