diff mbox series

[v2,1/2] dm: add dm_table_device_name()

Message ID 80a39e1a5beb7137b7112ae8b2302cb168bebdd3.1539115528.git.mirq-linux@rere.qmqm.pl (mailing list archive)
State Accepted, archived
Delegated to: Mike Snitzer
Headers show
Series [v2,1/2] dm: add dm_table_device_name() | expand

Commit Message

Michał Mirosław Oct. 9, 2018, 8:13 p.m. UTC
Add a shortcut for dm_device_name(dm_table_get_md(t)).

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
v2: use EXPORT_SYMBOL_GPL like dm_device_name()
---
 drivers/md/dm-table.c         | 6 ++++++
 include/linux/device-mapper.h | 1 +
 2 files changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 3d0e2c198f06..792de0a44cd8 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_GPL(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.