diff options
author | Josef Bacik <jbacik@fb.com> | 2017-08-25 11:11:46 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-09-08 16:15:05 +0200 |
commit | 5fbc00cc7342f46f607079ae920b338b6253250d (patch) | |
tree | 79f714e9eb9065f28bace228821d3fae71daefc8 /print-tree.c | |
parent | 872837ebbfb186e2e2cdf39daac98257fcd18392 (diff) |
btrfs-progs: print the csum length in debug-tree
While looking at a log of a corrupted fs I needed to verify we were
missing csums for a given range. Make this easier by printing out the
range of bytes a csum item covers.
Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'print-tree.c')
-rw-r--r-- | print-tree.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/print-tree.c b/print-tree.c index b4da3850..e53b9aac 100644 --- a/print-tree.c +++ b/print-tree.c @@ -1233,9 +1233,16 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *eb) case BTRFS_CSUM_ITEM_KEY: printf("\t\tcsum item\n"); break; - case BTRFS_EXTENT_CSUM_KEY: - printf("\t\textent csum item\n"); + case BTRFS_EXTENT_CSUM_KEY: { + u16 csum_size = + btrfs_super_csum_size(root->fs_info->super_copy); + u32 size = (item_size / csum_size) * + root->fs_info->sectorsize; + printf("\t\textent csum item range %llu-%llu\n", + (unsigned long long)disk_key.offset, + (unsigned long long)disk_key.offset + size); break; + } case BTRFS_EXTENT_DATA_KEY: print_file_extent_item(eb, item, i, ptr); break; |