On Tue, Feb 25, 2020 at 3:23 PM Dan Williams <[email protected]> wrote: > > On Wed, Feb 19, 2020 at 10:04 AM Jeff Moyer <[email protected]> wrote: > > > > Dan Williams <[email protected]> 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
Whoops, meant to delete this before sending... _______________________________________________ Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]
