linux-nvdimm.lists.01.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Jeff Moyer <jmoyer@redhat.com>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
	linux-nvdimm <linux-nvdimm@lists.01.org>
Subject: Re: [ndctl PATCH 1/2] ndctl/region: Support ndctl_region_{get, set}_align()
Date: Tue, 25 Feb 2020 15:23:47 -0800	[thread overview]
Message-ID: <CAPcyv4izzfzrb2r7Mc7FfryGnBcn1bOUA8a6_L9t2fKR4caoXw@mail.gmail.com> (raw)
In-Reply-To: <x49o8tulai8.fsf@segfault.boston.devel.redhat.com>

On Wed, Feb 19, 2020 at 10:04 AM Jeff Moyer <jmoyer@redhat.com> wrote:
>
> Dan Williams <dan.j.williams@intel.com> writes:
>
> >
> > +NDCTL_EXPORT unsigned long ndctl_region_get_align(struct ndctl_region *region)
> > +{
> > +     return region->align;
> > +}
> > +
> > +NDCTL_EXPORT int ndctl_region_set_align(struct ndctl_region *region,
> > +             unsigned long align)
> > +{
> > +     struct ndctl_ctx *ctx = ndctl_region_get_ctx(region);
> > +     char *path = region->region_buf;
> > +     int len = region->buf_len, rc;
> > +     char buf[SYSFS_ATTR_SIZE];
> > +
> > +     if (snprintf(path, len, "%s/align", region->region_path) >= len) {
> > +             err(ctx, "%s: buffer too small!\n",
> > +                             ndctl_region_get_devname(region));
> > +             return -ENXIO;
> > +     }
> > +
> > +     sprintf(buf, "%#lx\n", align);
> > +     rc = sysfs_write_attr(ctx, path, buf);
> > +     if (rc < 0)
> > +             return rc;
> > +
> > +     region->align = align;
> > +     return 0;
> > +}
> > +
>
> Missing doctext.  Specifically, there should be a big, fat warning
> against changing the region alignment.

I don't mind adding one, but is this the right place to document an
API warning? If the audience is future ndctl developers that should be
warned to keep the status quo of not plumbing this capability into
"create-namespace" that's one message. If it's to stop other libndctl
application developers, they'll likely never see this source file.

As it stands there is
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

  reply	other threads:[~2020-02-25 23:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-30 22:42 [ndctl PATCH 0/2] ndctl: Cross-arch compatible namespace alignment Dan Williams
2020-01-30 22:42 ` [ndctl PATCH 1/2] ndctl/region: Support ndctl_region_{get, set}_align() Dan Williams
2020-02-19 18:03   ` Jeff Moyer
2020-02-25 23:23     ` Dan Williams [this message]
2020-02-26 17:49       ` Dan Williams
2020-02-26 21:52       ` Jeff Moyer
2020-02-26 22:20         ` Dan Williams
2020-02-26 22:44           ` Jeff Moyer
2020-01-30 22:42 ` [ndctl PATCH 2/2] ndctl/namespace: Improve namespace action failure messages Dan Williams

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=CAPcyv4izzfzrb2r7Mc7FfryGnBcn1bOUA8a6_L9t2fKR4caoXw@mail.gmail.com \
    --to=dan.j.williams@intel.com \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=jmoyer@redhat.com \
    --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 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).