From patchwork Tue Oct 17 23:26:22 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: 10013075 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 E8782600CC for ; Tue, 17 Oct 2017 23:27:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB44128A13 for ; Tue, 17 Oct 2017 23:27:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D06B228A24; Tue, 17 Oct 2017 23:27:00 +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 860EE28A13 for ; Tue, 17 Oct 2017 23:27:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933894AbdJQX07 (ORCPT ); Tue, 17 Oct 2017 19:26:59 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:40635 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761431AbdJQX0c (ORCPT ); Tue, 17 Oct 2017 19:26:32 -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=1508282793; x=1539818793; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=zevy9fMrHEm2YEjI2umYZML9iAdYM1hgmRwf5knutLM=; b=nJ8hSCqDklV6wXGFEipR2X0LW0WntZBSRfvnMGdqLiNwI8leX5tAdems 8/BvQx/VFAEIsl1sXIo/lyEvZpZM3lb0Qs7kElO9FLkpe+W0QEKVBQTwE xoTZLs/rcZSJlHWG36Q0eeyDKBrxyLdgsTl1Rmnxf+h6vqJsGzycYQkYg z/QVjz8iNZSA0EV+6Lktga2+k63IzahrZhV4ss/F9j003QDFGgr/G+JUe 5+3BGs3wxmkTaS8U8o00RpzcdkgWXYkfqrt/nBeYAH2XIiv/xdc3a2k8e TyOl1tO48mEuOVB4Gy/j7siMyciAK3+GSzlyQEO3L+wujhC9PBsTAuf5d g==; X-IronPort-AV: E=Sophos;i="5.43,393,1503331200"; d="scan'208";a="58837497" Received: from sjappemgw11.hgst.com (HELO sjappemgw12.hgst.com) ([199.255.44.62]) by ob1.hgst.iphmx.com with ESMTP; 18 Oct 2017 07:26:32 +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; 17 Oct 2017 16:26:31 -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 Subject: [PATCH v10 02/10] md: Introduce md_stop_all_writes() Date: Tue, 17 Oct 2017 16:26:22 -0700 Message-Id: <20171017232630.4264-3-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171017232630.4264-1-bart.vanassche@wdc.com> References: <20171017232630.4264-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 Reviewed-by: Hannes Reinecke Tested-by: Martin Steigerwald Cc: linux-raid@vger.kernel.org Cc: Ming Lei Cc: Christoph Hellwig --- 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; }