blkdev_get_zone_info(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ blkdev_get_zone_info β€” bestie edition ✨

okay so this is a page from the Kernel API Manual (section 9, the kernel-functions aisle 🫢) and it's all about getting zone info for one specific zone. it's giving "niche but iconic" tbh.


🌸 NAME 🌸

blkdev_get_zone_info β€” grab a single zone's information out of the cached data πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

int blkdev_get_zone_info (struct block_device *bdev , sector_t sector ,
struct blk_zone *zone );

πŸ’– ARGUMENTS πŸ’–

  • bdev β€” the target block device, aka the main character of this whole operation πŸ‘‘
  • sector β€” a sector that's contained by the target zone (yes, it just has to live inside it, it doesn't have to be the first one πŸŽ€)
  • zone β€” the zone structure where the zone information gets returned 🌸

✨ DESCRIPTION ✨

so basically: you're getting the zone information for the zone that contains sector, and the way it does that is with the zone write plug of the target zone β€” if one exists β€” or the disk zone condition array otherwise. either way, you're covered, bestie πŸ’…

real talk though: the zone condition may be reported as being the BLK_ZONE_COND_ACTIVE condition for a zone that is actually in the implicit open, explicit open or closed condition. so don't come for the report, it's just how it vibes πŸ™ˆ

it returns 0 on success and a negative error code on failure. no cap ✨


πŸ”₯ SEE ALSO πŸ”₯

kernel file ./block/blk-zoned.c and honestly the whole friend group:


ngl the "zone condition may be reported as BLK_ZONE_COND_ACTIVE" bit is the one thing to actually remember β€” it's a real caveat, not a vibe check fail 🫢

okay that's the whole page, bestie πŸ’œ source is the ./block kernel file, and this lil manual page is dated October 2026 β€” so mark your calendars and slay the zone management, periodt πŸŽ€πŸŒˆβ­

πŸ“¦ where this page comes from