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 <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: Josef Bacik <[email protected]>
1 parent b049668 commit be283b2

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

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)