btrfs: scrub: simplify scrub worker initialization
authorDavid Sterba <dsterba@suse.com>
Fri, 31 Mar 2017 16:42:57 +0000 (18:42 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Aug 2017 15:47:42 +0000 (17:47 +0200)
Minor simplification, merge calls to one.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/scrub.c

index a1b29d581dca05122f4a766d406a5172b8d25faf..7c9c82bb62550877f4dc0d472c95ff9f98c89bd5 100644 (file)
@@ -4015,14 +4015,8 @@ static noinline_for_stack int scrub_workers_get(struct btrfs_fs_info *fs_info,
        int max_active = fs_info->thread_pool_size;
 
        if (fs_info->scrub_workers_refcnt == 0) {
-               if (is_dev_replace)
-                       fs_info->scrub_workers =
-                               btrfs_alloc_workqueue(fs_info, "scrub", flags,
-                                                     1, 4);
-               else
-                       fs_info->scrub_workers =
-                               btrfs_alloc_workqueue(fs_info, "scrub", flags,
-                                                     max_active, 4);
+               fs_info->scrub_workers = btrfs_alloc_workqueue(fs_info, "scrub",
+                               flags, is_dev_replace ? 1 : max_active, 4);
                if (!fs_info->scrub_workers)
                        goto fail_scrub_workers;