wbc_attach_and_unlock_inode(9)
π wbc_attach_and_unlock_inode(9) β Kernel API Manual
okay bestie, welcome to the wbc_attach_and_unlock_inode(9) page β¨ this is a section 9 kernel API joint, so pull up a chair, grab a strawberry π, and let's get into it.
πΈ NAME πΈ
wbc_attach_and_unlock_inode β the function that associates a wbc with a target inode and then unlocks it, like the world's most responsible situationship π«Ά
π SYNOPSIS π
void wbc_attach_and_unlock_inode (struct writeback_control *wbc , struct inode *inode );
that's the whole signature, no cap β returns void, so don't go looking for a return value, she gives you nothing back π
π¦ ARGUMENTS π¦
wbcβ thewriteback_controlof interest π this is the vibe check target, the struct we're about to write into.inodeβ the target inode π the main character of this whole operation.
β¨ DESCRIPTION β¨
so here's the tea β β inode is locked and is about to be written back under the control of wbc. simple so far, right?
what this function does is: record inode's writeback context into wbc, and then unlock the i_lock. that's it. that's the whole job. iconic behaviour, honestly π
heads up bestie: on writeback completion, wbc_detach_inode should be called. don't leave her hanging β she needs her counterpart π€
and what's all this in service of? tracking the cgroup writeback context π that's the actual point of this whole dance.
π₯ SEE ALSO π₯
first off, the kernel file this lives in: ./fs/fs-writeback.c β put some respect on it π§
and here's the full squad, every single one of them, no gatekeeping:
inode_io_list_move_locked(9)wb_wait_for_completion(9)inode_cgwb_move_to_attached(9)locked_inode_to_wb_and_lock_list(9)inode_to_wb_and_lock_list(9)inode_switch_wbs(9)cleanup_offline_cgwb(9)wbc_attach_fdatawrite_inode(9)wbc_detach_inode(9)wbc_account_cgroup_owner(9)wb_split_bdi_pages(9)bdi_split_work_to_wbs(9)cgroup_writeback_by_id(9)cgroup_writeback_umount(9)wb_start_background_writeback(9)filemap_dontcache_kick_writeback(9)__mark_inode_dirty(9)writeback_inodes_sb_nr(9)writeback_inodes_sb(9)try_to_writeback_inodes_sb(9)sync_inodes_sb(9)write_inode_now(9)sync_inode_metadata(9)
like, that is a stacked SEE ALSO section. ate and left no crumbs π½οΈ
anyway that's the whole page, bestie, hope it slayed for you π this lil number lives in ./fs and the version stamp is dated October 2026, so likeβ¦ she's from the future, periodt β bye! π
π¦ 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