btrfs-progs: Allow btrfs_leaf_free_space to accept NULL root
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Thu, 5 Nov 2015 08:32:59 +0000 (16:32 +0800)
committerDavid Sterba <dsterba@suse.com>
Thu, 5 Nov 2015 12:40:44 +0000 (13:40 +0100)
commite8a5f57b69b583e0f15b931353aef98380b4e796
tree61f277d4d2f6d8415d59e177654d963b19f1e58d
parentfa2dcf14063bd280c5d6b30309fe54cda3c29e30
btrfs-progs: Allow btrfs_leaf_free_space to accept NULL root

Btrfs_leaf_free_space() function is used to determine the leaf/node
size.
It's OK to use root->nodesize to determine nodesize, but in fact,
extent_buffer->len can also be used to determine the nodesize if caller
can ensure it's a tree block.

So this patch will add support for NULL root for btrfs_leaf_free_space()
function, to allow btrfs_print_leaf() functions to be called in gdb or
to debug temporary btrfs in make_btrfs() without a valid root.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
ctree.c