diff options
author | Jeff Mahoney <jeffm@suse.com> | 2016-06-09 16:22:11 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-07-26 07:53:15 -0400 |
commit | cb001095ca705dcd95f57fe98867e38a4889916d (patch) | |
tree | 14a4d7643bf5b4a436f085615fbafd2575a09108 /fs/btrfs/scrub.c | |
parent | 9f8d49095b86d3494ee184f6ede4a5b179d5dc5c (diff) |
btrfs: plumb fs_info into btrfs_work
In order to provide an fsid for trace events, we'll need a btrfs_fs_info
pointer. The most lightweight way to do that for btrfs_work structures
is to associate it with the __btrfs_workqueue structure. Each queued
btrfs_work structure has a workqueue associated with it, so that's
a natural fit. It's a privately defined structures, so we add accessors
to retrieve the fs_info pointer.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/scrub.c')
-rw-r--r-- | fs/btrfs/scrub.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index acfe72004646..68c8a09ae7e5 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c | |||
@@ -3781,27 +3781,27 @@ static noinline_for_stack int scrub_workers_get(struct btrfs_fs_info *fs_info, | |||
3781 | if (fs_info->scrub_workers_refcnt == 0) { | 3781 | if (fs_info->scrub_workers_refcnt == 0) { |
3782 | if (is_dev_replace) | 3782 | if (is_dev_replace) |
3783 | fs_info->scrub_workers = | 3783 | fs_info->scrub_workers = |
3784 | btrfs_alloc_workqueue("scrub", flags, | 3784 | btrfs_alloc_workqueue(fs_info, "scrub", flags, |
3785 | 1, 4); | 3785 | 1, 4); |
3786 | else | 3786 | else |
3787 | fs_info->scrub_workers = | 3787 | fs_info->scrub_workers = |
3788 | btrfs_alloc_workqueue("scrub", flags, | 3788 | btrfs_alloc_workqueue(fs_info, "scrub", flags, |
3789 | max_active, 4); | 3789 | max_active, 4); |
3790 | if (!fs_info->scrub_workers) | 3790 | if (!fs_info->scrub_workers) |
3791 | goto fail_scrub_workers; | 3791 | goto fail_scrub_workers; |
3792 | 3792 | ||
3793 | fs_info->scrub_wr_completion_workers = | 3793 | fs_info->scrub_wr_completion_workers = |
3794 | btrfs_alloc_workqueue("scrubwrc", flags, | 3794 | btrfs_alloc_workqueue(fs_info, "scrubwrc", flags, |
3795 | max_active, 2); | 3795 | max_active, 2); |
3796 | if (!fs_info->scrub_wr_completion_workers) | 3796 | if (!fs_info->scrub_wr_completion_workers) |
3797 | goto fail_scrub_wr_completion_workers; | 3797 | goto fail_scrub_wr_completion_workers; |
3798 | 3798 | ||
3799 | fs_info->scrub_nocow_workers = | 3799 | fs_info->scrub_nocow_workers = |
3800 | btrfs_alloc_workqueue("scrubnc", flags, 1, 0); | 3800 | btrfs_alloc_workqueue(fs_info, "scrubnc", flags, 1, 0); |
3801 | if (!fs_info->scrub_nocow_workers) | 3801 | if (!fs_info->scrub_nocow_workers) |
3802 | goto fail_scrub_nocow_workers; | 3802 | goto fail_scrub_nocow_workers; |
3803 | fs_info->scrub_parity_workers = | 3803 | fs_info->scrub_parity_workers = |
3804 | btrfs_alloc_workqueue("scrubparity", flags, | 3804 | btrfs_alloc_workqueue(fs_info, "scrubparity", flags, |
3805 | max_active, 2); | 3805 | max_active, 2); |
3806 | if (!fs_info->scrub_parity_workers) | 3806 | if (!fs_info->scrub_parity_workers) |
3807 | goto fail_scrub_parity_workers; | 3807 | goto fail_scrub_parity_workers; |