aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm/namespace_devs.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-12-18 18:49:10 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-18 18:49:10 -0500
commit3be134e5152f08e8bd3c2afdaac723f64d93c2bb (patch)
treeba325ebb1a9f79a4a8451a8f5eaeed9cbd1c2e04 /drivers/nvdimm/namespace_devs.c
parent8421c60446290c0fef1858a806261871a40ebf76 (diff)
parentc44ef859ceff45db1c72f9ccbfae96843c4b1501 (diff)
Merge tag 'libnvdimm-for-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm
Pull libnvdimm updates from Dan Williams: "The libnvdimm pull request is relatively small this time around due to some development topics being deferred to 4.11. As for this pull request the bulk of it has been in -next for several releases leading to one late fix being added (commit 868f036fee4b ("libnvdimm: fix mishandled nvdimm_clear_poison() return value")). It has received a build success notification from the 0day-kbuild robot and passes the latest libnvdimm unit tests. Summary: - Dynamic label support: To date namespace label support has been limited to disambiguating cases where PMEM (direct load/store) and BLK (mmio aperture) accessed-capacity alias on the same DIMM. Since 4.9 added support for multiple namespaces per PMEM-region there is value to support namespace labels even in the non-aliasing case. The presence of a valid namespace index block force-enables label support when the kernel would otherwise rely on region boundaries, and permits the region to be sub-divided. - Handle media errors in namespace metadata: Complement the error handling for media errors in namespace data areas with support for clearing errors on writes, and downgrading potential machine-check exceptions to simple i/o errors on read. - Device-DAX region attributes: Add 'align', 'id', and 'size' as attributes for device-dax regions. In particular this enables userspace tooling to generically size memory mapping and i/o operations. Prevent userspace from growing assumptions / dependencies about the parent device topology for a dax region. A libnvdimm namespace may not always be the parent device of a dax region. - Various cleanups and small fixes" * tag 'libnvdimm-for-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: dax: add region 'id', 'size', and 'align' attributes libnvdimm: fix mishandled nvdimm_clear_poison() return value libnvdimm: replace mutex_is_locked() warnings with lockdep_assert_held libnvdimm, pfn: fix align attribute libnvdimm, e820: use module_platform_driver libnvdimm, namespace: use octal for permissions libnvdimm, namespace: avoid multiple sector calculations libnvdimm: remove else after return in nsio_rw_bytes() libnvdimm, namespace: fix the type of name variable libnvdimm: use consistent naming for request_mem_region() nvdimm: use the right length of "pmem" libnvdimm: check and clear poison before writing to pmem tools/testing/nvdimm: dynamic label support libnvdimm: allow a platform to force enable label support libnvdimm: use generic iostat interfaces
Diffstat (limited to 'drivers/nvdimm/namespace_devs.c')
-rw-r--r--drivers/nvdimm/namespace_devs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c
index abe5c6bc756c..6307088b375f 100644
--- a/drivers/nvdimm/namespace_devs.c
+++ b/drivers/nvdimm/namespace_devs.c
@@ -1132,7 +1132,7 @@ static ssize_t size_show(struct device *dev,
1132 return sprintf(buf, "%llu\n", (unsigned long long) 1132 return sprintf(buf, "%llu\n", (unsigned long long)
1133 nvdimm_namespace_capacity(to_ndns(dev))); 1133 nvdimm_namespace_capacity(to_ndns(dev)));
1134} 1134}
1135static DEVICE_ATTR(size, S_IRUGO, size_show, size_store); 1135static DEVICE_ATTR(size, 0444, size_show, size_store);
1136 1136
1137static u8 *namespace_to_uuid(struct device *dev) 1137static u8 *namespace_to_uuid(struct device *dev)
1138{ 1138{
@@ -1456,7 +1456,7 @@ static umode_t namespace_visible(struct kobject *kobj,
1456 1456
1457 if (is_namespace_pmem(dev) || is_namespace_blk(dev)) { 1457 if (is_namespace_pmem(dev) || is_namespace_blk(dev)) {
1458 if (a == &dev_attr_size.attr) 1458 if (a == &dev_attr_size.attr)
1459 return S_IWUSR | S_IRUGO; 1459 return 0644;
1460 1460
1461 if (is_namespace_pmem(dev) && a == &dev_attr_sector_size.attr) 1461 if (is_namespace_pmem(dev) && a == &dev_attr_sector_size.attr)
1462 return 0; 1462 return 0;
@@ -1653,7 +1653,7 @@ static int select_pmem_id(struct nd_region *nd_region, u8 *pmem_id)
1653 u64 hw_start, hw_end, pmem_start, pmem_end; 1653 u64 hw_start, hw_end, pmem_start, pmem_end;
1654 struct nd_label_ent *label_ent; 1654 struct nd_label_ent *label_ent;
1655 1655
1656 WARN_ON(!mutex_is_locked(&nd_mapping->lock)); 1656 lockdep_assert_held(&nd_mapping->lock);
1657 list_for_each_entry(label_ent, &nd_mapping->labels, list) { 1657 list_for_each_entry(label_ent, &nd_mapping->labels, list) {
1658 nd_label = label_ent->label; 1658 nd_label = label_ent->label;
1659 if (!nd_label) 1659 if (!nd_label)
@@ -1997,7 +1997,7 @@ struct device *create_namespace_blk(struct nd_region *nd_region,
1997 struct nd_mapping *nd_mapping = &nd_region->mapping[0]; 1997 struct nd_mapping *nd_mapping = &nd_region->mapping[0];
1998 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); 1998 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
1999 struct nd_namespace_blk *nsblk; 1999 struct nd_namespace_blk *nsblk;
2000 char *name[NSLABEL_NAME_LEN]; 2000 char name[NSLABEL_NAME_LEN];
2001 struct device *dev = NULL; 2001 struct device *dev = NULL;
2002 struct resource *res; 2002 struct resource *res;
2003 2003