unlocked_inode_to_wb_begin(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« unlocked_inode_to_wb_begin(9) πŸ’«

okay bestie, so this one lives in the Kernel API Manual and it's literally the glow-up your inode's writeback access needed. let's get into it πŸŽ€


✨ NAME ✨

unlocked_inode_to_wb_begin β€” begin an unlocked inode wb access transaction. yes queen, unlocked, we're being brave today πŸ’…


✨ SYNOPSIS ✨

struct bdi_writeback * unlocked_inode_to_wb_begin (struct inode *inode ,
struct wb_lock_cookie *cookie );

like, that's the whole vibe. returns a struct bdi_writeback * and takes two args. slay.


✨ ARGUMENTS ✨

  • inode β€” the target inode 🎯 like, the actual star of the show
  • cookie β€” an output param, and no you cannot snack on it πŸͺ it's gotta get passed straight into the end function later, that's its whole purpose

✨ DESCRIPTION ✨

so here's the situation, bestie. the caller wants to access the wb associated with inode, but is not holding inode->i_lock, the i_pages lock, or wb->list_lock. none of them. zero locks held. living dangerously, honestly πŸ’€

this function's whole job is to figure out which wb belongs to that inode and then make sure the association doesn't change until the transaction is finished with unlocked_inode_to_wb_end. like it's holding the relationship together so nobody switches up mid-transaction. main character energy fr fr πŸ‘‘

πŸ’– important, don't skip this: the caller must call unlocked_inode_to_wb_end with *cookie afterwards, and can't sleep during the transaction. also, IRQs may or may not be disabled on return β€” yes, "may or may not", that's not me being vague, that's the actual deal, so plan accordingly πŸ™ˆ

✨ SEE ALSO ✨


and that's the page, bestie!! this little icon comes to you from ./include/linux, dated October 2026, and it's filed under unlocked_inode_to_wb_begin(9) β€” go forth and lock responsibly πŸŒΈπŸ¦‹πŸ’œ

πŸ“¦ where this page comes from