wb_find_current(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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, the backing_dev_info you'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 under rcu_read_lock, because that's what protects the returned wb. 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:


🌈 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