netfs_file_read_iter(9)
okay so bestie, welcome to the manual page for netfs_file_read_iter(9) from the Kernel API Manual β the Generic filesystem read routine β and the vibe is very βkernel filesystem girlie who knows her page cacheβ π
β¨
π NAME π
netfs_file_read_iter β generic filesystem read routine.
Like, thatβs the whole name, no cap.
β¨ SYNOPSIS β¨
ssize_t netfs_file_read_iter (struct kiocb *iocb , struct iov_iter *iter
);
π¦ ARGUMENTS π¦
iocbβ kernel I/O control block π§iterβ destination for the data read π―
thatβs the whole cast, periodt.
π DESCRIPTION π
so like, this is the ->read_iter routine for all filesystems that can use the page cache directly. not some of them β all of the ones in that club. slay.
now the flag lore, bestie, because this is where the details live:
- The
IOCB_NOWAITflag iniocb->ki_flagssays that-EAGAINshall be returned when no data can be read without waiting for I/O requests to complete. It does not prevent readahead. no cap. - The
IOCB_NOIOflag iniocb->ki_flagssays that no new I/O requests shall be made for the read or for readahead. When no data can be read,-EAGAINshall be returned. When readahead would be triggered, a partial, possibly empty read shall be returned. itβs giving βdo not start new I/O, but handle what you canβ energy π
π RETURN π
what comes back? glad you asked:
- number of bytes copied, even for partial reads π¦
- negative error code (or
0ifIOCB_NOIO) if nothing was read π
π«Ά SEE ALSO π«Ά
Kernel file ./fs/netfs/buffered_read.c β plus these icon functions: netfs_readahead(9), netfs_read_folio(9), netfs_write_begin(9), netfs_buffered_read_iter(9). go read them, iykyk πβ
mwah π β page source is ./fs/netfs, dated October 2026, and it belongs to netfs_file_read_iter(9). bye bestie, go read some bytes πβ¨π«Ά
π¦ 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