xdr_buf_trim(9)
okay so bestie, youโre looking at xdr_buf_trim(9) from the Kernel API Manual ๐ซถ This is the little XDR helper that lops bytes off the end of a buffer, and yes itโs giving โshort kingโ energy but make it kernel API ๐
โจ
๐ NAME ๐
xdr_buf_trim โ โlop at most "len" bytes off the end of "buf"โ. Thatโs the entire name-card, no cap. ๐
โจ SYNOPSIS โจ
Hereโs the exact signature, character for character, because we respect the code:
void xdr_buf_trim (struct xdr_buf *buf , unsigned int len );
๐ ARGUMENTS ๐
bufโ thestruct xdr_buf *that is literally โbuf to be trimmedโ. We trim this one, bestie. ๐lenโ the number of bytes to reduce"buf"by. Thatโs the amount weโre trying to lop off. ๐ธ
๐ธ DESCRIPTION ๐ธ
Trim an xdr_buf by the given number of bytes by fixing up the lengths. Thatโs the move. Lengths get fixed up, and thatโs the trim.
Note that itโs possible that weโll trim less than that amount if the xdr_buf is too small, or if (for instance) itโs all in the head and the parser has already read too far into it. So if the trim comes up short, donโt come for the function โ thatโs the documented situation, iykyk ๐ญ๐
๐ฆ SEE ALSO ๐ฆ
Kernel file ./net/sunrpc/xdr.c is on the guest list, plus these manual-page 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(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_stream_decode_string_dup(9)xdr_stream_decode_opaque_auth(9)xdr_stream_encode_opaque_auth(9)
source/version: ./net/sunrpc ยท date: October 2026 ยท page: xdr_buf_trim(9) โ mwah, go trim those buffers and have the best day, bestie ๐๐๐ฆ
๐ฆ 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