disk_release(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… disk_release(9)

okay so this is a page from the Kernel API Manual bestie, and it's literally all about disk_release β€” the little cleanup queen of the gendisk world. let's get into it πŸŽ€


✨ NAME ✨

disk_release β€” releases all allocated resources of the gendisk. she's the one who closes the tab, empties the fridge and turns off the lights on her way out. no cap. 🧹


✨ SYNOPSIS ✨

void disk_release (struct device *dev );

that's it. that's the whole vibe check. πŸ’…


✨ ARGUMENTS ✨

  • dev β€” the device representing this disk 🫢 like, this is the actual thing you're handing over so she knows which disk's stuff needs releasing.

✨ DESCRIPTION ✨

so, disk_release releases all allocated resources of the gendisk. all of them. every single one. she does not leave crumbs. πŸ’€

now here's the lore for drivers that used device_add_disk: ngl, those drivers have a gendisk with a request_queue assigned to it. and because the request_queue sits on top of the gendisk for these drivers, we also call blk_put_queue for them. πŸ‘‘

and bestie, we expect the request_queue refcount to reach 0 at this point β€” like, that's the whole point β€” so the request_queue will also be freed prior to the disk. order matters, that's the tea. πŸ“


✨ CONTEXT ✨

  • can sleep 😴

so yeah, she's allowed to nap. you do not have to hold your breath here. πŸ¦‹


✨ SEE ALSO ✨

all the siblings and adjacent icons, in the kernel file ./block/genhd.c:


okay that's the page! huge shoutout to the ./block directory and to October 2026 for the timestamp β€” this one's from the Kernel API Manual, and honestly? iconic. periodt. πŸŒˆπŸ‘‘πŸ’–

πŸ“¦ where this page comes from