Skip to content

Commit

Permalink
Btrfs: use helper to cleanup tree roots
Browse files Browse the repository at this point in the history
free_root_pointers() has been introduced to cleanup all of tree roots,
so just use it instead.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
  • Loading branch information
Liu Bo authored and Josef Bacik committed May 6, 2013
1 parent b049668 commit be283b2
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -3426,20 +3426,7 @@ int close_ctree(struct btrfs_root *root)
percpu_counter_sum(&fs_info->delalloc_bytes));
}

free_extent_buffer(fs_info->extent_root->node);
free_extent_buffer(fs_info->extent_root->commit_root);
free_extent_buffer(fs_info->tree_root->node);
free_extent_buffer(fs_info->tree_root->commit_root);
free_extent_buffer(fs_info->chunk_root->node);
free_extent_buffer(fs_info->chunk_root->commit_root);
free_extent_buffer(fs_info->dev_root->node);
free_extent_buffer(fs_info->dev_root->commit_root);
free_extent_buffer(fs_info->csum_root->node);
free_extent_buffer(fs_info->csum_root->commit_root);
if (fs_info->quota_root) {
free_extent_buffer(fs_info->quota_root->node);
free_extent_buffer(fs_info->quota_root->commit_root);
}
free_root_pointers(fs_info, 1);

btrfs_free_block_groups(fs_info);

Expand Down

0 comments on commit be283b2

Please sign in to comment.