From patchwork Tue Oct 9 19:36:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 10633215 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B5A9114DB for ; Tue, 9 Oct 2018 19:36:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1DAD29522 for ; Tue, 9 Oct 2018 19:36:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9470529715; Tue, 9 Oct 2018 19:36:29 +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.9 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 41EFB29522 for ; Tue, 9 Oct 2018 19:36:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D5F963082B60; Tue, 9 Oct 2018 19:36:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 54FB27856B; Tue, 9 Oct 2018 19:36:27 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6D9834BB79; Tue, 9 Oct 2018 19:36:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w99JaOss027206 for ; Tue, 9 Oct 2018 15:36:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id C733B77BEB; Tue, 9 Oct 2018 19:36:24 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CE78A6A94B; Tue, 9 Oct 2018 19:36:18 +0000 (UTC) Received: from rere.qmqm.pl (rere.qmqm.pl [91.227.64.183]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7AB268764F; Tue, 9 Oct 2018 19:36:17 +0000 (UTC) Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 42V6rz20zwz1D; Tue, 9 Oct 2018 21:35:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1539113731; bh=J9e+DfrSZShTR7juCkiHqgE9m6M0E+Yjfwdo0B0KlMM=; h=Date:References:From:Subject:To:Cc:From; b=ezS44rbzUkssfiE6Mpw7ftu5Z9SlLS2D7pN47ZHdKbTqRv3i99a4/iW0dTvnUNEcK TIkWRhGRR7q1TaHeiSPvzDTHIvsRJaI214hDQ5zAAa36Ym4jh2K27M1/mL+9/t+kVW /LZovs8nrcc7A/LBR/sk5Y3JOzFwThZBMwTIq5d+fsdNESAd34c6y2i95VhSHRe4/n RHx0OPP5Y6PaiaX4u4lu38XW0Lago+jQqVxLNQ9/A9iOoriDKH3HpNlxYeLCfhYd8Q j6DWff2khWGwXzw7+QGHpVgQMuAy/tlP2AxqqDP2amyPFkmomE17kdLuWWi2ohTyv6 uJ2jHVFFPN5pQ== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.1 at mail Date: Tue, 09 Oct 2018 21:36:15 +0200 Message-Id: References: <614cd7a2d51cf5db0583e4b9a2e2d59c8a4da7a9.1539113066.git.mirq-linux@rere.qmqm.pl> From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= MIME-Version: 1.0 To: Alasdair Kergon , Mike Snitzer X-Greylist: Sender passed SPF test, ACL 236 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 09 Oct 2018 19:36:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 09 Oct 2018 19:36:17 +0000 (UTC) for IP:'91.227.64.183' DOMAIN:'rere.qmqm.pl' HELO:'rere.qmqm.pl' FROM:'mirq-linux@rere.qmqm.pl' RCPT:'' X-RedHat-Spam-Score: -0.102 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, SPF_PASS) 91.227.64.183 rere.qmqm.pl 91.227.64.183 rere.qmqm.pl X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com Subject: [dm-devel] [PATCH 1/2] dm: add dm_table_device_name() X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 09 Oct 2018 19:36:28 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP Add a shortcut for dm_device_name(dm_table_get_md(t)). Signed-off-by: Michał Mirosław --- drivers/md/dm-table.c | 6 ++++++ include/linux/device-mapper.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 3d0e2c198f06..1f4ab9c8b9a8 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -2079,6 +2079,12 @@ struct mapped_device *dm_table_get_md(struct dm_table *t) } EXPORT_SYMBOL(dm_table_get_md); +const char *dm_table_device_name(struct dm_table *t) +{ + return dm_device_name(t->md); +} +EXPORT_SYMBOL(dm_table_device_name); + void dm_table_run_md_queue_async(struct dm_table *t) { struct mapped_device *md; diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 6fb0808e87c8..0d63f7e5261c 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h @@ -490,6 +490,7 @@ sector_t dm_table_get_size(struct dm_table *t); unsigned int dm_table_get_num_targets(struct dm_table *t); fmode_t dm_table_get_mode(struct dm_table *t); struct mapped_device *dm_table_get_md(struct dm_table *t); +const char *dm_table_device_name(struct dm_table *t); /* * Trigger an event.