summaryrefslogtreecommitdiff
path: root/cmds-restore.c
diff options
context:
space:
mode:
authorGui Hecheng <guihc.fnst@cn.fujitsu.com>2014-08-21 10:56:52 +0800
committerDavid Sterba <dsterba@suse.cz>2014-12-04 18:51:51 +0100
commit103f68d7158fdab45cb3bd3c5b03e1ad75e332ae (patch)
treeb8cfcba03147be258f5c4724ec4fc62e52ae1039 /cmds-restore.c
parent0c753f13e95a22cacaf1471eca5236ca02ddb3a4 (diff)
downloadbtrfs-progs-103f68d7158fdab45cb3bd3c5b03e1ad75e332ae.tar.gz
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>
Diffstat (limited to 'cmds-restore.c')
-rw-r--r--cmds-restore.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmds-restore.c b/cmds-restore.c
index 2f9b72d..859deaf 100644
--- a/cmds-restore.c
+++ b/cmds-restore.c
@@ -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);