locked_inode...nd_lock_list(9)
π locked_inode_to_wb_and_lock_list β Kernel API Manual π
okay so you're reading the Kernel API Manual page for locked_inode_to_wb_and_lock_list(9), and honestly? it's a whole vibe. let's get into it bestie π«Ά
β¨ NAME β¨
locked_inode_to_wb_and_lock_list β figure out which wb a locked inode belongs to, and lock that thing. that's it, that's the job πββοΈ
πΈ SYNOPSIS πΈ
struct bdi_writeback * locked_inode_to_wb_and_lock_list (struct inode *inode );
like, it hands you back a struct bdi_writeback * and takes one struct inode *inode. simple. iconic. no cap. β¨
π ARGUMENTS π
inodeβ the inode you're curious about. heads up: you gotta be holdingi_lockalready, no exceptions, that's the entry fee π
π¦ DESCRIPTION π¦
so it returns the inode's wb with its list_lock held. lockception, we love to see it π
the rules, because there are always rules:
inode->i_lockmust be held on entry π- it gets released on return (so don't go touching it after, bestie, it's gone)
- the
wbyou get back is guaranteed to stay this inode's associatedwbuntil itslist_lockis released β that's the promise, and she keeps her promises π
it's giving "trust me bro" but like, in a legally binding kernel way π
π SEE ALSO π
all the siblings and cousins, in the kernel file ./fs/fs-writeback.c:
inode_io_list_move_locked(9)wb_wait_for_completion(9)inode_cgwb_move_to_attached(9)inode_to_wb_and_lock_list(9)inode_switch_wbs(9)cleanup_offline_cgwb(9)wbc_attach_and_unlock_inode(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)
okay that's the whole page!! sourced from ./fs, dated October 2026 β go forth and hold your locks correctly, bestie, i believe in you π§π 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