aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2014-02-27 21:46:12 -0500
committerJosef Bacik <jbacik@fb.com>2014-03-10 15:17:10 -0400
commite66f0bb14465371d4c86fa70cff2acc331efa1fb (patch)
tree90a1d4009e0a486ccf60361d48eaa7a9335d84a1
parentd05a33ac265c62d4be35788dd978b2665033f077 (diff)
btrfs: Replace fs_info->cache_workers workqueue with btrfs_workqueue.
Replace the fs_info->cache_workers with the newly created btrfs_workqueue. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Tested-by: David Sterba <dsterba@suse.cz> Signed-off-by: Josef Bacik <jbacik@fb.com>
-rw-r--r--fs/btrfs/ctree.h4
-rw-r--r--fs/btrfs/disk-io.c10
-rw-r--r--fs/btrfs/extent-tree.c6
-rw-r--r--fs/btrfs/super.c2
4 files changed, 11 insertions, 11 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 8102fcd8f1fe..e5c94cbaa3fa 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -1221,7 +1221,7 @@ struct btrfs_caching_control {
1221 struct list_head list; 1221 struct list_head list;
1222 struct mutex mutex; 1222 struct mutex mutex;
1223 wait_queue_head_t wait; 1223 wait_queue_head_t wait;
1224 struct btrfs_work work; 1224 struct btrfs_work_struct work;
1225 struct btrfs_block_group_cache *block_group; 1225 struct btrfs_block_group_cache *block_group;
1226 u64 progress; 1226 u64 progress;
1227 atomic_t count; 1227 atomic_t count;
@@ -1516,7 +1516,7 @@ struct btrfs_fs_info {
1516 struct btrfs_workqueue_struct *endio_write_workers; 1516 struct btrfs_workqueue_struct *endio_write_workers;
1517 struct btrfs_workqueue_struct *endio_freespace_worker; 1517 struct btrfs_workqueue_struct *endio_freespace_worker;
1518 struct btrfs_workqueue_struct *submit_workers; 1518 struct btrfs_workqueue_struct *submit_workers;
1519 struct btrfs_workers caching_workers; 1519 struct btrfs_workqueue_struct *caching_workers;
1520 struct btrfs_workers readahead_workers; 1520 struct btrfs_workers readahead_workers;
1521 1521
1522 /* 1522 /*
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 5f12806e96e8..9c14e3bd078c 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2007,7 +2007,7 @@ static void btrfs_stop_all_workers(struct btrfs_fs_info *fs_info)
2007 btrfs_destroy_workqueue(fs_info->endio_freespace_worker); 2007 btrfs_destroy_workqueue(fs_info->endio_freespace_worker);
2008 btrfs_destroy_workqueue(fs_info->submit_workers); 2008 btrfs_destroy_workqueue(fs_info->submit_workers);
2009 btrfs_stop_workers(&fs_info->delayed_workers); 2009 btrfs_stop_workers(&fs_info->delayed_workers);
2010 btrfs_stop_workers(&fs_info->caching_workers); 2010 btrfs_destroy_workqueue(fs_info->caching_workers);
2011 btrfs_stop_workers(&fs_info->readahead_workers); 2011 btrfs_stop_workers(&fs_info->readahead_workers);
2012 btrfs_destroy_workqueue(fs_info->flush_workers); 2012 btrfs_destroy_workqueue(fs_info->flush_workers);
2013 btrfs_stop_workers(&fs_info->qgroup_rescan_workers); 2013 btrfs_stop_workers(&fs_info->qgroup_rescan_workers);
@@ -2485,8 +2485,8 @@ int open_ctree(struct super_block *sb,
2485 fs_info->flush_workers = 2485 fs_info->flush_workers =
2486 btrfs_alloc_workqueue("flush_delalloc", flags, max_active, 0); 2486 btrfs_alloc_workqueue("flush_delalloc", flags, max_active, 0);
2487 2487
2488 btrfs_init_workers(&fs_info->caching_workers, "cache", 2488 fs_info->caching_workers =
2489 fs_info->thread_pool_size, NULL); 2489 btrfs_alloc_workqueue("cache", flags, max_active, 0);
2490 2490
2491 /* 2491 /*
2492 * a higher idle thresh on the submit workers makes it much more 2492 * a higher idle thresh on the submit workers makes it much more
@@ -2537,7 +2537,6 @@ int open_ctree(struct super_block *sb,
2537 ret = btrfs_start_workers(&fs_info->generic_worker); 2537 ret = btrfs_start_workers(&fs_info->generic_worker);
2538 ret |= btrfs_start_workers(&fs_info->fixup_workers); 2538 ret |= btrfs_start_workers(&fs_info->fixup_workers);
2539 ret |= btrfs_start_workers(&fs_info->delayed_workers); 2539 ret |= btrfs_start_workers(&fs_info->delayed_workers);
2540 ret |= btrfs_start_workers(&fs_info->caching_workers);
2541 ret |= btrfs_start_workers(&fs_info->readahead_workers); 2540 ret |= btrfs_start_workers(&fs_info->readahead_workers);
2542 ret |= btrfs_start_workers(&fs_info->qgroup_rescan_workers); 2541 ret |= btrfs_start_workers(&fs_info->qgroup_rescan_workers);
2543 if (ret) { 2542 if (ret) {
@@ -2549,7 +2548,8 @@ int open_ctree(struct super_block *sb,
2549 fs_info->endio_workers && fs_info->endio_meta_workers && 2548 fs_info->endio_workers && fs_info->endio_meta_workers &&
2550 fs_info->endio_meta_write_workers && 2549 fs_info->endio_meta_write_workers &&
2551 fs_info->endio_write_workers && fs_info->endio_raid56_workers && 2550 fs_info->endio_write_workers && fs_info->endio_raid56_workers &&
2552 fs_info->endio_freespace_worker && fs_info->rmw_workers)) { 2551 fs_info->endio_freespace_worker && fs_info->rmw_workers &&
2552 fs_info->caching_workers)) {
2553 err = -ENOMEM; 2553 err = -ENOMEM;
2554 goto fail_sb_buffer; 2554 goto fail_sb_buffer;
2555 } 2555 }
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 32312e09f0f5..bb58082f6d61 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -378,7 +378,7 @@ static u64 add_new_free_space(struct btrfs_block_group_cache *block_group,
378 return total_added; 378 return total_added;
379} 379}
380 380
381static noinline void caching_thread(struct btrfs_work *work) 381static noinline void caching_thread(struct btrfs_work_struct *work)
382{ 382{
383 struct btrfs_block_group_cache *block_group; 383 struct btrfs_block_group_cache *block_group;
384 struct btrfs_fs_info *fs_info; 384 struct btrfs_fs_info *fs_info;
@@ -549,7 +549,7 @@ static int cache_block_group(struct btrfs_block_group_cache *cache,
549 caching_ctl->block_group = cache; 549 caching_ctl->block_group = cache;
550 caching_ctl->progress = cache->key.objectid; 550 caching_ctl->progress = cache->key.objectid;
551 atomic_set(&caching_ctl->count, 1); 551 atomic_set(&caching_ctl->count, 1);
552 caching_ctl->work.func = caching_thread; 552 btrfs_init_work(&caching_ctl->work, caching_thread, NULL, NULL);
553 553
554 spin_lock(&cache->lock); 554 spin_lock(&cache->lock);
555 /* 555 /*
@@ -640,7 +640,7 @@ static int cache_block_group(struct btrfs_block_group_cache *cache,
640 640
641 btrfs_get_block_group(cache); 641 btrfs_get_block_group(cache);
642 642
643 btrfs_queue_worker(&fs_info->caching_workers, &caching_ctl->work); 643 btrfs_queue_work(fs_info->caching_workers, &caching_ctl->work);
644 644
645 return ret; 645 return ret;
646} 646}
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index d95d98d3e72c..b84fbe04f05a 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1327,7 +1327,7 @@ static void btrfs_resize_thread_pool(struct btrfs_fs_info *fs_info,
1327 btrfs_workqueue_set_max(fs_info->workers, new_pool_size); 1327 btrfs_workqueue_set_max(fs_info->workers, new_pool_size);
1328 btrfs_workqueue_set_max(fs_info->delalloc_workers, new_pool_size); 1328 btrfs_workqueue_set_max(fs_info->delalloc_workers, new_pool_size);
1329 btrfs_workqueue_set_max(fs_info->submit_workers, new_pool_size); 1329 btrfs_workqueue_set_max(fs_info->submit_workers, new_pool_size);
1330 btrfs_set_max_workers(&fs_info->caching_workers, new_pool_size); 1330 btrfs_workqueue_set_max(fs_info->caching_workers, new_pool_size);
1331 btrfs_set_max_workers(&fs_info->fixup_workers, new_pool_size); 1331 btrfs_set_max_workers(&fs_info->fixup_workers, new_pool_size);
1332 btrfs_workqueue_set_max(fs_info->endio_workers, new_pool_size); 1332 btrfs_workqueue_set_max(fs_info->endio_workers, new_pool_size);
1333 btrfs_workqueue_set_max(fs_info->endio_meta_workers, new_pool_size); 1333 btrfs_workqueue_set_max(fs_info->endio_meta_workers, new_pool_size);