@@ -1684,6 +1684,14 @@ static ssize_t force_raw_show(struct device *dev,
}
static DEVICE_ATTR_RW(force_raw);
+static ssize_t supported_size_align_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ return sprintf(buf, "%ld\n", arch_namespace_align_size());
+}
+static DEVICE_ATTR_RO(supported_size_align);
+
+
static struct attribute *nd_namespace_attributes[] = {
&dev_attr_nstype.attr,
&dev_attr_size.attr,
@@ -1696,6 +1704,7 @@ static struct attribute *nd_namespace_attributes[] = {
&dev_attr_sector_size.attr,
&dev_attr_dpa_extents.attr,
&dev_attr_holder_class.attr,
+ &dev_attr_supported_size_align.attr,
NULL,
};
Expose supported size align as a namespace RO attribute. Usespace can use this to validate the size argument specified when creating a new namespace. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> --- drivers/nvdimm/namespace_devs.c | 9 +++++++++ 1 file changed, 9 insertions(+)