Skip to content

utils: support IEC binary size units (KiB..PiB)#47

Merged
ezekiel-alexrod merged 1 commit into
mainfrom
improvement/binary-size-units
Jun 3, 2026
Merged

utils: support IEC binary size units (KiB..PiB)#47
ezekiel-alexrod merged 1 commit into
mainfrom
improvement/binary-size-units

Conversation

@ezekiel-alexrod
Copy link
Copy Markdown
Contributor

storcli2 reports sizes with IEC labels (e.g. "9.094 TiB") that ConvertSizeBytes
rejected. Map KiB/MiB/GiB/TiB/PiB to the same binary multipliers as the existing
KB..PB labels. These RAID CLIs report binary quantities regardless of label
(ssacli "800 GB" == 858993459200 == 800 GiB; megaraid "16.370 TB" ==
17999005346693 == 16.370 TiB), so both families share the 1024-based multiplier;
a comment and tests document this on purpose.

storcli2 reports sizes with IEC labels (e.g. "9.094 TiB") that ConvertSizeBytes
rejected. Map KiB/MiB/GiB/TiB/PiB to the same binary multipliers as the existing
KB..PB labels. These RAID CLIs report binary quantities regardless of label
(ssacli "800 GB" == 858993459200 == 800 GiB; megaraid "16.370 TB" ==
17999005346693 == 16.370 TiB), so both families share the 1024-based multiplier;
a comment and tests document this on purpose.
@ezekiel-alexrod ezekiel-alexrod requested a review from a team as a code owner June 3, 2026 07:59
@ezekiel-alexrod ezekiel-alexrod merged commit aab9e9f into main Jun 3, 2026
3 checks passed
@ezekiel-alexrod ezekiel-alexrod deleted the improvement/binary-size-units branch June 3, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants