aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorMiao Xie <miaox@cn.fujitsu.com>2012-10-25 05:28:04 -0400
committerJosef Bacik <jbacik@fusionio.com>2012-12-11 13:31:37 -0500
commit8ccf6f19b67f7e0921063cc309f4672a6afcb528 (patch)
tree98cd76ca5dd2e7c93adc1bd363fefaa803acc824 /fs/btrfs/disk-io.c
parent7b398f8e58c415738e397645c926253c428cf002 (diff)
Btrfs: make delalloc inodes be flushed by multi-task
This patch introduce a new worker pool named "flush_workers", and if we want to force all the inode with pending delalloc to the disks, we can queue those inodes into the work queue of the worker pool, in this way, those inodes will be flushed by multi-task. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 7cda51995c1e..bd70c2852ba0 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2279,6 +2279,10 @@ int open_ctree(struct super_block *sb,
2279 fs_info->thread_pool_size, 2279 fs_info->thread_pool_size,
2280 &fs_info->generic_worker); 2280 &fs_info->generic_worker);
2281 2281
2282 btrfs_init_workers(&fs_info->flush_workers, "flush_delalloc",
2283 fs_info->thread_pool_size,
2284 &fs_info->generic_worker);
2285
2282 btrfs_init_workers(&fs_info->submit_workers, "submit", 2286 btrfs_init_workers(&fs_info->submit_workers, "submit",
2283 min_t(u64, fs_devices->num_devices, 2287 min_t(u64, fs_devices->num_devices,
2284 fs_info->thread_pool_size), 2288 fs_info->thread_pool_size),
@@ -2350,6 +2354,7 @@ int open_ctree(struct super_block *sb,
2350 ret |= btrfs_start_workers(&fs_info->delayed_workers); 2354 ret |= btrfs_start_workers(&fs_info->delayed_workers);
2351 ret |= btrfs_start_workers(&fs_info->caching_workers); 2355 ret |= btrfs_start_workers(&fs_info->caching_workers);
2352 ret |= btrfs_start_workers(&fs_info->readahead_workers); 2356 ret |= btrfs_start_workers(&fs_info->readahead_workers);
2357 ret |= btrfs_start_workers(&fs_info->flush_workers);
2353 if (ret) { 2358 if (ret) {
2354 err = -ENOMEM; 2359 err = -ENOMEM;
2355 goto fail_sb_buffer; 2360 goto fail_sb_buffer;
@@ -2667,6 +2672,7 @@ fail_sb_buffer:
2667 btrfs_stop_workers(&fs_info->submit_workers); 2672 btrfs_stop_workers(&fs_info->submit_workers);
2668 btrfs_stop_workers(&fs_info->delayed_workers); 2673 btrfs_stop_workers(&fs_info->delayed_workers);
2669 btrfs_stop_workers(&fs_info->caching_workers); 2674 btrfs_stop_workers(&fs_info->caching_workers);
2675 btrfs_stop_workers(&fs_info->flush_workers);
2670fail_alloc: 2676fail_alloc:
2671fail_iput: 2677fail_iput:
2672 btrfs_mapping_tree_free(&fs_info->mapping_tree); 2678 btrfs_mapping_tree_free(&fs_info->mapping_tree);
@@ -3339,6 +3345,7 @@ int close_ctree(struct btrfs_root *root)
3339 btrfs_stop_workers(&fs_info->delayed_workers); 3345 btrfs_stop_workers(&fs_info->delayed_workers);
3340 btrfs_stop_workers(&fs_info->caching_workers); 3346 btrfs_stop_workers(&fs_info->caching_workers);
3341 btrfs_stop_workers(&fs_info->readahead_workers); 3347 btrfs_stop_workers(&fs_info->readahead_workers);
3348 btrfs_stop_workers(&fs_info->flush_workers);
3342 3349
3343#ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY 3350#ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY
3344 if (btrfs_test_opt(root, CHECK_INTEGRITY)) 3351 if (btrfs_test_opt(root, CHECK_INTEGRITY))