.show = nd_badblocks_show,
};
+static ssize_t resource_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct nd_region *nd_region = to_nd_region(dev);
+
+ return sprintf(buf, "%#llx\n", nd_region->ndr_start);
+}
+static DEVICE_ATTR_RO(resource);
+
static struct attribute *nd_region_attributes[] = {
&dev_attr_size.attr,
&dev_attr_nstype.attr,
&dev_attr_namespace_seed.attr,
&dev_attr_init_namespaces.attr,
&dev_attr_nd_badblocks.attr,
+ &dev_attr_resource.attr,
NULL,
};
if (!is_nd_pmem(dev) && a == &dev_attr_nd_badblocks.attr)
return 0;
+ if (!is_nd_pmem(dev) && a == &dev_attr_resource.attr)
+ return 0;
+
if (a != &dev_attr_set_cookie.attr
&& a != &dev_attr_available_size.attr)
return a->mode;