Lines Matching refs:ndns

90 	struct nd_namespace_common *ndns = to_ndns(dev);  in pmem_should_map_pages()  local
102 if (ndns->force_raw) in pmem_should_map_pages()
115 unsigned int pmem_sector_size(struct nd_namespace_common *ndns) in pmem_sector_size() argument
117 if (is_namespace_pmem(&ndns->dev)) { in pmem_sector_size()
120 nspm = to_nd_namespace_pmem(&ndns->dev); in pmem_sector_size()
126 dev_WARN(&ndns->dev, "unsupported sector size: %ld\n", in pmem_sector_size()
138 const char *nvdimm_namespace_disk_name(struct nd_namespace_common *ndns, in nvdimm_namespace_disk_name() argument
141 struct nd_region *nd_region = to_nd_region(ndns->dev.parent); in nvdimm_namespace_disk_name()
144 if (ndns->claim && is_nd_btt(ndns->claim)) in nvdimm_namespace_disk_name()
147 if (is_namespace_pmem(&ndns->dev) || is_namespace_io(&ndns->dev)) { in nvdimm_namespace_disk_name()
150 if (is_namespace_pmem(&ndns->dev)) { in nvdimm_namespace_disk_name()
153 nspm = to_nd_namespace_pmem(&ndns->dev); in nvdimm_namespace_disk_name()
746 struct nd_namespace_common *ndns = to_ndns(dev); in __size_store() local
754 if (dev->driver || ndns->claim) in __size_store()
828 if (val == 0 && id != 0 && nd_region->ns_seed != dev && !ndns->claim) in __size_store()
868 resource_size_t __nvdimm_namespace_capacity(struct nd_namespace_common *ndns) in __nvdimm_namespace_capacity() argument
870 struct device *dev = &ndns->dev; in __nvdimm_namespace_capacity()
885 resource_size_t nvdimm_namespace_capacity(struct nd_namespace_common *ndns) in nvdimm_namespace_capacity() argument
889 nvdimm_bus_lock(&ndns->dev); in nvdimm_namespace_capacity()
890 size = __nvdimm_namespace_capacity(ndns); in nvdimm_namespace_capacity()
891 nvdimm_bus_unlock(&ndns->dev); in nvdimm_namespace_capacity()
897 bool nvdimm_namespace_locked(struct nd_namespace_common *ndns) in nvdimm_namespace_locked() argument
901 struct device *dev = &ndns->dev; in nvdimm_namespace_locked()
1231 struct nd_namespace_common *ndns = to_ndns(dev); in holder_show() local
1235 rc = sprintf(buf, "%s\n", ndns->claim ? dev_name(ndns->claim) : ""); in holder_show()
1244 struct nd_namespace_common *ndns = to_ndns(dev); in __holder_class_store() local
1246 if (dev->driver || ndns->claim) in __holder_class_store()
1254 ndns->claim_class = rc; in __holder_class_store()
1256 ndns->claim_class = NVDIMM_CCLASS_PFN; in __holder_class_store()
1258 ndns->claim_class = NVDIMM_CCLASS_DAX; in __holder_class_store()
1260 ndns->claim_class = NVDIMM_CCLASS_NONE; in __holder_class_store()
1289 struct nd_namespace_common *ndns = to_ndns(dev); in holder_class_show() local
1293 if (ndns->claim_class == NVDIMM_CCLASS_NONE) in holder_class_show()
1295 else if ((ndns->claim_class == NVDIMM_CCLASS_BTT) || in holder_class_show()
1296 (ndns->claim_class == NVDIMM_CCLASS_BTT2)) in holder_class_show()
1298 else if (ndns->claim_class == NVDIMM_CCLASS_PFN) in holder_class_show()
1300 else if (ndns->claim_class == NVDIMM_CCLASS_DAX) in holder_class_show()
1313 struct nd_namespace_common *ndns = to_ndns(dev); in mode_show() local
1319 claim = ndns->claim; in mode_show()
1433 struct nd_namespace_common *ndns = NULL; in nvdimm_namespace_common_probe() local
1438 ndns = nd_btt->ndns; in nvdimm_namespace_common_probe()
1440 ndns = nd_pfn->ndns; in nvdimm_namespace_common_probe()
1442 ndns = nd_dax->nd_pfn.ndns; in nvdimm_namespace_common_probe()
1444 if (!ndns) in nvdimm_namespace_common_probe()
1451 device_lock(&ndns->dev); in nvdimm_namespace_common_probe()
1452 device_unlock(&ndns->dev); in nvdimm_namespace_common_probe()
1453 if (ndns->dev.driver) { in nvdimm_namespace_common_probe()
1454 dev_dbg(&ndns->dev, "is active, can't bind %s\n", in nvdimm_namespace_common_probe()
1458 if (dev_WARN_ONCE(&ndns->dev, ndns->claim != dev, in nvdimm_namespace_common_probe()
1461 dev_name(ndns->claim))) in nvdimm_namespace_common_probe()
1464 ndns = to_ndns(dev); in nvdimm_namespace_common_probe()
1465 if (ndns->claim) { in nvdimm_namespace_common_probe()
1467 dev_name(ndns->claim)); in nvdimm_namespace_common_probe()
1473 if (nvdimm_namespace_locked(ndns)) in nvdimm_namespace_common_probe()
1476 size = nvdimm_namespace_capacity(ndns); in nvdimm_namespace_common_probe()
1478 dev_dbg(&ndns->dev, "%pa, too small must be at least %#x\n", in nvdimm_namespace_common_probe()
1489 struct nd_namespace_io *nsio = to_nd_namespace_io(&ndns->dev); in nvdimm_namespace_common_probe()
1494 dev_err(&ndns->dev, "%pr misaligned, unable to map\n", res); in nvdimm_namespace_common_probe()
1499 if (is_namespace_pmem(&ndns->dev)) { in nvdimm_namespace_common_probe()
1502 nspm = to_nd_namespace_pmem(&ndns->dev); in nvdimm_namespace_common_probe()
1503 if (uuid_not_set(nspm->uuid, &ndns->dev, __func__)) in nvdimm_namespace_common_probe()
1507 return ndns; in nvdimm_namespace_common_probe()
1511 int devm_namespace_enable(struct device *dev, struct nd_namespace_common *ndns, in devm_namespace_enable() argument
1514 return devm_nsio_enable(dev, to_nd_namespace_io(&ndns->dev), size); in devm_namespace_enable()
1518 void devm_namespace_disable(struct device *dev, struct nd_namespace_common *ndns) in devm_namespace_disable() argument
1520 devm_nsio_disable(dev, to_nd_namespace_io(&ndns->dev)); in devm_namespace_disable()