wb_find_current(9)
β¨ wb_find_current(9) β the kernel API glow-up π
okay so bestie, welcome to wb_find_current(9) from the Kernel API Manual π
this one's a tiny function but it's doing important work behind the scenes, so let's get into it fr fr.
πΈ NAME πΈ
wb_find_current β find the wb for %current on a bdi π¦
β¨ SYNOPSIS β¨
struct bdi_writeback * wb_find_current (struct backing_dev_info *bdi );
π ARGUMENTS π
bdiβ the bdi of interest π like, thebacking_dev_infoyou're poking at.
π DESCRIPTION π
So here's the vibe: wb_find_current finds the wb of bdi that matches both the memcg and the blkcg of current. Both. Not one. Both. π«Ά
β οΈ Okay this part is literally non-negotiable: it must be called underrcu_read_lock, because that's what protects the returnedwb. No cap. π
And if nothing matches? You get NULL β NULL if not found. That's it, that's the whole function. Iconic, honestly. π
π¦ SEE ALSO π¦
Lowkey you should also check out the kernel file ./include/linux/backing-dev.h and these besties:
writeback_in_progress(9)inode_cgwb_enabled(9)wb_get_create_current(9)inode_to_wb(9)unlocked_inode_to_wb_begin(9)unlocked_inode_to_wb_end(9)
π SIGN-OFF π
this little legend lives in ./include/linux, dated October 2026, and it's serving wb_find_current(9) realness in the Kernel API Manual. go protect that rcu_read_lock bestie, 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