Skip to content

Commit be283b2

Browse files
Liu BoJosef Bacik
authored andcommitted
Btrfs: use helper to cleanup tree roots
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>
1 parent b049668 commit be283b2

1 file changed

Lines changed: 1 addition & 14 deletions

File tree

fs/btrfs/disk-io.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3426,20 +3426,7 @@ int close_ctree(struct btrfs_root *root)
34263426
percpu_counter_sum(&fs_info->delalloc_bytes));
34273427
}
34283428

3429-
free_extent_buffer(fs_info->extent_root->node);
3430-
free_extent_buffer(fs_info->extent_root->commit_root);
3431-
free_extent_buffer(fs_info->tree_root->node);
3432-
free_extent_buffer(fs_info->tree_root->commit_root);
3433-
free_extent_buffer(fs_info->chunk_root->node);
3434-
free_extent_buffer(fs_info->chunk_root->commit_root);
3435-
free_extent_buffer(fs_info->dev_root->node);
3436-
free_extent_buffer(fs_info->dev_root->commit_root);
3437-
free_extent_buffer(fs_info->csum_root->node);
3438-
free_extent_buffer(fs_info->csum_root->commit_root);
3439-
if (fs_info->quota_root) {
3440-
free_extent_buffer(fs_info->quota_root->node);
3441-
free_extent_buffer(fs_info->quota_root->commit_root);
3442-
}
3429+
free_root_pointers(fs_info, 1);
34433430

34443431
btrfs_free_block_groups(fs_info);
34453432

0 commit comments

Comments
 (0)