Commit 26b8003f authored by Chris Mason's avatar Chris Mason Committed by David Woodhouse

Btrfs: Replace extent tree preallocation code with some bit radix magic.

Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent f4468e94
......@@ -299,12 +299,7 @@ struct btrfs_fs_info {
struct radix_tree_root block_group_radix;
struct radix_tree_root block_group_data_radix;
struct radix_tree_root extent_map_radix;
u64 extent_tree_insert[BTRFS_MAX_LEVEL * 6];
int extent_tree_insert_nr;
u64 extent_tree_prealloc[BTRFS_MAX_LEVEL * 6];
int extent_tree_prealloc_nr;
struct radix_tree_root extent_ins_radix;
u64 generation;
struct btrfs_transaction *running_transaction;
struct btrfs_super_block *disk_super;
......
......@@ -427,6 +427,7 @@ struct btrfs_root *open_ctree(struct super_block *sb)
init_bit_radix(&fs_info->pinned_radix);
init_bit_radix(&fs_info->pending_del_radix);
init_bit_radix(&fs_info->extent_map_radix);
init_bit_radix(&fs_info->extent_ins_radix);
INIT_RADIX_TREE(&fs_info->fs_roots_radix, GFP_NOFS);
INIT_RADIX_TREE(&fs_info->block_group_radix, GFP_KERNEL);
INIT_RADIX_TREE(&fs_info->block_group_data_radix, GFP_KERNEL);
......@@ -443,8 +444,6 @@ struct btrfs_root *open_ctree(struct super_block *sb)
fs_info->btree_inode->i_size = sb->s_bdev->bd_inode->i_size;
fs_info->btree_inode->i_mapping->a_ops = &btree_aops;
fs_info->do_barriers = 1;
fs_info->extent_tree_insert_nr = 0;
fs_info->extent_tree_prealloc_nr = 0;
fs_info->closing = 0;
INIT_DELAYED_WORK(&fs_info->trans_work, btrfs_transaction_cleaner);
......
This diff is collapsed.
......@@ -109,6 +109,8 @@ struct btrfs_trans_handle *btrfs_start_transaction(struct btrfs_root *root,
h->blocks_reserved = num_blocks;
h->blocks_used = 0;
h->block_group = NULL;
h->alloc_exclude_nr = 0;
h->alloc_exclude_start = 0;
root->fs_info->running_transaction->use_count++;
mutex_unlock(&root->fs_info->trans_mutex);
return h;
......
......@@ -39,6 +39,8 @@ struct btrfs_trans_handle {
unsigned long blocks_used;
struct btrfs_transaction *transaction;
struct btrfs_block_group_cache *block_group;
u64 alloc_exclude_start;
u64 alloc_exclude_nr;
};
......
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