summaryrefslogtreecommitdiff
path: root/sys/dev/dm/dm_pdev.c
diff options
context:
space:
mode:
authortkusumi <tkusumi@NetBSD.org>2019-12-20 16:16:36 +0000
committertkusumi <tkusumi@NetBSD.org>2019-12-20 16:16:36 +0000
commit35c700b993799c6f4137fb1420b546af4ccccabb (patch)
tree5740f94f21dded0994c05a0669fb13f04d413e53 /sys/dev/dm/dm_pdev.c
parent3a64489ed06d3fbcb98c0093ef128bd452243962 (diff)
dm: Fix "table" output format of dm-linear and dm-stripe
The existing "table" output showing device file path of pdev is not compatible with dm in Linux kernel (and also DragonFlyBSD). It should be showing "major:minor" instead. taken-from: DragonFlyBSD
Diffstat (limited to 'sys/dev/dm/dm_pdev.c')
-rw-r--r--sys/dev/dm/dm_pdev.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/dm/dm_pdev.c b/sys/dev/dm/dm_pdev.c
index d5c8bbfddf2..d4efe8fcdaf 100644
--- a/sys/dev/dm/dm_pdev.c
+++ b/sys/dev/dm/dm_pdev.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dm_pdev.c,v 1.21 2019/12/15 14:39:42 tkusumi Exp $ */
+/* $NetBSD: dm_pdev.c,v 1.22 2019/12/20 16:16:36 tkusumi Exp $ */
/*
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dm_pdev.c,v 1.21 2019/12/15 14:39:42 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_pdev.c,v 1.22 2019/12/20 16:16:36 tkusumi Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -127,6 +127,10 @@ dm_pdev_insert(const char *dev_name)
getdisksize(dmp->pdev_vnode, &dmp->pdev_numsec, &dmp->pdev_secsize);
dmp->ref_cnt = 1;
+ snprintf(dmp->udev_name, sizeof(dmp->udev_name), "%d:%d",
+ major(dmp->pdev_vnode->v_rdev), minor(dmp->pdev_vnode->v_rdev));
+ aprint_debug("%s: %s %s\n", __func__, dev_name, dmp->udev_name);
+
SLIST_INSERT_HEAD(&dm_pdev_list, dmp, next_pdev);
mutex_exit(&dm_pdev_mutex);