Make zpool status dedup table support raw bytes -p output #17926
+39
−17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check if
-pflag is enabled, and if so print dedup table with raw bytes. Restructure the logic in zutil_pool to check if-pflag is enabled before callingzfs_nicenum()andzfs_nicebytes(). Other files changed update the call to/header declaration ofdump_ddt_stat()to include a new variable: boolean_t parsable, indicating whether or not-pwas usedThis PR also includes updates to the ABI files because the function header for zpool_dump_ddt() was modified to include a new parameter which indicates if the
-pflag was used.Fixes #11626
How Has This Been Tested?
Before this PR, when
-pwasn't supported (equivalent of running the command with just-D):zpool status -D -p testpool pool: testpool state: ONLINE config: NAME STATE READ WRITE CKSUM testpool ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 /tmp/zdisks/disk1.img ONLINE 0 0 0 /tmp/zdisks/disk2.img ONLINE 0 0 0 errors: No known data errors dedup: DDT entries 317, size 118K on disk, 96K in core bucket allocated referenced ______ ______________________________ ______________________________ refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE ------ ------ ----- ----- ----- ------ ----- ----- ----- 1 317 39.6M 39.6M 39.6M 317 39.6M 39.6M 39.6M Total 317 39.6M 39.6M 39.6M 317 39.6M 39.6M 39.6MAfter this PR:
zpool status -D -p testpool pool: testpool state: ONLINE config: NAME STATE READ WRITE CKSUM testpool ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 /tmp/zdisks/disk1.img ONLINE 0 0 0 /tmp/zdisks/disk2.img ONLINE 0 0 0 errors: No known data errors dedup: DDT entries 317, size 121344 on disk, 98304 in core bucket allocated referenced ______ ______________________________ ______________________________ refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE ------ ------ ----- ----- ----- ------ ----- ----- ----- 1 317 41549 41549 41549 317 41549 41549 41549 Total 317 41549 41549 41549 317 41549 41549 41549Types of changes
Checklist:
Signed-off-by.