linux-nvdimm.lists.01.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libnvdimm: change disk name of virtio pmem disk
@ 2019-07-31 11:12 Pankaj Gupta
  2019-08-13  4:55 ` Pankaj Gupta
  2019-08-15 17:28 ` Dan Williams
  0 siblings, 2 replies; 4+ messages in thread
From: Pankaj Gupta @ 2019-07-31 11:12 UTC (permalink / raw)
  To: dan.j.williams; +Cc: linux-nvdimm, linux-kernel

This patch adds prefix 'v' in disk name for virtio pmem.
This differentiates virtio-pmem disks from the pmem disks.

Signed-off-by: Pankaj Gupta <pagupta@redhat.com>
---
 drivers/nvdimm/namespace_devs.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c
index a16e52251a30..8e5d29266fb0 100644
--- a/drivers/nvdimm/namespace_devs.c
+++ b/drivers/nvdimm/namespace_devs.c
@@ -182,8 +182,12 @@ const char *nvdimm_namespace_disk_name(struct nd_namespace_common *ndns,
 		char *name)
 {
 	struct nd_region *nd_region = to_nd_region(ndns->dev.parent);
+	const char *prefix = "";
 	const char *suffix = NULL;
 
+	if (!is_nvdimm_sync(nd_region))
+		prefix = "v";
+
 	if (ndns->claim && is_nd_btt(ndns->claim))
 		suffix = "s";
 
@@ -201,7 +205,7 @@ const char *nvdimm_namespace_disk_name(struct nd_namespace_common *ndns,
 			sprintf(name, "pmem%d.%d%s", nd_region->id, nsidx,
 					suffix ? suffix : "");
 		else
-			sprintf(name, "pmem%d%s", nd_region->id,
+			sprintf(name, "%spmem%d%s", prefix, nd_region->id,
 					suffix ? suffix : "");
 	} else if (is_namespace_blk(&ndns->dev)) {
 		struct nd_namespace_blk *nsblk;
-- 
2.20.1

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-16  7:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-31 11:12 [PATCH] libnvdimm: change disk name of virtio pmem disk Pankaj Gupta
2019-08-13  4:55 ` Pankaj Gupta
2019-08-15 17:28 ` Dan Williams
2019-08-16  7:36   ` Pankaj Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).