svc_rdma_encode_write_chunk(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– svc_rdma_encode_write_chunk β€” the Kernel API Manual page, bestie edition πŸ’–

okay so this is a page from the Kernel API Manual, and it's about a function called svc_rdma_encode_write_chunk. it's short, it's sweet, and it's giving "small function, big job" energy. let's get into it 🫢


✨ NAME ✨

svc_rdma_encode_write_chunk β€” Encode one Write chunk

like, literally just one. singular. one chunk. πŸ’…


🌸 SYNOPSIS 🌸

ssize_t svc_rdma_encode_write_chunk (struct svc_rdma_send_ctxt *sctxt ,
const struct svc_rdma_chunk *chunk );

that's the whole signature, no cap. it returns an ssize_t, so yes, it's gonna hand you back a signed size β€” keep that in mind for the return values later πŸ‘€


πŸŽ€ ARGUMENTS πŸŽ€

  • sctxt β€” Send context for the RPC Reply. this is the send context, bestie. it's the Reply's whole little setup. πŸ¦‹
  • chunk β€” Write chunk to push. the actual Write chunk you're pushing out. that's it, that's the argument. 🌈

πŸ’œ DESCRIPTION πŸ’œ

so here's the vibe: this function copies a Write chunk from the Call transport header over to the Reply transport header. that's the main character move. πŸ”₯

and it doesn't just copy β€” it also updates each segment's length field to reflect the number of bytes written in that segment. every single segment gets its length field refreshed. it's giving detail-oriented icon behavior. ✨

Return values:

  • On success, returns length in bytes of the Reply XDR buffer that was consumed by the Write chunk.
  • -EMSGSIZE on XDR buffer overflow. 😭 (that's the sad one, the buffer said "no more room")
ngl, that -EMSGSIZE is the one you're gonna be checking for. if the XDR buffer overflows, that's your error code right there. not me being dramatic, it's just in the manpage. πŸ’€

🌟 SEE ALSO 🌟

Kernel file ./net/sunrpc/xprtrdma/svc_rdma_sendto.c

and the whole friend group 🫢 (fr fr, this is a long list, but every single one is here):


and that's the page!! πŸŽ€ source path ./net/sunrpc/xprtrdma, dated October 2026 β€” mwah, slay, periodt. go read svc_rdma_sendto.c if you wanna see it in the wild, iykyk πŸ’–πŸ‘‘

πŸ“¦ where this page comes from