sd_zbc_check_capacity(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– sd_zbc_check_capacity(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual β€” this one's a little function from the SCSI disk zoned-block-command world, and yeah, the name is a mouthful, but we're gonna get through it together 🫢


✨ NAME ✨

sd_zbc_check_capacity β€” check the device capacity πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

int sd_zbc_check_capacity (struct scsi_disk *sdkp , unsigned char *buf ,
u32 *zblocks );

like, yes, it takes three args and returns an int, iconic behavior honestly πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • sdkp β€” the target disk, our main character 🌟
  • buf β€” the command buffer, just vibing in there
  • zblocks β€” zone size in logical blocks, noted πŸ“

🌸 DESCRIPTION 🌸

so what does it do, you ask? it gets the device zone size, and then it checks that the device capacity β€” the one reported by READ CAPACITY β€” matches the max_lba value plus one of the report zones command reply, but only for devices with RC_BASIS == 0. not me being specific about the RC_BASIS == 0 condition, that's literally the whole point 😭

and then, the moment of truth: it returns 0 upon success, or an error code upon failure. slay if it's zero, sad girl hours if it's not πŸ’€

ngl, if the capacity doesn't line up, that's your error code right there β€” no cap.

🧚 SEE ALSO 🧚

the kernel file ./drivers/scsi/sd_zbc.c plus the whole friend group:


and that's the whole page, bestie!! πŸŽ€ this one lives in ./drivers/scsi, dated October 2026, and goes by sd_zbc_check_capacity(9) β€” mwah, go read the source, ily, bye πŸ’–βœ¨

πŸ“¦ where this page comes from