blkdev_report_zones(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 to cb.

πŸ’œ 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 use memalloc_noXX_save/restore calls 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 πŸ‘€:


⭐ 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