aboutsummaryrefslogtreecommitdiffstats
path: root/btrfs-image.c
diff options
context:
space:
mode:
authorGui Hecheng <guihc.fnst@cn.fujitsu.com>2014-06-19 09:46:00 +0800
committerDavid Sterba <dsterba@suse.cz>2014-08-22 14:43:10 +0200
commit16668ba6da72b9e90bdd0c89188db7137a861657 (patch)
tree8ac191e5c984da54735e2e62f7599ad5b1af9ebc /btrfs-image.c
parentc24c92f4aef407f6d2cb8fb6422e0f1f77ef8880 (diff)
downloadbtrfs-progs-16668ba6da72b9e90bdd0c89188db7137a861657.tar.gz
btrfs-progs-16668ba6da72b9e90bdd0c89188db7137a861657.tar.xz
btrfs-progs-16668ba6da72b9e90bdd0c89188db7137a861657.zip
btrfs-progs: cleanup duplicate assignment of variable leaf for btrfs-image
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 'btrfs-image.c')
-rw-r--r--btrfs-image.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/btrfs-image.c b/btrfs-image.c
index 98d765a..3ca3b40 100644
--- a/btrfs-image.c
+++ b/btrfs-image.c
@@ -1090,8 +1090,9 @@ static int copy_space_cache(struct btrfs_root *root,
return ret;
}
+ leaf = path->nodes[0];
+
while (1) {
- leaf = path->nodes[0];
if (path->slots[0] >= btrfs_header_nritems(leaf)) {
ret = btrfs_next_leaf(root, path);
if (ret < 0) {
@@ -1157,8 +1158,9 @@ static int copy_from_extent_tree(struct metadump_struct *metadump,
}
ret = 0;
+ leaf = path->nodes[0];
+
while (1) {
- leaf = path->nodes[0];
if (path->slots[0] >= btrfs_header_nritems(leaf)) {
ret = btrfs_next_leaf(extent_root, path);
if (ret < 0) {