• Home
  • Raw
  • Download

Lines Matching refs:ndns

108 	struct nd_namespace_common *ndns = to_ndns(dev);  in pmem_should_map_pages()  local
120 if (ndns->force_raw) in pmem_should_map_pages()
133 unsigned int pmem_sector_size(struct nd_namespace_common *ndns) in pmem_sector_size() argument
135 if (is_namespace_pmem(&ndns->dev)) { in pmem_sector_size()
138 nspm = to_nd_namespace_pmem(&ndns->dev); in pmem_sector_size()
144 dev_WARN(&ndns->dev, "unsupported sector size: %ld\n", in pmem_sector_size()
156 const char *nvdimm_namespace_disk_name(struct nd_namespace_common *ndns, in nvdimm_namespace_disk_name() argument
159 struct nd_region *nd_region = to_nd_region(ndns->dev.parent); in nvdimm_namespace_disk_name()
162 if (ndns->claim && is_nd_btt(ndns->claim)) in nvdimm_namespace_disk_name()
165 if (is_namespace_pmem(&ndns->dev) || is_namespace_io(&ndns->dev)) { in nvdimm_namespace_disk_name()
168 if (is_namespace_pmem(&ndns->dev)) { in nvdimm_namespace_disk_name()
171 nspm = to_nd_namespace_pmem(&ndns->dev); in nvdimm_namespace_disk_name()
181 } else if (is_namespace_blk(&ndns->dev)) { in nvdimm_namespace_disk_name()
184 nsblk = to_nd_namespace_blk(&ndns->dev); in nvdimm_namespace_disk_name()
954 struct nd_namespace_common *ndns = to_ndns(dev); in __size_store() local
962 if (dev->driver || ndns->claim) in __size_store()
1042 if (val == 0 && id != 0 && nd_region->ns_seed != dev && !ndns->claim) in __size_store()
1091 resource_size_t __nvdimm_namespace_capacity(struct nd_namespace_common *ndns) in __nvdimm_namespace_capacity() argument
1093 struct device *dev = &ndns->dev; in __nvdimm_namespace_capacity()
1110 resource_size_t nvdimm_namespace_capacity(struct nd_namespace_common *ndns) in nvdimm_namespace_capacity() argument
1114 nvdimm_bus_lock(&ndns->dev); in nvdimm_namespace_capacity()
1115 size = __nvdimm_namespace_capacity(ndns); in nvdimm_namespace_capacity()
1116 nvdimm_bus_unlock(&ndns->dev); in nvdimm_namespace_capacity()
1122 bool nvdimm_namespace_locked(struct nd_namespace_common *ndns) in nvdimm_namespace_locked() argument
1126 struct device *dev = &ndns->dev; in nvdimm_namespace_locked()
1482 struct nd_namespace_common *ndns = to_ndns(dev); in holder_show() local
1486 rc = sprintf(buf, "%s\n", ndns->claim ? dev_name(ndns->claim) : ""); in holder_show()
1495 struct nd_namespace_common *ndns = to_ndns(dev); in __holder_class_store() local
1497 if (dev->driver || ndns->claim) in __holder_class_store()
1505 ndns->claim_class = rc; in __holder_class_store()
1507 ndns->claim_class = NVDIMM_CCLASS_PFN; in __holder_class_store()
1509 ndns->claim_class = NVDIMM_CCLASS_DAX; in __holder_class_store()
1511 ndns->claim_class = NVDIMM_CCLASS_NONE; in __holder_class_store()
1540 struct nd_namespace_common *ndns = to_ndns(dev); in holder_class_show() local
1544 if (ndns->claim_class == NVDIMM_CCLASS_NONE) in holder_class_show()
1546 else if ((ndns->claim_class == NVDIMM_CCLASS_BTT) || in holder_class_show()
1547 (ndns->claim_class == NVDIMM_CCLASS_BTT2)) in holder_class_show()
1549 else if (ndns->claim_class == NVDIMM_CCLASS_PFN) in holder_class_show()
1551 else if (ndns->claim_class == NVDIMM_CCLASS_DAX) in holder_class_show()
1564 struct nd_namespace_common *ndns = to_ndns(dev); in mode_show() local
1570 claim = ndns->claim; in mode_show()
1698 struct nd_namespace_common *ndns = NULL; in nvdimm_namespace_common_probe() local
1703 ndns = nd_btt->ndns; in nvdimm_namespace_common_probe()
1705 ndns = nd_pfn->ndns; in nvdimm_namespace_common_probe()
1707 ndns = nd_dax->nd_pfn.ndns; in nvdimm_namespace_common_probe()
1709 if (!ndns) in nvdimm_namespace_common_probe()
1716 nd_device_lock(&ndns->dev); in nvdimm_namespace_common_probe()
1717 nd_device_unlock(&ndns->dev); in nvdimm_namespace_common_probe()
1718 if (ndns->dev.driver) { in nvdimm_namespace_common_probe()
1719 dev_dbg(&ndns->dev, "is active, can't bind %s\n", in nvdimm_namespace_common_probe()
1723 if (dev_WARN_ONCE(&ndns->dev, ndns->claim != dev, in nvdimm_namespace_common_probe()
1726 dev_name(ndns->claim))) in nvdimm_namespace_common_probe()
1729 ndns = to_ndns(dev); in nvdimm_namespace_common_probe()
1730 if (ndns->claim) { in nvdimm_namespace_common_probe()
1732 dev_name(ndns->claim)); in nvdimm_namespace_common_probe()
1738 if (nvdimm_namespace_locked(ndns)) in nvdimm_namespace_common_probe()
1741 size = nvdimm_namespace_capacity(ndns); in nvdimm_namespace_common_probe()
1743 dev_dbg(&ndns->dev, "%pa, too small must be at least %#x\n", in nvdimm_namespace_common_probe()
1754 struct nd_namespace_io *nsio = to_nd_namespace_io(&ndns->dev); in nvdimm_namespace_common_probe()
1759 dev_err(&ndns->dev, "%pr misaligned, unable to map\n", res); in nvdimm_namespace_common_probe()
1764 if (is_namespace_pmem(&ndns->dev)) { in nvdimm_namespace_common_probe()
1767 nspm = to_nd_namespace_pmem(&ndns->dev); in nvdimm_namespace_common_probe()
1768 if (uuid_not_set(nspm->uuid, &ndns->dev, __func__)) in nvdimm_namespace_common_probe()
1770 } else if (is_namespace_blk(&ndns->dev)) { in nvdimm_namespace_common_probe()
1773 nsblk = to_nd_namespace_blk(&ndns->dev); in nvdimm_namespace_common_probe()
1774 if (uuid_not_set(nsblk->uuid, &ndns->dev, __func__)) in nvdimm_namespace_common_probe()
1777 dev_dbg(&ndns->dev, "sector size not set\n"); in nvdimm_namespace_common_probe()
1784 return ndns; in nvdimm_namespace_common_probe()
1788 int devm_namespace_enable(struct device *dev, struct nd_namespace_common *ndns, in devm_namespace_enable() argument
1791 if (is_namespace_blk(&ndns->dev)) in devm_namespace_enable()
1793 return devm_nsio_enable(dev, to_nd_namespace_io(&ndns->dev), size); in devm_namespace_enable()
1797 void devm_namespace_disable(struct device *dev, struct nd_namespace_common *ndns) in devm_namespace_disable() argument
1799 if (is_namespace_blk(&ndns->dev)) in devm_namespace_disable()
1801 devm_nsio_disable(dev, to_nd_namespace_io(&ndns->dev)); in devm_namespace_disable()