aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index a2eb3a3755db..29a2475b9b14 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1654,6 +1654,17 @@ struct btrfs_root *open_ctree(struct super_block *sb,
1654 } 1654 }
1655 btrfs_init_delayed_root(fs_info->delayed_root); 1655 btrfs_init_delayed_root(fs_info->delayed_root);
1656 1656
1657 mutex_init(&fs_info->scrub_lock);
1658 atomic_set(&fs_info->scrubs_running, 0);
1659 atomic_set(&fs_info->scrub_pause_req, 0);
1660 atomic_set(&fs_info->scrubs_paused, 0);
1661 atomic_set(&fs_info->scrub_cancel_req, 0);
1662 init_waitqueue_head(&fs_info->scrub_pause_wait);
1663 init_rwsem(&fs_info->scrub_super_lock);
1664 fs_info->scrub_workers_refcnt = 0;
1665 btrfs_init_workers(&fs_info->scrub_workers, "scrub",
1666 fs_info->thread_pool_size, &fs_info->generic_worker);
1667
1657 sb->s_blocksize = 4096; 1668 sb->s_blocksize = 4096;
1658 sb->s_blocksize_bits = blksize_bits(4096); 1669 sb->s_blocksize_bits = blksize_bits(4096);
1659 sb->s_bdi = &fs_info->bdi; 1670 sb->s_bdi = &fs_info->bdi;
@@ -2488,6 +2499,7 @@ int close_ctree(struct btrfs_root *root)
2488 fs_info->closing = 1; 2499 fs_info->closing = 1;
2489 smp_mb(); 2500 smp_mb();
2490 2501
2502 btrfs_scrub_cancel(root);
2491 btrfs_put_block_group_cache(fs_info); 2503 btrfs_put_block_group_cache(fs_info);
2492 2504
2493 /* 2505 /*