blkdev_report_zones(9)
π blkdev_report_zones(9) β kernel API manual, bestie edition π
okay so this one lives in the Kernel API Manual section (blkdev_report_zones(9)) and it's literally the glow-up your zoned block device needs. let's get into it π¦
β¨ NAME β¨
blkdev_report_zones β Get zones information π (yes that's the whole vibe, it fetches zone info, iconic)
πΈ SYNOPSIS πΈ
int blkdev_report_zones (struct block_device *bdev , sector_t sector ,
unsigned int nr_zones , report_zones_cb cb , void *data );
look at her. five args, one int coming back, absolute main character energy π
π«Ά ARGUMENTS π«Ά
bdevβ Target block device π½ the one you're snooping on, bestie.sectorβ Sector from which to report zones π like, the starting point of your little tour.nr_zonesβ Maximum number of zones to report π’ the cap, the limit, the "that's enough zones for today".cbβ Callback function called for each reported zone π it rings once per zone, every single time, no ghosting.dataβ Private data for the callback π your lil care package, passed straight through tocb.
π DESCRIPTION π
So here's what she does: get zone information starting from the zone containing sector for at most nr_zones, and call cb for each zone reported by the device β¨
and if you wanna report all zones in a device starting from sector? just pass the BLK_ALL_ZONES constant to nr_zones and she ate π
π₯
Returns the number of zones reported by the device, or a negative errno value in case of failure π (ngl, if you see that negative errno, something went wrong fr fr)
π¨ NOTE π¨
The caller must usememalloc_noXX_save/restorecalls to control memory allocations done within this function. no cap β don't skip this, it's the whole point of the note π
π¦ SEE ALSO π¦
Kelated reading, all in the kernel file ./block/blk-zoned.c β go be nosy, iykyk π:
blk_zone_cond_str(9)bdev_zone_is_seq(9)blkdev_zone_mgmt(9)disk_report_zone(9)blkdev_get_zone_info(9)blkdev_report_zones_cached(9)blk_zone_plug_bio(9)blk_revalidate_disk_zones(9)blk_zone_issue_zeroout(9)
β and that's the page!! sign-off time: this cutie came from the source path ./block, dated October 2026, and she's filed under blkdev_report_zones(9) in the Kernel API Manual π go report some zones, bestie, you've got this πππ
π¦ 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