xdr_shrink_pagelen(9)
β¨ xdr_shrink_pagelen(9) β¨
okay so bestie, we're in the Kernel API Manual today and the star of the show is xdr_shrink_pagelen β it's giving kernel-internals main character energy, and honestly? obsessed π
πΈ NAME πΈ
xdr_shrink_pagelen β shrinks buf->pages to @len bytes π
π¦ SYNOPSIS π¦
unsigned int xdr_shrink_pagelen (struct xdr_buf *buf , unsigned int len
);
π ARGUMENTS π
bufβ anxdr_buf, that's the vibe π«Άlenβ the new page buffer length, like the new size bestie, that's the whole point β¨
π₯ DESCRIPTION π₯
The way this function just... trims buf->pages down to len bytes, no cap. π
And listen β the extra data does not just get yeeted into the void π it's not lost at all, bestie. Instead it gets moved into buf->tail. Iconic relocation behaviour honestly.
It returns the actual number of bytes moved. So like, that's your receipt. π
π SEE ALSO π
Kernel file ./net/sunrpc/xdr.c β and the whole extended friend group, fr fr:
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_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_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 one came out of ./net/sunrpc, dated October 2026, and it's literally dedicated to you and your page-shrinking journey πβ¨ slay π
π¦ 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