Skip to content

Commit

Permalink
Fix raw disk space usage for chunks
Browse files Browse the repository at this point in the history
The calculation did not make any sense for profiles like RAID0, RAID10,
RAID5 and RAID6. Use the new helper to calculate the size of a device
extent that is in use on disks to back the storage for this chunk.
  • Loading branch information
knorrie committed Jun 2, 2018
1 parent c73fb02 commit a48a494
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def walk_chunks(fs, devices=None, order=None, size=None,
except btrfs.ctree.ItemNotFoundError:
continue
used_pct = block_group.used / block_group.length
length = chunk.length * len(stripes)
length = btrfs.utils.chunk_to_dev_extent_length(chunk) * len(stripes)
if verbose >= 1:
print(block_group)
print(chunk)
Expand Down

0 comments on commit a48a494

Please sign in to comment.