summaryrefslogtreecommitdiff
path: root/image
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2017-10-20 01:04:55 +0200
committerDavid Sterba <dsterba@suse.com>2017-11-14 15:59:00 +0100
commit43f052a52f85b34ddd1e50981589343d09939f87 (patch)
tree7530214961a48a36c2254c789d23df6a78f650af /image
parent6e43cc2e97aee62dec65c073143e38f3f8cafae8 (diff)
btrfs-progs: image: pass rb_root to find_collisions
We don't need the full metadump structure, pass only the name tree. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'image')
-rw-r--r--image/main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/image/main.c b/image/main.c
index 2eede158..0806f6e4 100644
--- a/image/main.c
+++ b/image/main.c
@@ -446,7 +446,7 @@ static int find_collision_reverse_crc32c(struct name *val, u32 name_len)
return found;
}
-static char *find_collision(struct metadump_struct *md, char *name,
+static char *find_collision(struct rb_root *name_tree, char *name,
u32 name_len)
{
struct name *val;
@@ -457,7 +457,7 @@ static char *find_collision(struct metadump_struct *md, char *name,
tmp.val = name;
tmp.len = name_len;
- entry = tree_search(&md->name_tree, &tmp.n, name_cmp, 0);
+ entry = tree_search(name_tree, &tmp.n, name_cmp, 0);
if (entry) {
val = rb_entry(entry, struct name, n);
free(name);
@@ -498,7 +498,7 @@ static char *find_collision(struct metadump_struct *md, char *name,
}
}
- tree_insert(&md->name_tree, &val->n, name_cmp);
+ tree_insert(name_tree, &val->n, name_cmp);
return val->sub;
}
@@ -531,7 +531,7 @@ static void sanitize_dir_item(struct metadump_struct *md, struct extent_buffer *
return;
}
read_extent_buffer(eb, buf, name_ptr, name_len);
- garbage = find_collision(md, buf, name_len);
+ garbage = find_collision(&md->name_tree, buf, name_len);
} else {
garbage = generate_garbage(name_len);
}
@@ -585,7 +585,7 @@ static void sanitize_inode_ref(struct metadump_struct *md,
return;
}
read_extent_buffer(eb, buf, name_ptr, len);
- garbage = find_collision(md, buf, len);
+ garbage = find_collision(&md->name_tree, buf, len);
} else {
garbage = generate_garbage(len);
}