Blob Blame History Raw
From: Jeff Mahoney <jeffm@suse.com>
Subject: dm-raid45: Remove blk_unplug calls
Patch-mainline: When this driver is included

 The recent block layer changes mean that manually unplugging queues
 is no longer necessary from drivers in most cases. The unplugging will
 happen automatically during context switches, which in the cases below
 will happen either while waiting for mutex_lock or the context switch
 when the thread completes.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
 drivers/md/dm-raid45.c |   20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

--- a/drivers/md/dm-raid45.c
+++ b/drivers/md/dm-raid45.c
@@ -3325,18 +3325,6 @@ static void do_ios(struct raid_set *rs,
 	bio_list_merge_head(ios, &reject);
 }
 
-/* Unplug: let any queued io role on the sets devices. */
-static void do_unplug(struct raid_set *rs)
-{
-	struct raid_dev *dev = rs->dev + rs->set.raid_devs;
-
-	while (dev-- > rs->dev) {
-		/* Only call any device unplug function, if io got queued. */
-		if (TestClearDevIoQueued(dev))
-			blk_unplug(bdev_get_queue(dev->dev->bdev));
-	}
-}
-
 /* Send an event in case we're getting too busy. */
 static void do_busy_event(struct raid_set *rs)
 {
@@ -3393,8 +3381,6 @@ static void do_raid(struct work_struct *
 
 	/* Try to recover regions. */
 	r = do_recovery(rs);
-	if (r)
-		do_unplug(rs);	/* Unplug the sets device queues. */
 
 	/* Quickly grab all new ios queued and add them to the work list. */
 	mutex_lock(&rs->io.in_lock);
@@ -3406,8 +3400,6 @@ static void do_raid(struct work_struct *
 		do_ios(rs, ios); /* Got ios to work into the cache. */
 
 	r = do_flush(rs);		/* Flush any stripes on io list. */
-	if (r)
-		do_unplug(rs);		/* Unplug the sets device queues. */
 
 	do_busy_event(rs);	/* Check if we got too busy. */
 }