summaryrefslogtreecommitdiff
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2020-01-24 09:32:53 -0500
committerDavid Sterba <dsterba@suse.com>2020-03-23 17:01:32 +0100
commit0d4b0463011de06288d8ca80a873a97a7d99a948 (patch)
tree30a99f6d2f16c5d9e652265e1a66a8f2b33ce8e0 /fs/btrfs/disk-io.c
parentfbb0ce40d6064e731b5976f10e91ce7b9683df1f (diff)
btrfs: export and rename free_fs_info
We're going to start freeing roots and doing other complicated things in free_fs_info, so we need to move it to disk-io.c and export it in order to use things lik btrfs_put_fs_root(). Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 43af9f9b8583..ce36a4b9c8a3 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1523,6 +1523,24 @@ int btrfs_insert_fs_root(struct btrfs_fs_info *fs_info,
return ret;
}
+void btrfs_free_fs_info(struct btrfs_fs_info *fs_info)
+{
+ kfree(fs_info->balance_ctl);
+ kfree(fs_info->delayed_root);
+ kfree(fs_info->extent_root);
+ kfree(fs_info->tree_root);
+ kfree(fs_info->chunk_root);
+ kfree(fs_info->dev_root);
+ kfree(fs_info->csum_root);
+ kfree(fs_info->quota_root);
+ kfree(fs_info->uuid_root);
+ kfree(fs_info->free_space_root);
+ kfree(fs_info->super_copy);
+ kfree(fs_info->super_for_commit);
+ kvfree(fs_info);
+}
+
+
struct btrfs_root *btrfs_get_fs_root(struct btrfs_fs_info *fs_info,
struct btrfs_key *location,
bool check_ref)