summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 76b888728540..5be61619c71b 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1297,7 +1297,7 @@ fail:
free_extent_buffer(root->commit_root);
free_extent_buffer(leaf);
}
- kfree(root);
+ btrfs_put_fs_root(root);
return ERR_PTR(ret);
}
@@ -1328,7 +1328,7 @@ static struct btrfs_root *alloc_log_tree(struct btrfs_trans_handle *trans,
leaf = btrfs_alloc_tree_block(trans, root, 0, BTRFS_TREE_LOG_OBJECTID,
NULL, 0, 0, 0);
if (IS_ERR(leaf)) {
- kfree(root);
+ btrfs_put_fs_root(root);
return ERR_CAST(leaf);
}
@@ -1431,7 +1431,7 @@ out:
return root;
find_fail:
- kfree(root);
+ btrfs_put_fs_root(root);
alloc_fail:
root = ERR_PTR(ret);
goto out;
@@ -1527,17 +1527,17 @@ 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);
+ btrfs_put_fs_root(fs_info->extent_root);
+ btrfs_put_fs_root(fs_info->tree_root);
+ btrfs_put_fs_root(fs_info->chunk_root);
+ btrfs_put_fs_root(fs_info->dev_root);
+ btrfs_put_fs_root(fs_info->csum_root);
+ btrfs_put_fs_root(fs_info->quota_root);
+ btrfs_put_fs_root(fs_info->uuid_root);
+ btrfs_put_fs_root(fs_info->free_space_root);
+ btrfs_put_fs_root(fs_info->fs_root);
kfree(fs_info->super_copy);
kfree(fs_info->super_for_commit);
- btrfs_put_fs_root(fs_info->fs_root);
kvfree(fs_info);
}
@@ -2223,12 +2223,12 @@ static int btrfs_replay_log(struct btrfs_fs_info *fs_info,
if (IS_ERR(log_tree_root->node)) {
btrfs_warn(fs_info, "failed to read log tree");
ret = PTR_ERR(log_tree_root->node);
- kfree(log_tree_root);
+ btrfs_put_fs_root(log_tree_root);
return ret;
} else if (!extent_buffer_uptodate(log_tree_root->node)) {
btrfs_err(fs_info, "failed to read log tree");
free_extent_buffer(log_tree_root->node);
- kfree(log_tree_root);
+ btrfs_put_fs_root(log_tree_root);
return -EIO;
}
/* returns with log_tree_root freed on success */
@@ -2237,7 +2237,7 @@ static int btrfs_replay_log(struct btrfs_fs_info *fs_info,
btrfs_handle_fs_error(fs_info, ret,
"Failed to recover log tree");
free_extent_buffer(log_tree_root->node);
- kfree(log_tree_root);
+ btrfs_put_fs_root(log_tree_root);
return ret;
}