diff options
author | Miao Xie <miaox@cn.fujitsu.com> | 2012-09-06 06:02:28 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2012-10-01 15:19:11 -0400 |
commit | 66d8f3dd1c87813d7f1cf8b774cb03e9b8d7e87e (patch) | |
tree | 74d18d716f42e15958a9723ece4cd98dfdfd6a74 /fs/btrfs/disk-io.c | |
parent | 6352b91da1a2108bb8cc5115e8714f90d706f15f (diff) |
Btrfs: add a new "type" field into the block reservation structure
Sometimes we need choose the method of the reservation according to the type
of the block reservation, such as the reservation for the delayed inode update.
Now we identify the type just by comparing the address of the reservation
variants, it is very ugly if it is a temporary one because we need compare it
with all the common reservation variants. So we add a new "type" field to keep
the type the reservation variants.
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 22e98e04c2ea..0dcfb998229e 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -2014,12 +2014,15 @@ int open_ctree(struct super_block *sb, | |||
2014 | INIT_LIST_HEAD(&fs_info->space_info); | 2014 | INIT_LIST_HEAD(&fs_info->space_info); |
2015 | INIT_LIST_HEAD(&fs_info->tree_mod_seq_list); | 2015 | INIT_LIST_HEAD(&fs_info->tree_mod_seq_list); |
2016 | btrfs_mapping_init(&fs_info->mapping_tree); | 2016 | btrfs_mapping_init(&fs_info->mapping_tree); |
2017 | btrfs_init_block_rsv(&fs_info->global_block_rsv); | 2017 | btrfs_init_block_rsv(&fs_info->global_block_rsv, |
2018 | btrfs_init_block_rsv(&fs_info->delalloc_block_rsv); | 2018 | BTRFS_BLOCK_RSV_GLOBAL); |
2019 | btrfs_init_block_rsv(&fs_info->trans_block_rsv); | 2019 | btrfs_init_block_rsv(&fs_info->delalloc_block_rsv, |
2020 | btrfs_init_block_rsv(&fs_info->chunk_block_rsv); | 2020 | BTRFS_BLOCK_RSV_DELALLOC); |
2021 | btrfs_init_block_rsv(&fs_info->empty_block_rsv); | 2021 | btrfs_init_block_rsv(&fs_info->trans_block_rsv, BTRFS_BLOCK_RSV_TRANS); |
2022 | btrfs_init_block_rsv(&fs_info->delayed_block_rsv); | 2022 | btrfs_init_block_rsv(&fs_info->chunk_block_rsv, BTRFS_BLOCK_RSV_CHUNK); |
2023 | btrfs_init_block_rsv(&fs_info->empty_block_rsv, BTRFS_BLOCK_RSV_EMPTY); | ||
2024 | btrfs_init_block_rsv(&fs_info->delayed_block_rsv, | ||
2025 | BTRFS_BLOCK_RSV_DELOPS); | ||
2023 | atomic_set(&fs_info->nr_async_submits, 0); | 2026 | atomic_set(&fs_info->nr_async_submits, 0); |
2024 | atomic_set(&fs_info->async_delalloc_pages, 0); | 2027 | atomic_set(&fs_info->async_delalloc_pages, 0); |
2025 | atomic_set(&fs_info->async_submit_draining, 0); | 2028 | atomic_set(&fs_info->async_submit_draining, 0); |