fs_bdev_unregister(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ fs_bdev_unregister β€” ok so this is the breakup function, bestie

no cap, it literally just drops a superblock's claim on a block device. that's the whole vibe.


✨ SYNOPSIS ✨

void fs_bdev_unregister (struct file *bdev_file , struct super_block *sb );

like, void, so it gives you nothing back. it just takes. iconic behavior honestly πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • bdev_file β€” the file you got back from fs_bdev_file_open_by_{dev,path}(). yes that one. don't just hand over a random file, we're not animals 🫢
  • sb β€” the superblock that this device was claimed for. the whole reason we're here.

🌸 DESCRIPTION 🌸

okay so picture this: it's the literal inverse of fs_bdev_register. the way that it works is you drop one claim on the {dev, sb} entry β€” yes, just one, it's not greedy β€” and the last claim is the one that actually unregisters it. also important: if there's a pinning cursor hanging around, the actual unlink gets deferred. it's giving "i'll get to it later" energy 😭

the big thing: this does not close the device. not even a little. so if you're a caller who has to do stuff with the still-open device between unregistering and closing β€” think re-allowing freezing on one that got denied for a membership change β€” you pair this with bdev_fput. that's the combo move, iykyk πŸ”₯

and if you just want the normal "unregister AND close" situation? that's fs_bdev_file_release, the common one. she's the everyday queen πŸ‘‘


πŸ’œ SEE ALSO πŸ’œ

everything else in the superblock cinematic universe, fr fr β€” Kernel file ./fs/super.c:


ok that's the whole page πŸ’– go forth and unregister responsibly, and remember: don't close the device, that's somebody else's job 🧚

✿ this lil masterpiece lives in ./fs ✿ and it's dated October 2026 β€” yes we're being time travellers about it, slay β­πŸŽ€

πŸ“¦ where this page comes from