filemap_splice_read(9)
π
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β theSPLICE_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:
filemap_remove_folio(9)filemap_fdatawrite_range(9)filemap_flush_range(9)filemap_flush(9)filemap_range_has_page(9)filemap_fdatawait_range(9)filemap_fdatawait_range_keep_errors(9)file_fdatawait_range(9)filemap_fdatawait_keep_errors(9)filemap_write_and_wait_range(9)file_check_and_advance_wb_err(9)file_write_and_wait_range(9)replace_page_cache_folio(9)softleaf_entry_wait_on_locked(9)folio_put_wait_locked(9)folio_unlock(9)folio_end_read(9)folio_end_private_2(9)folio_wait_private_2(9)folio_wait_private_2_killable(9)folio_end_writeback_no_dropbehind(9)folio_end_writeback(9)__folio_lock(9)page_cache_next_miss(9)page_cache_prev_miss(9)__filemap_get_folio_mpol(9)find_get_entries(9)find_lock_entries(9)filemap_get_folios(9)filemap_get_folios_contig(9)filemap_get_folios_tag(9)filemap_get_folios_dirty(9)filemap_read(9)generic_file_read_iter(9)mapping_seek_hole_data(9)filemap_fault(9)read_cache_folio(9)mapping_read_folio_gfp(9)read_cache_page_gfp(9)__generic_file_write_iter(9)generic_file_write_iter(9)filemap_release_folio(9)filemap_invalidate_inode(9)filemap_cachestat(9)
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
- 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