wb_wait_for_completion(9)
π wb_wait_for_completion(9) π
okay so this is a page from the Kernel API Manual β the wb_wait_for_completion(9) girlies, this one's for you π«Ά
β¨ NAME β¨
wb_wait_for_completion β literally just sit there and wait for your bdi_writeback_works to be done π
πΈ SYNOPSIS πΈ
void wb_wait_for_completion (struct wb_completion *done );
π ARGUMENTS π
- _
done_ β the targetwb_completion, bestie. that's the one you're waiting on π¦
π DESCRIPTION π
okay so picture this: you've got one or more work items that were issued to bdi, and each of them has its ->done field set to done. this function waits for those. all of them. every single one π
and like β done should have been initialized with DEFINE_WB_COMPLETION beforehand, no cap. that's non-negotiable, it's giving "read the directions before you start."
the function returns after all such work items are completed. slay. but here's the thing π β work items which are waited upon aren't freed automatically on completion. so like, don't just assume they clean themselves up, because they do not, and that's on periodt.
π₯ SEE ALSO π₯
Kernel file ./fs/fs-writeback.c
inode_io_list_move_locked(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_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)
and that's the whole page, bestie π this one came out of ./fs, dated October 2026, and it's filed under wb_wait_for_completion(9) β go off, kernel docs πβ¨π§
π¦ 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