netfs_file_read_iter(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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_NOWAIT flag in iocb->ki_flags says that -EAGAIN shall 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_NOIO flag in iocb->ki_flags says that no new I/O requests shall be made for the read or for readahead. When no data can be read, -EAGAIN shall 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 0 if IOCB_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