Skip to content

Commit dc6e320

Browse files
Qu WenruoJosef Bacik
authored andcommitted
btrfs: Replace fs_info->fixup_workers workqueue with btrfs_workqueue.
Replace the fs_info->fixup_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>
1 parent 736cfa1 commit dc6e320

4 files changed

Lines changed: 10 additions & 11 deletions

File tree

‎fs/btrfs/ctree.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1524,7 +1524,7 @@ struct btrfs_fs_info {
15241524
* the cow mechanism and make them safe to write. It happens
15251525
* for the sys_munmap function call path
15261526
*/
1527-
struct btrfs_workers fixup_workers;
1527+
struct btrfs_workqueue_struct *fixup_workers;
15281528
struct btrfs_workers delayed_workers;
15291529
struct task_struct *transaction_kthread;
15301530
struct task_struct *cleaner_kthread;

‎fs/btrfs/disk-io.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,7 +1995,7 @@ static noinline int next_root_backup(struct btrfs_fs_info *info,
19951995
static void btrfs_stop_all_workers(struct btrfs_fs_info *fs_info)
19961996
{
19971997
btrfs_stop_workers(&fs_info->generic_worker);
1998-
btrfs_stop_workers(&fs_info->fixup_workers);
1998+
btrfs_destroy_workqueue(fs_info->fixup_workers);
19991999
btrfs_destroy_workqueue(fs_info->delalloc_workers);
20002000
btrfs_destroy_workqueue(fs_info->workers);
20012001
btrfs_destroy_workqueue(fs_info->endio_workers);
@@ -2498,8 +2498,8 @@ int open_ctree(struct super_block *sb,
24982498
min_t(u64, fs_devices->num_devices,
24992499
max_active), 64);
25002500

2501-
btrfs_init_workers(&fs_info->fixup_workers, "fixup", 1,
2502-
&fs_info->generic_worker);
2501+
fs_info->fixup_workers =
2502+
btrfs_alloc_workqueue("fixup", flags, 1, 0);
25032503

25042504
/*
25052505
* endios are largely parallel and should have a very
@@ -2532,7 +2532,6 @@ int open_ctree(struct super_block *sb,
25322532
* return -ENOMEM if any of these fail.
25332533
*/
25342534
ret = btrfs_start_workers(&fs_info->generic_worker);
2535-
ret |= btrfs_start_workers(&fs_info->fixup_workers);
25362535
ret |= btrfs_start_workers(&fs_info->delayed_workers);
25372536
ret |= btrfs_start_workers(&fs_info->qgroup_rescan_workers);
25382537
if (ret) {
@@ -2545,7 +2544,8 @@ int open_ctree(struct super_block *sb,
25452544
fs_info->endio_meta_write_workers &&
25462545
fs_info->endio_write_workers && fs_info->endio_raid56_workers &&
25472546
fs_info->endio_freespace_worker && fs_info->rmw_workers &&
2548-
fs_info->caching_workers && fs_info->readahead_workers)) {
2547+
fs_info->caching_workers && fs_info->readahead_workers &&
2548+
fs_info->fixup_workers)) {
25492549
err = -ENOMEM;
25502550
goto fail_sb_buffer;
25512551
}

‎fs/btrfs/inode.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1748,10 +1748,10 @@ int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end,
17481748
/* see btrfs_writepage_start_hook for details on why this is required */
17491749
struct btrfs_writepage_fixup {
17501750
struct page *page;
1751-
struct btrfs_work work;
1751+
struct btrfs_work_struct work;
17521752
};
17531753

1754-
static void btrfs_writepage_fixup_worker(struct btrfs_work *work)
1754+
static void btrfs_writepage_fixup_worker(struct btrfs_work_struct *work)
17551755
{
17561756
struct btrfs_writepage_fixup *fixup;
17571757
struct btrfs_ordered_extent *ordered;
@@ -1842,9 +1842,9 @@ static int btrfs_writepage_start_hook(struct page *page, u64 start, u64 end)
18421842

18431843
SetPageChecked(page);
18441844
page_cache_get(page);
1845-
fixup->work.func = btrfs_writepage_fixup_worker;
1845+
btrfs_init_work(&fixup->work, btrfs_writepage_fixup_worker, NULL, NULL);
18461846
fixup->page = page;
1847-
btrfs_queue_worker(&root->fs_info->fixup_workers, &fixup->work);
1847+
btrfs_queue_work(root->fs_info->fixup_workers, &fixup->work);
18481848
return -EBUSY;
18491849
}
18501850

‎fs/btrfs/super.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,6 @@ static void btrfs_resize_thread_pool(struct btrfs_fs_info *fs_info,
13281328
btrfs_workqueue_set_max(fs_info->delalloc_workers, new_pool_size);
13291329
btrfs_workqueue_set_max(fs_info->submit_workers, new_pool_size);
13301330
btrfs_workqueue_set_max(fs_info->caching_workers, new_pool_size);
1331-
btrfs_set_max_workers(&fs_info->fixup_workers, new_pool_size);
13321331
btrfs_workqueue_set_max(fs_info->endio_workers, new_pool_size);
13331332
btrfs_workqueue_set_max(fs_info->endio_meta_workers, new_pool_size);
13341333
btrfs_workqueue_set_max(fs_info->endio_meta_write_workers,

0 commit comments

Comments
 (0)