From patchwork Sun Jun 21 11:20:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 6652511 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 004A79F399 for ; Sun, 21 Jun 2015 11:21:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 54CAD206C7 for ; Sun, 21 Jun 2015 11:21:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A4C02206AB for ; Sun, 21 Jun 2015 11:21:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754591AbbFULVn (ORCPT ); Sun, 21 Jun 2015 07:21:43 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:35302 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754243AbbFULVk (ORCPT ); Sun, 21 Jun 2015 07:21:40 -0400 Received: by wgbhy7 with SMTP id hy7so120307738wgb.2; Sun, 21 Jun 2015 04:21:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=nKu4TJ9F6C7yHf8IDblf++nalL+x5A15317mjS1kCBI=; b=HiPDRYSlqyCVIR64mIfJgtsZeG4lLH+TKQBok6lbHYaXzcHCe8qCoPS1IOfGQtUrR/ bp0OFa3EZeXP3rxvctAWJfLuOESos2NV4ShnAsIUJACWYn602qU/ENd4gZmmpT/QP4wh 84tLR4vJ+6igFaq/lVkC3i8mbBrZ1gNI9MvVhV0U+e190OrGQG3DyfGHbu+ayMZsba+v iOHU0bEClN6rGg4UuOSKxGn3SEEMeKldU3rRqwPwV+n3JvNIS/6onzDsM6wr9ypSrRfC UemlCQitfQgbClGLfbAaPbC2wQzffGBOpd1mHmORBvpIanQxVcaWciJe/FR8CZY325Zi Nn6g== X-Received: by 10.180.74.136 with SMTP id t8mr19579902wiv.21.1434885698709; Sun, 21 Jun 2015 04:21:38 -0700 (PDT) Received: from Pali-Latitude.kolej.mff.cuni.cz (pali.kolej.mff.cuni.cz. [78.128.193.202]) by mx.google.com with ESMTPSA id f8sm12001411wiy.7.2015.06.21.04.21.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Jun 2015 04:21:38 -0700 (PDT) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Alasdair Kergon , Mike Snitzer , Neil Brown , "Rafael J. Wysocki" , Len Brown , Pavel Machek Cc: dm-devel@redhat.com, linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= Subject: [PATCH v2 2/3] dm: Export function dm_suspend_md() Date: Sun, 21 Jun 2015 13:20:33 +0200 Message-Id: <1434885634-19895-3-git-send-email-pali.rohar@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1434885634-19895-1-git-send-email-pali.rohar@gmail.com> References: <1428254419-7334-1-git-send-email-pali.rohar@gmail.com> <1434885634-19895-1-git-send-email-pali.rohar@gmail.com> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch exports function dm_suspend_md() which suspend mapped device so other kernel drivers can use it and could suspend mapped device when needed. Signed-off-by: Pali Rohár --- drivers/md/dm.c | 6 ++++++ drivers/md/dm.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 2caf492..03298ff 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -3343,6 +3343,12 @@ out: return r; } +int dm_suspend_md(struct mapped_device *md) +{ + return dm_suspend(md, DM_SUSPEND_LOCKFS_FLAG); +} +EXPORT_SYMBOL_GPL(dm_suspend_md); + /* * Internal suspend/resume works like userspace-driven suspend. It waits * until all bios finish and prevents issuing new bios to the target drivers. diff --git a/drivers/md/dm.h b/drivers/md/dm.h index 6123c2b..528e5e0 100644 --- a/drivers/md/dm.h +++ b/drivers/md/dm.h @@ -151,6 +151,11 @@ int dm_test_deferred_remove_flag(struct mapped_device *md); void dm_deferred_remove(void); /* + * Suspend mapped_device + */ +int dm_suspend_md(struct mapped_device *md); + +/* * The device-mapper can be driven through one of two interfaces; * ioctl or filesystem, depending which patch you have applied. */