xdr_truncate_encode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

okay bestie, welcome to xdr_truncate_encode(9) from the Kernel API Manual β€” and yes, the manual name is literally right there in the title, slay. πŸ’…

xdr_truncate_encode β€” truncate an encode buffer

✨ SYNOPSIS ✨

void xdr_truncate_encode (struct xdr_stream *xdr , size_t len );

πŸ’… ARGUMENTS πŸ’…

  • xdr β€” pointer to xdr_stream
  • len β€” new length of buffer

πŸ¦‹ DESCRIPTION πŸ¦‹

So what this does is truncate the xdr stream so that xdr->buf->len == len, and xdr->p points at offset len from the start of the buffer, and the head, tail, and page lengths are adjusted to correspond. periodt. ✨

If this means moving xdr->p to a different buffer, we assume that the end pointer should be set to the end of the current page β€” except in the case of the head buffer, where we assume the head buffer's current length represents the end of the available buffer. 🫢

⚠️ This is not safe to use on a buffer that already has inlined page cache pages (as in a zero-copy server read reply), except for the simple case of truncating from one position in the tail to another. πŸ’€

🌈 SEE ALSO 🌈

Kernel file ./net/sunrpc/xdr.c β€” plus the whole friend group:


Bye bestie! πŸ’– This page’s source/version line is ./net/sunrpc, dated October 2026, and it’s the xdr_truncate_encode(9) page. ✨

πŸ“¦ where this page comes from