wb_get_create(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– wb_get_create β€” the Kernel API Manual tea πŸ’–

okay so bestie, welcome to the Kernel API Manual entry for wb_get_create(9) β€” and yes it's giving "small function, big responsibilities" energy and we're gonna get into it 🌸


✨ NAME ✨

wb_get_create β€” get wb for a given memcg, create if necessary

literally the whole vibe: you want the wb, you maybe don't have the wb, so we make the wb. iconic πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

struct bdi_writeback * wb_get_create (struct backing_dev_info *bdi ,
struct cgroup_subsys_state *memcg_css , gfp_t gfp );

that's the whole signature, no cap β€” check the return type: a struct bdi_writeback * πŸŽ€


🌈 ARGUMENTS 🌈

  • bdi β€” the target bdi, like the destination of this whole little journey πŸ’«
  • memcg_css β€” the cgroup_subsys_state of the target memcg. heads up bestie, it must have positive ref β€” that's a hard requirement, not a suggestion πŸ™ˆ
  • gfp β€” the allocation mask to use πŸ“

🧚 DESCRIPTION 🧚

So here's the plot: try to get the wb for memcg_css on bdi. simple enough right?

but if it doesn't exist? bestie, we try to create one. that's the "create if necessary" part of the name doing its thing ✨

and for the deeper lore, the manpage says see wb_get_lookup for more details β€” so like, if you want the full story, that's where you go πŸ‘‘


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./mm/backing-dev.c β€” that's where the source lives 🫢


πŸ’€ friendly reminder from your girl: memcg_css needs a positive ref. don't come crying to me if you skip that. i warned you. periodt.

and that's the page!! πŸ’œ this one comes from the ./mm source, dated October 2026 β€” so yeah, she's fresh, she's current, she ate and left no crumbs 🌟 byeee πŸ’–πŸŽ€

πŸ“¦ where this page comes from