inode_dio_wait(9)
π inode_dio_wait β Kernel API Manual (yes bestie, the kernel API manual)
okay so picture this: you're in the kernel, in inode_dio_wait(9), and your whole personality for the next however-long is waiting. iconic honestly. this one's from the Kernel API Manual and she's short but she ATE. π
β¨ NAME β¨
inode_dio_wait β wait for outstanding DIO requests to finish π¦
like literally just sit there and let the direct I/O girlies finish their thing bestie.
πΈ SYNOPSIS πΈ
void inode_dio_wait (struct inode *inode );
no cap, that's the whole signature. returns nothing. void. she gives nothing and that's the point π
π«Ά ARGUMENTS π«Ά
inodeβ the inode to wait for. that's it. that's the argument. she's the main character of this function and you're just here for the ride β¨
π DESCRIPTION π
Waits for all pending direct I/O requests to finish so that we can proceed with a truncate or equivalent operation. fr fr, it's the "everyone out of the pool before we drain it" of the kernel π
Must be called under a lock that serializes taking new references to i_dio_count, usually by inode->i_rwsem.
π¨ okay this is the part where you pay attention bestie β the lock thing is not a vibe suggestion. It's a must. You need to already be holding a lock that serializes taking new references toi_dio_count, and the usual suspect isinode->i_rwsem. Don't skip this, iykyk. π
π SEE ALSO π
the whole friend group, honestly. Kernel file ./fs/inode.c and like everyone she's ever been in a group chat with:
inode_init_always_gfp(9)alloc_inode(9)drop_nlink(9)clear_nlink(9)set_nlink(9)inc_nlink(9)inode_sb_list_add(9)__insert_inode_hash(9)__remove_inode_hash(9)evict_inodes(9)new_inode(9)unlock_new_inode(9)lock_two_nondirectories(9)unlock_two_nondirectories(9)inode_insert5(9)iget5_locked(9)iget5_locked_rcu(9)iget_locked(9)iunique(9)ihold(9)ilookup5_nowait(9)ilookup5(9)ilookup(9)find_inode_nowait(9)find_inode_rcu(9)find_inode_by_ino_rcu(9)iput(9)iput_not_last(9)bmap(9)inode_update_time(9)generic_update_time(9)atime_needs_update(9)file_remove_privs(9)current_time(9)file_update_time(9)file_modified_flags(9)file_modified(9)kiocb_modified(9)inode_init_owner(9)inode_owner_or_capable(9)timestamp_truncate(9)inode_set_ctime_current(9)inode_set_ctime_deleg(9)in_group_or_capable(9)mode_strip_sgid(9)dump_inode(9)
and that's the page!! short, sweet, and absolutely not to be called without your lock held π stay safe out there and slay your truncates π§
π sign-off time π this little masterpiece came out of ./fs and is dated October 2026, so yes she's a Libra (or Scorpio, depends on the day, don't @ me). go read inode_dio_wait(9)'s friends now bestie, ily πβ¨
π¦ 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