nfs_start_io_direct(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 πŸ¦‹


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