From patchwork Mon Oct 16 23:28:57 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: 10010185 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 3504D601D5 for ; Mon, 16 Oct 2017 23:29:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 275FA2823E for ; Mon, 16 Oct 2017 23:29:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C39B2845C; Mon, 16 Oct 2017 23:29:38 +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 98BBB2823E for ; Mon, 16 Oct 2017 23:29:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932638AbdJPX3Z (ORCPT ); Mon, 16 Oct 2017 19:29:25 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:57364 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757514AbdJPX3V (ORCPT ); Mon, 16 Oct 2017 19:29:21 -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=1508196562; x=1539732562; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=G93PJeUIeMWOzcsKK01SIjlDxf718z1r4QRC8/jlfLs=; b=Q1XbbBPuIy5dhFbnqdNQSDcghW2AV2Rg16I5fU08Nv7yf5RVsAQr4Hxw PBvD+P2kEthbCCjpkt0a+4Ga4ubZnt2jtcfhviBxTEOILqMbZ/j/AZQZq fKjYZuDAOr5xqCTZe2h6nsN441ZGmDtIwKzqSl65pLbX26xOvroPFM97n UdccRmnL8eHTTgh0ohYFYNSBDNulnmaUiNCiq7fk6KDWq0oStCvT35sYR 9x863UJcXENQtRQrdsO7MML/fJoDmJ86A5csHSkRAKLqPK5ogF8O1R9m1 6o4VLU30lok0fWCML5iJtxEB4d+RlssGsPmQudnZsCxfirdaphVj1+/z1 Q==; X-IronPort-AV: E=Sophos;i="5.43,388,1503331200"; d="scan'208";a="58666197" Received: from sjappemgw12.hgst.com (HELO sjappemgw11.hgst.com) ([199.255.44.66]) by ob1.hgst.iphmx.com with ESMTP; 17 Oct 2017 07:29:21 +0800 Received: from thinkpad-bart.sdcorp.global.sandisk.com (HELO thinkpad-bart.int.fusionio.com) ([10.11.172.152]) by sjappemgw11.hgst.com with ESMTP; 16 Oct 2017 16:29:06 -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 , Ming Lei , Bart Van Assche , linux-raid@vger.kernel.org, Hannes Reinecke Subject: [PATCH v9 02/10] md: Introduce md_stop_all_writes() Date: Mon, 16 Oct 2017 16:28:57 -0700 Message-Id: <20171016232905.5047-3-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171016232905.5047-1-bart.vanassche@wdc.com> References: <20171016232905.5047-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 Reviewed-by: Johannes Thumshirn Reviewed-by: Shaohua Li Tested-by: Martin Steigerwald Cc: linux-raid@vger.kernel.org Cc: Ming Lei Cc: Christoph Hellwig Cc: Hannes Reinecke Reviewed-by: Hannes Reinecke --- 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; }