btrfs: [RFC] Don't use workqueue for raid56 parity scrub
diff mbox

Message ID e11384e9d3f8a3d87ca1f4c57ac699d15153c3a9.1434092619.git.zhaolei@cn.fujitsu.com
State New
Headers show

Commit Message

Zhaolei June 12, 2015, 7:06 a.m. UTC
From: Zhao Lei <zhaolei@cn.fujitsu.com>

The code in workqueue only do fast initialization and submit a bio
in end, plus, it will not called in interrupe context, no need to
queue a work for this type of work.

Call it directly will make code simple, easy to debug and reduce
potential problem.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
---
 fs/btrfs/raid56.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

Patch
diff mbox

diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
index fa72068..eea86d1 100644
--- a/fs/btrfs/raid56.c
+++ b/fs/btrfs/raid56.c
@@ -2557,7 +2557,7 @@  static void raid56_parity_scrub_end_io(struct bio *bio, int err)
 	validate_rbio_for_parity_scrub(rbio);
 }
 
-static void raid56_parity_scrub_stripe(struct btrfs_raid_bio *rbio)
+static void async_scrub_parity(struct btrfs_raid_bio *rbio)
 {
 	int bios_to_read = 0;
 	struct bio_list bio_list;
@@ -2646,23 +2646,6 @@  finish:
 	validate_rbio_for_parity_scrub(rbio);
 }
 
-static void scrub_parity_work(struct btrfs_work *work)
-{
-	struct btrfs_raid_bio *rbio;
-
-	rbio = container_of(work, struct btrfs_raid_bio, work);
-	raid56_parity_scrub_stripe(rbio);
-}
-
-static void async_scrub_parity(struct btrfs_raid_bio *rbio)
-{
-	btrfs_init_work(&rbio->work, btrfs_rmw_helper,
-			scrub_parity_work, NULL, NULL);
-
-	btrfs_queue_work(rbio->fs_info->rmw_workers,
-			 &rbio->work);
-}
-
 void raid56_parity_submit_scrub_rbio(struct btrfs_raid_bio *rbio)
 {
 	if (!lock_stripe_add(rbio))