splice_from_pipe_feed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… splice_from_pipe_feed(9) β€” like, the Kernel API Manual page, bestie

okay so picture this: it's a page straight out of the Kernel API Manual, and the star of the show is splice_from_pipe_feed(9). she's a little function, she feeds data from a pipe into a file, and honestly? she ate. let's get into it πŸŽ€


✨ NAME ✨

splice_from_pipe_feed β€” literally just feeding the available data from a pipe to a file, no big deal, except it IS a big deal πŸ’–


🌸 SYNOPSIS 🌸

int splice_from_pipe_feed (struct pipe_inode_info *pipe , struct
splice_desc *sd , splice_actor *actor );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • pipe β€” the pipe we're splicing from, bestie. that's the source, the vibe provider 🫢
  • sd β€” the info that gets handed over to actor. the little care package πŸ’Œ
  • actor β€” the handler that actually does the splicing of the data. she's the one doing the work, main character energy πŸ‘‘

πŸ”₯ DESCRIPTION πŸ”₯

okay so here's what she does: this function loops over the pipe and calls actor to do the actual moving of a single struct pipe_buffer to wherever the destination is supposed to be. that's the whole gig. iconic.

she returns when either (a) there's no more buffers left in the pipe, or (b) the requested number of bytes β€” that's sd->total_len, keep up β€” have been copied. periodt. πŸ’…

and what does she return, you ask? get this:

  • a positive number (one) β€” meaning the pipe needs to be filled with more data πŸ“
  • zero β€” meaning the required number of bytes have been copied, we're done here βœ…
  • -errno β€” an error happened, tragic, moving on 😭

and here's the tea β˜• β€” this function, together with splice_from_pipe_{begin,end,next}, may be used to implement the functionality of __splice_from_pipe when locking is required around copying the pipe buffers to the destination. iykyk. πŸ”’


πŸ’œ SEE ALSO πŸ’œ

Kernel file ./fs/splice.c:

like, read them. they're all in the same friend group fr fr πŸ“šβœ¨


ngl bestie, if you're implementing __splice_from_pipe yourself with locking around the copy, this little trio of helpers is your moment. no cap. 🌈

okay that's the whole page!! πŸ’– she's sourced from ./fs, she's dated October 2026, and she signs off as splice_from_pipe_feed(9) β€” mwah, love her, bye πŸ§šβ€β™€οΈβ­

πŸ“¦ where this page comes from