From patchwork Mon Oct 9 23:13:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9994595 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 39A3660223 for ; Mon, 9 Oct 2017 23:14:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B9801FF1D for ; Mon, 9 Oct 2017 23:14:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 207D820007; Mon, 9 Oct 2017 23:14:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 943641FF1D for ; Mon, 9 Oct 2017 23:14:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755655AbdJIXOK (ORCPT ); Mon, 9 Oct 2017 19:14:10 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:47759 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755497AbdJIXOG (ORCPT ); Mon, 9 Oct 2017 19:14:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1507590846; x=1539126846; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=iHJdNiVeUeSPf7yJsnlo/aWdC6uA5mohgCY3k6nlAAc=; b=BfZfIQYQkw0ujebfoSlfyepvfCYnxMVfBURMw+daeURX3u3rdbh9Rcv0 691C/PUUFPiVomFtYcBSlVnFzu18dWLN3Zje1OQAN9+0APUeSTnvknsMR KBcp0WHB/9JpGJD4Jd845ji3UnqfCPo8hZP78AflGRJplYSJYSB48X0Wm WDXci/eQxalzlguNFXOBdrcFrNCynt51kmA0AIswyEox9rP+EYEIvh1kq 17Icy88OMBpCgmSY5LG7q9bhTqfD5KjTxy3/XtUFNup1RcEfvqzsubRAx ARefbGh4E9k4pzPbdabxhIG3rKVbxAPElMJOB270oQYG00z10ks2sWHKy g==; X-IronPort-AV: E=Sophos;i="5.42,501,1500912000"; d="scan'208";a="159653526" Received: from sjappemgw11.hgst.com (HELO sjappemgw12.hgst.com) ([199.255.44.62]) by ob1.hgst.iphmx.com with ESMTP; 10 Oct 2017 07:14:06 +0800 Received: from thinkpad-bart.sdcorp.global.sandisk.com (HELO thinkpad-bart.int.fusionio.com) ([10.11.172.152]) by sjappemgw12.hgst.com with ESMTP; 09 Oct 2017 16:14:01 -0700 From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, Christoph Hellwig , "Martin K . Petersen" , =Oleksandr Natalenko , "Luis R . Rodriguez" , Ming Lei , Bart Van Assche , Shaohua Li , linux-raid@vger.kernel.org, Hannes Reinecke , Johannes Thumshirn Subject: [PATCH v7 2/9] md: Introduce md_stop_all_writes() Date: Mon, 9 Oct 2017 16:13:53 -0700 Message-Id: <20171009231400.562-3-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171009231400.562-1-bart.vanassche@wdc.com> References: <20171009231400.562-1-bart.vanassche@wdc.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Cc: Shaohua Li Cc: linux-raid@vger.kernel.org Cc: Ming Lei Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Johannes Thumshirn Reviewed-by: Johannes Thumshirn --- 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; }