diff options
author | Qu Wenruo <wqu@suse.com> | 2018-04-30 11:15:44 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-06-07 16:37:35 +0200 |
commit | 8606fe4bcb8ff88a67a939911af9336499486c85 (patch) | |
tree | d5af5760632ff52c14d84f29e234ed6408f8f95e /qgroup.h | |
parent | 41750fe660cd51ca318976761c1938fa70d7ffa2 (diff) |
btrfs-progs: Allow tree to be printed without an fs_info
For btrfs_print_tree() and btrfs_print_leaf(), the usage of fs_info is
mainly for nodesize and sectorsize.
However for nodesize, we can get it from @eb->len without the need for
fs_info at all.
For nodesize, introduce new helper BTRFS_NODEPTR_PER_EXTENT_BUFFER() to
get nodesize from @eb directly.
And with the help of previous modified btrfs_leaf_free_space(),
btrfs_print_tree() can live without fs_info at all.
For btrfs_print_leaf(), we modify print_extent_csum() to accept NULL
fs_info by skipping csum length calculation.
With all these modification, btrfs_print_tree/leaf() can be called
without accessing @fs_info at all, and make it more flexible to handle
binary tree block dump, or inside gdb.
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Su Yue <suy.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'qgroup.h')
0 files changed, 0 insertions, 0 deletions