netfs_start_io_direct(9)
πΈ NAME πΈ
okay so bestie, welcome to the Kernel API Manual page for netfs_start_io_direct β yes, netfs_start_io_direct(9) if weβre being formal β and itβs literally the function that declares the file is being used for direct i/o. π
β¨ SYNOPSIS β¨
int netfs_start_io_direct (struct inode *inode );
π ARGUMENTS π
inodeβ file inode. thatβs the whole argument, bestie. π¦
π DESCRIPTION π
okay so netfs_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 cap, thatβs the vibe. π
On exit, the function makes sure the NETFS_ICTX_ODIRECT flag is set, and it holds a shared lock on inode->i_rwsem to ensure that the flag cannot be changed. periodt. π
In practice, this means direct I/O operations are allowed to execute in parallel β thank you, shared lock β whereas buffered I/O operations need to wait to grab an exclusive lock in order to clear NETFS_ICTX_ODIRECT. the way that locking situation works is honestly iconic. β¨
also pls note: buffered writes and truncates both take a write lock oninode->i_rwsem, meaning that those are serialised w.r.t.O_DIRECT. so yeah, they are not out here running wild together. π
π SEE ALSO π
Kernel file ./fs/netfs/locking.c β plus these besties, iykyk:
netfs_start_io_read(9)netfs_end_io_read(9)netfs_start_io_write(9)netfs_end_io_write(9)netfs_end_io_direct(9)netfs_wb_begin(9)
cute little sign-off: this page comes from ./fs/netfs, itβs dated October 2026, and itβs all about netfs_start_io_direct(9). mwah πβ¨
π¦ 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