btrfs-progs: cleanup duplicate assignment of variable leaf for btrfs-restore

The value of variable leaf in while loop don't have to be set
for every round. Just move it outside.

Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
Gui Hecheng 2014-08-21 10:56:52 +08:00 committed by David Sterba
parent 0c753f13e9
commit 103f68d715

View File

@ -967,8 +967,9 @@ static int do_list_roots(struct btrfs_root *root)
return -1;
}
leaf = path->nodes[0];
while (1) {
leaf = path->nodes[0];
slot = path->slots[0];
if (slot >= btrfs_header_nritems(leaf)) {
ret = btrfs_next_leaf(root, path);