unlocked_inode_to_wb_begin(9)
π« 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 showcookieβ 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 callunlocked_inode_to_wb_endwith*cookieafterwards, 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 β¨
- Kernel file
./include/linux/backing-dev.h writeback_in_progress(9)inode_cgwb_enabled(9)wb_find_current(9)wb_get_create_current(9)inode_to_wb(9)unlocked_inode_to_wb_end(9)β the other half of this duo, you literally cannot skip it π«Ά
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
- 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