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. -Jeff _______________________________________________ Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]
