aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2011-08-08 12:50:18 -0400
committerJosef Bacik <josef@redhat.com>2011-10-19 15:12:34 -0400
commitdabdb6408cb801644fa613c7432da012640b348c (patch)
tree846978b48af90315b14bf984d0b0a55a962eff6b /fs/btrfs/extent-tree.c
parent6ab60601d518d563ca1a47eaa399096e69d3b64a (diff)
Btrfs: kill unused parts of block_rsv
The priority and refill_used flags are not used anymore, and neither is the usage counter, so just remove them from btrfs_block_rsv. Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 30c0558eae84..5395cc639270 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3659,8 +3659,6 @@ void btrfs_init_block_rsv(struct btrfs_block_rsv *rsv)
3659{ 3659{
3660 memset(rsv, 0, sizeof(*rsv)); 3660 memset(rsv, 0, sizeof(*rsv));
3661 spin_lock_init(&rsv->lock); 3661 spin_lock_init(&rsv->lock);
3662 atomic_set(&rsv->usage, 1);
3663 rsv->priority = 6;
3664} 3662}
3665 3663
3666struct btrfs_block_rsv *btrfs_alloc_block_rsv(struct btrfs_root *root) 3664struct btrfs_block_rsv *btrfs_alloc_block_rsv(struct btrfs_root *root)
@@ -3681,10 +3679,8 @@ struct btrfs_block_rsv *btrfs_alloc_block_rsv(struct btrfs_root *root)
3681void btrfs_free_block_rsv(struct btrfs_root *root, 3679void btrfs_free_block_rsv(struct btrfs_root *root,
3682 struct btrfs_block_rsv *rsv) 3680 struct btrfs_block_rsv *rsv)
3683{ 3681{
3684 if (rsv && atomic_dec_and_test(&rsv->usage)) { 3682 btrfs_block_rsv_release(root, rsv, (u64)-1);
3685 btrfs_block_rsv_release(root, rsv, (u64)-1); 3683 kfree(rsv);
3686 kfree(rsv);
3687 }
3688} 3684}
3689 3685
3690int btrfs_block_rsv_add(struct btrfs_trans_handle *trans, 3686int btrfs_block_rsv_add(struct btrfs_trans_handle *trans,
@@ -3734,13 +3730,10 @@ int btrfs_block_rsv_check(struct btrfs_trans_handle *trans,
3734 if (!ret) 3730 if (!ret)
3735 return 0; 3731 return 0;
3736 3732
3737 if (block_rsv->refill_used) { 3733 ret = reserve_metadata_bytes(trans, root, block_rsv, num_bytes, 0);
3738 ret = reserve_metadata_bytes(trans, root, block_rsv, 3734 if (!ret) {
3739 num_bytes, 0); 3735 block_rsv_add_bytes(block_rsv, num_bytes, 0);
3740 if (!ret) { 3736 return 0;
3741 block_rsv_add_bytes(block_rsv, num_bytes, 0);
3742 return 0;
3743 }
3744 } 3737 }
3745 3738
3746 if (commit_trans) { 3739 if (commit_trans) {
@@ -3859,16 +3852,12 @@ static void init_global_block_rsv(struct btrfs_fs_info *fs_info)
3859 3852
3860 space_info = __find_space_info(fs_info, BTRFS_BLOCK_GROUP_SYSTEM); 3853 space_info = __find_space_info(fs_info, BTRFS_BLOCK_GROUP_SYSTEM);
3861 fs_info->chunk_block_rsv.space_info = space_info; 3854 fs_info->chunk_block_rsv.space_info = space_info;
3862 fs_info->chunk_block_rsv.priority = 10;
3863 3855
3864 space_info = __find_space_info(fs_info, BTRFS_BLOCK_GROUP_METADATA); 3856 space_info = __find_space_info(fs_info, BTRFS_BLOCK_GROUP_METADATA);
3865 fs_info->global_block_rsv.space_info = space_info; 3857 fs_info->global_block_rsv.space_info = space_info;
3866 fs_info->global_block_rsv.priority = 10;
3867 fs_info->global_block_rsv.refill_used = 1;
3868 fs_info->delalloc_block_rsv.space_info = space_info; 3858 fs_info->delalloc_block_rsv.space_info = space_info;
3869 fs_info->trans_block_rsv.space_info = space_info; 3859 fs_info->trans_block_rsv.space_info = space_info;
3870 fs_info->empty_block_rsv.space_info = space_info; 3860 fs_info->empty_block_rsv.space_info = space_info;
3871 fs_info->empty_block_rsv.priority = 10;
3872 3861
3873 fs_info->extent_root->block_rsv = &fs_info->global_block_rsv; 3862 fs_info->extent_root->block_rsv = &fs_info->global_block_rsv;
3874 fs_info->csum_root->block_rsv = &fs_info->global_block_rsv; 3863 fs_info->csum_root->block_rsv = &fs_info->global_block_rsv;