From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B97382130A510 for ; Mon, 12 Aug 2019 21:57:54 -0700 (PDT) Date: Tue, 13 Aug 2019 00:55:37 -0400 (EDT) From: Pankaj Gupta Message-ID: <633367382.8144845.1565672137069.JavaMail.zimbra@redhat.com> In-Reply-To: <20190731111207.12836-1-pagupta@redhat.com> References: <20190731111207.12836-1-pagupta@redhat.com> Subject: Re: [PATCH] libnvdimm: change disk name of virtio pmem disk MIME-Version: 1.0 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: dan j williams Cc: linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org List-ID: Ping. > > 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 > --- > 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