inode_switch_wbs(9)
π inode_switch_wbs(9) β the Kernel API Manual, but make it make sense
okay so bestie, this one lives in the Kernel API Manual and it's genuinely so simple, which is exactly why people get it twisted. it's a void function, so like... you get nothing back. no receipt, no tracking number, nothing. and yes, it can just quietly not work. we'll get to that. π«Ά
β¨ NAME β¨
inode_switch_wbs β change the wb association of an inode
like, an inode is in one situationship with a wb, and this function is the friend who's like "girl, let me introduce you to someone else." π
πΈ SYNOPSIS πΈ
void inode_switch_wbs (struct inode *inode , int new_wb_id );
two arguments, returns nothing. periodt.
π ARGUMENTS π
inodeβ the target inode. this is the one getting set up on the blind date. it's astruct inode *, so, yk, a pointer, be normal about it. πnew_wb_idβ the ID of the new wb. this is the plus-one. it's anint, it's an ID, and it's whoinodeis being matched with. β¨
π¦ DESCRIPTION π¦
so here's the whole vibe: this function switches the inode's wb association over to the wb identified by new_wb_id. that's it. that's the tea. π
but β and this is the part you cannot skip, bestie β the switching is performed asynchronously and may fail silently. π
let me say it again for the people in the back:
the switch doesn't happen right now, right here, in front of you. it gets queued up and happens later. and if it goes wrong? nobody tells you. no error code, no return value (it's void, remember), no little notification sound. it just... doesn't. π
so don't be out here assuming that because you called it, the association is already updated by the time the next line of your code runs. it's giving "left on read" energy, and honestly? iconic of it. π
π SEE ALSO π
the kernel file for this one is ./fs/fs-writeback.c β go read it if you want the full lore, iykyk. π
and here's the whole friend group, all of them section (9), all of them worth knowing:
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)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)
not a single one of them skipped, bestie. we list all of them. no cap. π
and that's the page!! π§ source is ./fs, dated October 2026 β so like, yeah, recent. mwah, go forth and switch those wb associations (asynchronously, and possibly silently failing, but with confidence) ππ¦πΈ
π¦ 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