From patchwork Sun Apr 5 17:20:18 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: 6162581 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5421BBF4A6 for ; Sun, 5 Apr 2015 17:22:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8056020434 for ; Sun, 5 Apr 2015 17:22:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A3E3420426 for ; Sun, 5 Apr 2015 17:22:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752290AbbDERVO (ORCPT ); Sun, 5 Apr 2015 13:21:14 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:33772 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752668AbbDERU5 (ORCPT ); Sun, 5 Apr 2015 13:20:57 -0400 Received: by wiax7 with SMTP id x7so9471897wia.0; Sun, 05 Apr 2015 10:20:56 -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=bm9cp1Wxx3iOn7eCTZ0LXid6OcmHptcwR0FIV9ojqcs=; b=YYssrrg7OVY5gf3yEoWo8zOa4GgMztXn+HSbLZa/1TO+CVYKPDqCm1buFHCe+6URbK 5f8dpKwjm1F5I8diesbbNUJh3d1UvYcX0/g537F+WsGxueyFnrdMnhG3YdH6cGEUDo2l hQe2vvbWn3ZtHTJl8kLwinRxdu6fDSSTf9FfGW8INIES9PXuHDQ0fpeG5zOphHEBi8YY 46Iocf/UDfG6I7ZjpTGVzkmtHCTdTsuwFVFNSckobCMgoGIRUhc1iBn2MXd3JqbxmYbK /LVQWqHEwPpyPl7JsWQ8tsmVqjewC7j889fIQY+VdLVT7SCFi4b5BCbqguuHaWi6USj+ xHBw== X-Received: by 10.194.200.229 with SMTP id jv5mr24271227wjc.59.1428254456275; Sun, 05 Apr 2015 10:20:56 -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 wo10sm3060881wjb.35.2015.04.05.10.20.54 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 05 Apr 2015 10:20:55 -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 2/3] dm: Export function dm_suspend_md() Date: Sun, 5 Apr 2015 19:20:18 +0200 Message-Id: <1428254419-7334-3-git-send-email-pali.rohar@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1428254419-7334-1-git-send-email-pali.rohar@gmail.com> References: <1428254419-7334-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=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 8001fe9..919ce95 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -3053,6 +3053,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 59f53e7..623c9a8 100644 --- a/drivers/md/dm.h +++ b/drivers/md/dm.h @@ -152,6 +152,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. */