fs_put_dax(9)
π fs_put_dax(9) π
okay so this is a page from the Kernel API Manual (that's the 9 bit, bestie β kernel devs only) and honestly? it's a tiny little function with big "don't mess this up" energy. sit down, we're learning about handing back your dax device π¦
β¨ NAME β¨
fs_put_dax β release holder ownership of a dax_device
like, you grabbed it, now you give it back. that's the whole vibe π
πΈ SYNOPSIS πΈ
void fs_put_dax (struct dax_device *dax_dev , void *holder );
two things in, nothing out. no return value, no drama, no notes. she just does it π
π ARGUMENTS π
dax_devβ the dax device you're releasing. and yes, it may beNULLπ it's giving low-maintenance, it's giving "we'll handle it."holderβ the holder pointer you previously passed tofs_dax_getorfs_dax_get_by_bdev. and bestie, listen to me: it must match exactly. not kinda-match, not close-enough-match, exactly match. because it's used in acmpxchgto atomically release ownership π₯ get this wrong and the vibes are ruined.
fr fr, that pointer is doing real work. it's the atomic cmpxchg that decides whether you actually get to let go. no cap.
β DESCRIPTION β
okay so the rules of this function are short but they are strict:
- Must only be called by the current holder. if you're not the current holder, this is not your moment. main character energy only, and you are not the main character of that dax device rn π
- It clears
holder_opsbeforeholder_dataβ and there's a whole reason for that ordering, which is lowkey iconic honestly. if it did it the other way around, a concurrentfs_dax_getcould sneak in, install its own freshly-setholder_ops, and then get them overwritten by this call. a whole race condition. we simply don't allow it π
so like. the ordering isn't a style choice, it's load-bearing. respect it π«Ά
π¦ SEE ALSO π¦
- Kernel file
./drivers/dax/super.c struct dax_device(9)fs_dax_get_by_bdev(9)fs_dax_get(9)dax_direct_access(9)dax_set_ops(9)dax_holder(9)inode_dax(9)
go read fs_dax_get(9) next if you want the other half of this codependent little relationship π
and that's the page!! πβ¨ brought to you by ./drivers/dax, dated October 2026 β go forth and release your holders correctly, bestie, i believe in you πππ
π¦ 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