btrfs-progs: free qgroup counts in btrfsck

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Mark Fasheh 2016-06-15 15:50:01 -07:00 committed by David Sterba
parent 49ec1413a7
commit 183995781f
3 changed files with 16 additions and 0 deletions

View File

@ -9890,6 +9890,7 @@ out:
(unsigned long long)data_bytes_allocated,
(unsigned long long)data_bytes_referenced);
free_qgroup_counts();
free_root_recs_tree(&root_cache);
close_out:
close_ctree(root);

View File

@ -1100,6 +1100,19 @@ int report_qgroups(int all)
return ret;
}
void free_qgroup_counts(void)
{
struct rb_node *node;
struct qgroup_count *c;
node = rb_first(&counts.root);
while (node) {
c = rb_entry(node, struct qgroup_count, rb_node);
node = rb_next(node);
rb_erase(&c->rb_node, &counts.root);
free(c);
}
}
int qgroup_verify_all(struct btrfs_fs_info *info)
{
int ret;

View File

@ -27,4 +27,6 @@ int report_qgroups(int all);
int print_extent_state(struct btrfs_fs_info *info, u64 subvol);
void free_qgroup_counts(void);
#endif