Thread (1 message) 1 message, 1 author, 2017-10-17

[PATCH v10 02/10] md: Introduce md_stop_all_writes()

flat view
STALE3277d SUPERSEDED: 6 (3M)

From: Bart Van Assche <hidden>
Date: 2017-10-17 23:26:22
Also in: linux-block, linux-scsi
Subsystem: software raid (multiple disks) support, the rest · Maintainers: Song Liu, Yu Kuai, Linus Torvalds

Revision v10 of 6 in this series; 4 review trailers.

Revisions (6)
  1. v5 [diff vs current]
  2. v6 [diff vs current]
  3. v8 [diff vs current]
  4. v9 [diff vs current]
  5. v10 current
  6. v11 [diff vs current]
Introduce md_stop_all_writes() because the next patch will add
a second caller for this function. This patch does not change
any functionality.

Signed-off-by: Bart Van Assche <redacted>
Reviewed-by: Johannes Thumshirn <redacted>
Reviewed-by: Shaohua Li <shli@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Tested-by: Martin Steigerwald <redacted>
Cc: linux-raid@vger.kernel.org
Cc: Ming Lei <redacted>
Cc: Christoph Hellwig <hch@lst.de>
---
 drivers/md/md.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 8933cafc212d..b99584e5d6b1 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -8937,8 +8937,7 @@ int rdev_clear_badblocks(struct md_rdev *rdev, sector_t s, int sectors,
 }
 EXPORT_SYMBOL_GPL(rdev_clear_badblocks);
 
-static int md_notify_reboot(struct notifier_block *this,
-			    unsigned long code, void *x)
+static void md_stop_all_writes(void)
 {
 	struct list_head *tmp;
 	struct mddev *mddev;
@@ -8962,6 +8961,12 @@ static int md_notify_reboot(struct notifier_block *this,
 	 */
 	if (need_delay)
 		mdelay(1000*1);
+}
+
+static int md_notify_reboot(struct notifier_block *this,
+			    unsigned long code, void *x)
+{
+	md_stop_all_writes();
 
 	return NOTIFY_DONE;
 }
-- 
2.14.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help