Commit dabdb640 authored by Josef Bacik's avatar Josef Bacik

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: default avatarJosef Bacik <josef@redhat.com>
parent 6ab60601
...@@ -774,9 +774,6 @@ struct btrfs_block_rsv { ...@@ -774,9 +774,6 @@ struct btrfs_block_rsv {
u64 reserved; u64 reserved;
struct btrfs_space_info *space_info; struct btrfs_space_info *space_info;
spinlock_t lock; spinlock_t lock;
atomic_t usage;
unsigned int priority:8;
unsigned int refill_used:1;
unsigned int full:1; unsigned int full:1;
}; };
......
...@@ -3659,8 +3659,6 @@ void btrfs_init_block_rsv(struct btrfs_block_rsv *rsv) ...@@ -3659,8 +3659,6 @@ void btrfs_init_block_rsv(struct btrfs_block_rsv *rsv)
{ {
memset(rsv, 0, sizeof(*rsv)); memset(rsv, 0, sizeof(*rsv));
spin_lock_init(&rsv->lock); spin_lock_init(&rsv->lock);
atomic_set(&rsv->usage, 1);
rsv->priority = 6;
} }
struct btrfs_block_rsv *btrfs_alloc_block_rsv(struct btrfs_root *root) struct 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) ...@@ -3681,10 +3679,8 @@ struct btrfs_block_rsv *btrfs_alloc_block_rsv(struct btrfs_root *root)
void btrfs_free_block_rsv(struct btrfs_root *root, void btrfs_free_block_rsv(struct btrfs_root *root,
struct btrfs_block_rsv *rsv) struct btrfs_block_rsv *rsv)
{ {
if (rsv && atomic_dec_and_test(&rsv->usage)) { btrfs_block_rsv_release(root, rsv, (u64)-1);
btrfs_block_rsv_release(root, rsv, (u64)-1); kfree(rsv);
kfree(rsv);
}
} }
int btrfs_block_rsv_add(struct btrfs_trans_handle *trans, int btrfs_block_rsv_add(struct btrfs_trans_handle *trans,
...@@ -3734,13 +3730,10 @@ int btrfs_block_rsv_check(struct btrfs_trans_handle *trans, ...@@ -3734,13 +3730,10 @@ int btrfs_block_rsv_check(struct btrfs_trans_handle *trans,
if (!ret) if (!ret)
return 0; return 0;
if (block_rsv->refill_used) { ret = reserve_metadata_bytes(trans, root, block_rsv, num_bytes, 0);
ret = reserve_metadata_bytes(trans, root, block_rsv, if (!ret) {
num_bytes, 0); block_rsv_add_bytes(block_rsv, num_bytes, 0);
if (!ret) { return 0;
block_rsv_add_bytes(block_rsv, num_bytes, 0);
return 0;
}
} }
if (commit_trans) { if (commit_trans) {
...@@ -3859,16 +3852,12 @@ static void init_global_block_rsv(struct btrfs_fs_info *fs_info) ...@@ -3859,16 +3852,12 @@ static void init_global_block_rsv(struct btrfs_fs_info *fs_info)
space_info = __find_space_info(fs_info, BTRFS_BLOCK_GROUP_SYSTEM); space_info = __find_space_info(fs_info, BTRFS_BLOCK_GROUP_SYSTEM);
fs_info->chunk_block_rsv.space_info = space_info; fs_info->chunk_block_rsv.space_info = space_info;
fs_info->chunk_block_rsv.priority = 10;
space_info = __find_space_info(fs_info, BTRFS_BLOCK_GROUP_METADATA); space_info = __find_space_info(fs_info, BTRFS_BLOCK_GROUP_METADATA);
fs_info->global_block_rsv.space_info = space_info; fs_info->global_block_rsv.space_info = space_info;
fs_info->global_block_rsv.priority = 10;
fs_info->global_block_rsv.refill_used = 1;
fs_info->delalloc_block_rsv.space_info = space_info; fs_info->delalloc_block_rsv.space_info = space_info;
fs_info->trans_block_rsv.space_info = space_info; fs_info->trans_block_rsv.space_info = space_info;
fs_info->empty_block_rsv.space_info = space_info; fs_info->empty_block_rsv.space_info = space_info;
fs_info->empty_block_rsv.priority = 10;
fs_info->extent_root->block_rsv = &fs_info->global_block_rsv; fs_info->extent_root->block_rsv = &fs_info->global_block_rsv;
fs_info->csum_root->block_rsv = &fs_info->global_block_rsv; fs_info->csum_root->block_rsv = &fs_info->global_block_rsv;
......
...@@ -3650,8 +3650,6 @@ int prepare_to_relocate(struct reloc_control *rc) ...@@ -3650,8 +3650,6 @@ int prepare_to_relocate(struct reloc_control *rc)
if (ret) if (ret)
return ret; return ret;
rc->block_rsv->refill_used = 1;
memset(&rc->cluster, 0, sizeof(rc->cluster)); memset(&rc->cluster, 0, sizeof(rc->cluster));
rc->search_start = rc->block_group->key.objectid; rc->search_start = rc->block_group->key.objectid;
rc->extents_found = 0; rc->extents_found = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment