sd_zbc_check_capacity(9)
π 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 therezblocksβ 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:
sd_zbc_parse_report(9)sd_zbc_do_report_zones(9)sd_zbc_alloc_report_buffer(9)sd_zbc_zone_sectors(9)sd_zbc_report_zones(9)sd_zbc_setup_zone_mgmt_cmnd(9)sd_zbc_complete(9)sd_zbc_check_zoned_characteristics(9)sd_zbc_read_zones(9)
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
- 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