From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bart Van Assche Subject: [PATCH v5 1/8] md: Introduce md_stop_all_writes() Date: Mon, 2 Oct 2017 15:52:11 -0700 Message-ID: <20171002225218.18548-2-bart.vanassche@wdc.com> References: <20171002225218.18548-1-bart.vanassche@wdc.com> Return-path: In-Reply-To: <20171002225218.18548-1-bart.vanassche@wdc.com> Sender: linux-block-owner@vger.kernel.org To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , "Martin K . Petersen" , =Oleksandr Natalenko , "Luis R . Rodriguez" , Bart Van Assche , Shaohua Li , linux-raid@vger.kernel.org, Ming Lei , Hannes Reinecke , Johannes Thumshirn List-Id: linux-raid.ids Introduce md_stop_all_writes() because the next patch will add a second caller for this function. Rename md_notifier into md_reboot_notifier to avoid that the name of this notifier will become confusing due to the next patch. This patch does not change any functionality. Signed-off-by: Bart Van Assche Cc: Shaohua Li Cc: linux-raid@vger.kernel.org Cc: Ming Lei Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Johannes Thumshirn --- drivers/md/md.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 0ff1bbf6c90e..3f7426120a3b 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -8935,8 +8935,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; @@ -8960,11 +8959,17 @@ 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; } -static struct notifier_block md_notifier = { +static struct notifier_block md_reboot_notifier = { .notifier_call = md_notify_reboot, .next = NULL, .priority = INT_MAX, /* before any real devices */ @@ -9001,7 +9006,7 @@ static int __init md_init(void) blk_register_region(MKDEV(mdp_major, 0), 1UL<