filemap_splice_read(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… filemap_splice_read(9) β€” fresh from the Kernel API Manual ✨

okay bestie, gather round 🫢 this one is all about yeeting a file's pagecache data into a pipe, and honestly? iconic behavior. no cap.


πŸŽ€ NAME πŸŽ€

filemap_splice_read β€” splice data from a file's pagecache into a pipe πŸ’–

✨ SYNOPSIS ✨

ssize_t filemap_splice_read (struct file *in , loff_t *ppos , struct
pipe_inode_info *pipe , size_t len , unsigned int flags );

πŸ’– ARGUMENTS πŸ’–

  • in β€” the file you're reading from, bestie 🌸
  • ppos β€” pointer to the file position you're reading from, lowkey important πŸ“
  • pipe β€” the pipe getting spliced into πŸŽ€
  • len β€” how much you wanna splice, literally the amount ✨
  • flags β€” the SPLICE_F_* flags, iykyk πŸ¦‹

🌸 DESCRIPTION 🌸

so this function grabs folios from a file's pagecache and splices them into the pipe πŸ’… readahead gets called as necessary to fill more folios, which is giving β€œwe got more where that came from” energy. oh, and it may be used for blockdevs also β€” periodt. πŸ”₯

πŸ¦‹ RETURN πŸ¦‹

on success, the number of bytes read gets returned and *ppos will be updated if appropriate 🫢 0 gets returned if there's no more data to be read; -EAGAIN gets returned if the pipe had no space; and some other negative error code gets returned on error 😭 also a short read may occur if the pipe has insufficient space, we reach the end of the data, or we hit a hole β€” yeah, that's the vibe check πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

the whole squad is here, bestie β€” Kernel file ./mm/filemap.c plus:


that's the whole page, babe πŸ’Œ brought to you by source/version ./mm, dated October 2026 β€” mwah, slay, and happy splicing 🫢✨

πŸ“¦ where this page comes from