fs_put_dax(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 be NULL 😌 it's giving low-maintenance, it's giving "we'll handle it."
  • holder β€” the holder pointer you previously passed to fs_dax_get or fs_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 a cmpxchg to 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_ops before holder_data β€” and there's a whole reason for that ordering, which is lowkey iconic honestly. if it did it the other way around, a concurrent fs_dax_get could sneak in, install its own freshly-set holder_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 πŸ¦‹

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