netfs_start_io_read(9)
β¨ netfs_start_io_read β like, the official "hey we're doing a buffered read rn" declaration π
okay so bestie, this one lives in section 9 of the Kernel API Manual and honestly? it's giving gatekeeper energy. it's the function you call to be like "hey everybody, a buffered read is about to happen, please don't do anything weird" π«Ά
π SYNOPSIS
int netfs_start_io_read (struct inode *inode );
πΈ ARGUMENTS
inodeβ the file inode. that's it. that's the whole parameter. it's the file we're about to read from, bestie π
π¦ DESCRIPTION
okay so here's the vibe: you call this to declare that a buffered read operation is about to start, and the whole point is making sure we block all direct I/O. no cap, that's the job π₯
when it returns, the function guarantees the NETFS_ICTX_ODIRECT flag is unset, and it's holding a shared lock on inode->i_rwsem so that flag literally cannot be changed while you're holding it. iconic behavior honestly.
in practice, what that means:
- buffered read operations get to run in parallel β thank you shared lock, we love you π
- direct I/O operations have to wait to grab an exclusive lock in order to set
NETFS_ICTX_ODIRECTπ«
heads up: buffered writes and truncates both take a write lock on inode->i_rwsem, which means those get serialised with respect to the reads. so like... they're not invited to the parallel party π
π SEE ALSO
all the sibling functions in the family group chat, plus the kernel file itself:
Kernel file ./fs/netfs/locking.cnetfs_end_io_read(9)netfs_start_io_write(9)netfs_end_io_write(9)netfs_start_io_direct(9)netfs_end_io_direct(9)netfs_wb_begin(9)
alright bestie, that's the whole page β¨ it comes to you from ./fs/netfs, dated October 2026, and yeah β it's netfs_start_io_read(9) top to bottom, no notes π
π
π¦ 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