Btrfs-progs: optimize function btrfs_read_chunk_tree
authorFilipe David Borba Manana <fdmanana@gmail.com>
Tue, 30 Jul 2013 11:08:17 +0000 (12:08 +0100)
committerDavid Sterba <dsterba@suse.cz>
Fri, 9 Aug 2013 12:32:34 +0000 (14:32 +0200)
commit44afbb0a52f48375e419e4969f9ea9619df85e24
tree111f5a43bd179ac63bb75e9efc5a8e5cfb9cd386
parentb2b6dcca2fccbf074f95c4854f24f361cc0e92c9
Btrfs-progs: optimize function btrfs_read_chunk_tree

After reading all device items from the chunk tree, don't
exit the loop and then navigate down the tree again to find
the chunk items. Instead just read all device items and
chunk items with a single tree search. This is possible
because all device items are found before any chunk item in
the chunks tree.

This is a port of the corresponding kernel patch to keep both
kernel and btrfs-progs identical:

https://patchwork.kernel.org/patch/2835529/

Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Reviewed-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
volumes.c