blkdev_report_zones_cached(9)
π blkdev_report_zones_cached β the Kernel API Manual, but make it cute π
okay so bestie, this is a page out of the Kernel API Manual, and honestly? it's a little banger. it's about grabbing your zone info without bothering the actual hardware β like checking the group chat instead of calling everyone individually. slay. π
β¨ NAME β¨
blkdev_report_zones_cached β get cached zones information π¦
like, the zones you already know about. from the cache. no cap.
πΈ SYNOPSIS πΈ
int blkdev_report_zones_cached (struct block_device *bdev , sector_t
sector , unsigned int nr_zones , report_zones_cb cb , void *data );
that's the whole vibe check: it hands you back an int, takes a block device, a sector, a zone count, a callback, and some private data. five things. we love a clean signature. π
π«Ά ARGUMENTS π«Ά
bdevβ the target block device πΏ like, the one you're actually curious about.sectorβ the sector you wanna start reporting zones from. your little starting point. πnr_zonesβ the maximum number of zones to report. it's a cap, not a promise, bestie. π§’cbβ the callback function, called for each reported zone. one zone, one call, every time. πdataβ private data for the callback function. your little stash of stuff to pass along. π
π₯ DESCRIPTION π₯
okay so this one is similar to blkdev_report_zones BUT β and this is the whole point β instead of calling into the low level device driver to get the zone report from the device, it uses blkdev_get_zone_info to generate the report from the disk zone write plugs and zones condition array. π§β¨
basically: no device driver gossip, we're just reading what we already wrote down. iconic behaviour, honestly.
β οΈ heads up! since calling this function without a callback does not make sense, cb must be specified. not optional. not "i'll add it later". must. periodt. π
π SEE ALSO π
go read these next, i'm obsessed with all of them:
./block/blk-zoned.cβ kernel file, the mothership πblk_zone_cond_str(9)β zone condition, but as a string πbdev_zone_is_seq(9)β is this zone sequential? πblkdev_report_zones(9)β the non-cached cousin βblkdev_zone_mgmt(9)β zone management duties π οΈdisk_report_zone(9)β the disk's own report ποΈblkdev_get_zone_info(9)β where the cached info comes from πblk_zone_plug_bio(9)β plug that bio, bestie πblk_revalidate_disk_zones(9)β revalidate all the things βblk_zone_issue_zeroout(9)β zero it out π¨
and that's the page!! π¦π this little gem comes to you from ./block, dated October 2026, straight out of the Kernel API Manual. mwah. take care of her. πβ¨π
π¦ 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