nfs_start_io_direct(9)
π NAME π
nfs_start_io_direct(9) β from the Kernel API Manual, and it's literally here to declare that the file is being used for direct i/o π«Άβ¨
β¨ SYNOPSIS β¨
int nfs_start_io_direct (struct inode *inode );
π ARGUMENTS π
inodeβ the file inode, bestie. That's the whole argument.
πΈ DESCRIPTION πΈ
Okay so picture this: nfs_start_io_direct() declares that a direct I/O operation is about to start, and it makes sure we block all buffered I/O. No sneaky buffered stuff cutting in, periodt.
On exit, the function ensures that the NFS_INO_ODIRECT flag is set, and it holds a shared lock on inode->i_rwsem so that flag literally cannot be changed. The way this shakes out in practice? Direct I/O operations are allowed to execute in parallel, thanks to that shared lock. Buffered I/O operations, though? They need to wait and grab an exclusive lock in order to clear NFS_INO_ODIRECT. Slay for direct I/O, lowkey rough for buffered.
Also note β and this is important β buffered writes and truncates both take a write lock on inode->i_rwsem. That means those are serialised w.r.t. O_DIRECT. Not me explaining locking drama, it's just the vibe π«
π¦ SEE ALSO π¦
- Kernel file
./fs/nfs/io.cβ plusnfs_start_io_read(9),nfs_end_io_read(9),nfs_start_io_write(9),nfs_end_io_write(9),nfs_start_io_direct_nowait(9),nfs_end_io_direct(9)π
This little icon lives in ./fs/nfs, dated October 2026, and the page is nfs_start_io_direct(9) β mwah, go off ππ
π¦ 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