All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pankaj Gupta <pagupta@redhat.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: linux-nvdimm <linux-nvdimm@lists.01.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] libnvdimm: change disk name of virtio pmem disk
Date: Fri, 16 Aug 2019 03:36:14 -0400 (EDT)	[thread overview]
Message-ID: <1526809439.8842269.1565940974952.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <CAPcyv4gLqd43CLDuGYrDdx4xR1_oc3D0hzdETz8uQmV1C2Dp_Q@mail.gmail.com>


> >
> > This patch adds prefix 'v' in disk name for virtio pmem.
> > This differentiates virtio-pmem disks from the pmem disks.
> 
> I don't think the small matter that this device does not support
> MAP_SYNC warrants a separate naming scheme.  That said I do think we
> need to export this attribute in sysfs, likely at the region level,
> and then display that information in ndctl. This is distinct from the
> btt case where it is operating a different data consistency contract
> than baseline pmem.

o.k. I will look to add the information in sysfs and display using ndctl.

Thanks,
Pankaj

> >
> > 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

WARNING: multiple messages have this Message-ID (diff)
From: Pankaj Gupta <pagupta@redhat.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: linux-nvdimm <linux-nvdimm@lists.01.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Vishal L Verma <vishal.l.verma@intel.com>,
	Dave Jiang <dave.jiang@intel.com>,
	Keith Busch <keith.busch@intel.com>,
	Ira Weiny <ira.weiny@intel.com>
Subject: Re: [PATCH] libnvdimm: change disk name of virtio pmem disk
Date: Fri, 16 Aug 2019 03:36:14 -0400 (EDT)	[thread overview]
Message-ID: <1526809439.8842269.1565940974952.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <CAPcyv4gLqd43CLDuGYrDdx4xR1_oc3D0hzdETz8uQmV1C2Dp_Q@mail.gmail.com>


> >
> > This patch adds prefix 'v' in disk name for virtio pmem.
> > This differentiates virtio-pmem disks from the pmem disks.
> 
> I don't think the small matter that this device does not support
> MAP_SYNC warrants a separate naming scheme.  That said I do think we
> need to export this attribute in sysfs, likely at the region level,
> and then display that information in ndctl. This is distinct from the
> btt case where it is operating a different data consistency contract
> than baseline pmem.

o.k. I will look to add the information in sysfs and display using ndctl.

Thanks,
Pankaj

> >
> > 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
> >
> 

  reply	other threads:[~2019-08-16  7:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-31 11:12 [PATCH] libnvdimm: change disk name of virtio pmem disk Pankaj Gupta
2019-07-31 11:12 ` Pankaj Gupta
2019-08-13  4:55 ` Pankaj Gupta
2019-08-13  4:55   ` Pankaj Gupta
2019-08-15 17:28 ` Dan Williams
2019-08-15 17:28   ` Dan Williams
2019-08-16  7:36   ` Pankaj Gupta [this message]
2019-08-16  7:36     ` Pankaj Gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1526809439.8842269.1565940974952.JavaMail.zimbra@redhat.com \
    --to=pagupta@redhat.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.