Lines Matching refs:nd_mapping

302 	struct nd_mapping *nd_mapping = &nd_region->mapping[0];  in nd_namespace_blk_size()  local
303 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in nd_namespace_blk_size()
320 struct nd_mapping *nd_mapping = &nd_region->mapping[0]; in __nd_namespace_blk_validate() local
321 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in __nd_namespace_blk_validate()
452 struct nd_mapping *nd_mapping, struct nd_label_id *label_id, in scan_free() argument
456 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in scan_free()
515 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in shrink_dpa_allocation() local
518 rc = scan_free(nd_region, nd_mapping, label_id, n); in shrink_dpa_allocation()
527 struct nd_region *nd_region, struct nd_mapping *nd_mapping, in init_dpa_allocation() argument
531 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in init_dpa_allocation()
538 first_dpa = nd_mapping->start + nd_mapping->size - n; in init_dpa_allocation()
540 first_dpa = nd_mapping->start; in init_dpa_allocation()
583 struct nd_mapping *nd_mapping = &nd_region->mapping[0]; in space_valid() local
586 .nd_mapping = nd_mapping, in space_valid()
587 .available = nd_mapping->size, in space_valid()
620 struct nd_mapping *nd_mapping, struct nd_label_id *label_id, in scan_allocate() argument
623 resource_size_t mapping_end = nd_mapping->start + nd_mapping->size - 1; in scan_allocate()
625 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in scan_allocate()
634 valid.start = nd_mapping->start; in scan_allocate()
649 if (res->end < nd_mapping->start) in scan_allocate()
653 if (!first++ && res->start > nd_mapping->start) { in scan_allocate()
654 valid.start = nd_mapping->start; in scan_allocate()
767 return init_dpa_allocation(label_id, nd_region, nd_mapping, n); in scan_allocate()
772 struct nd_mapping *nd_mapping, struct nd_label_id *label_id) in merge_dpa() argument
774 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in merge_dpa()
819 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in __reserve_free_pmem() local
822 if (nd_mapping->nvdimm != nvdimm) in __reserve_free_pmem()
825 n = nd_pmem_available_dpa(nd_region, nd_mapping, &rem); in __reserve_free_pmem()
828 rem = scan_allocate(nd_region, nd_mapping, &label_id, n); in __reserve_free_pmem()
840 struct nd_mapping *nd_mapping) in release_free_pmem() argument
842 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in release_free_pmem()
851 struct nd_mapping *nd_mapping) in reserve_free_pmem() argument
853 struct nvdimm *nvdimm = nd_mapping->nvdimm; in reserve_free_pmem()
859 release_free_pmem(nvdimm_bus, nd_mapping); in reserve_free_pmem()
884 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in grow_dpa_allocation() local
896 rc = reserve_free_pmem(nvdimm_bus, nd_mapping); in grow_dpa_allocation()
900 rem = scan_allocate(nd_region, nd_mapping, in grow_dpa_allocation()
903 release_free_pmem(nvdimm_bus, nd_mapping); in grow_dpa_allocation()
917 rc = merge_dpa(nd_region, nd_mapping, label_id); in grow_dpa_allocation()
937 struct nd_mapping *nd_mapping = &nd_region->mapping[0]; in nd_namespace_pmem_set_resource() local
938 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in nd_namespace_pmem_set_resource()
952 offset = (res->start - nd_mapping->start) in nd_namespace_pmem_set_resource()
980 struct nd_mapping *nd_mapping; in __size_store() local
1023 nd_mapping = &nd_region->mapping[i]; in __size_store()
1024 ndd = to_ndd(nd_mapping); in __size_store()
1155 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in nvdimm_namespace_locked() local
1156 struct nvdimm *nvdimm = nd_mapping->nvdimm; in nvdimm_namespace_locked()
1229 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in namespace_update_uuid() local
1238 if (list_empty(&nd_mapping->labels)) in namespace_update_uuid()
1245 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in namespace_update_uuid() local
1246 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in namespace_update_uuid()
1413 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in dpa_extents_show() local
1414 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in dpa_extents_show()
1434 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in btt_claim_class() local
1435 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in btt_claim_class()
1788 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in has_uuid_at_pos() local
1790 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in has_uuid_at_pos()
1794 list_for_each_entry(label_ent, &nd_mapping->labels, list) { in has_uuid_at_pos()
1846 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in select_pmem_id() local
1847 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in select_pmem_id()
1852 lockdep_assert_held(&nd_mapping->lock); in select_pmem_id()
1853 list_for_each_entry(label_ent, &nd_mapping->labels, list) { in select_pmem_id()
1871 hw_start = nd_mapping->start; in select_pmem_id()
1872 hw_end = hw_start + nd_mapping->size; in select_pmem_id()
1885 list_move(&label_ent->list, &nd_mapping->labels); in select_pmem_id()
1904 struct nd_mapping *nd_mapping; in create_namespace_pmem() local
1977 nd_mapping = &nd_region->mapping[i]; in create_namespace_pmem()
1978 label_ent = list_first_entry_or_null(&nd_mapping->labels, in create_namespace_pmem()
1996 ndd = to_ndd(nd_mapping); in create_namespace_pmem()
2172 struct nd_mapping *nd_mapping = &nd_region->mapping[0]; in add_namespace_resource() local
2173 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in add_namespace_resource()
2210 struct nd_mapping *nd_mapping = &nd_region->mapping[0]; in create_namespace_blk() local
2212 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in create_namespace_blk()
2294 struct nd_mapping *nd_mapping = &nd_region->mapping[0]; in scan_labels() local
2295 resource_size_t map_end = nd_mapping->start + nd_mapping->size - 1; in scan_labels()
2298 list_for_each_entry_safe(label_ent, e, &nd_mapping->labels, list) { in scan_labels()
2313 if (nd_label->dpa < nd_mapping->start || nd_label->dpa > map_end) in scan_labels()
2331 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in scan_labels()
2360 nd_mapping_free_labels(nd_mapping); in scan_labels()
2392 nd_mapping = &nd_region->mapping[i]; in scan_labels()
2393 if (list_empty(&nd_mapping->labels)) { in scan_labels()
2399 list_for_each_safe(l, e, &nd_mapping->labels) { in scan_labels()
2404 nd_mapping_free_labels(nd_mapping); in scan_labels()
2405 list_splice_init(&list, &nd_mapping->labels); in scan_labels()
2428 struct nd_mapping *nd_mapping; in create_namespaces() local
2437 nd_mapping = &nd_region->mapping[i]; in create_namespaces()
2438 mutex_lock_nested(&nd_mapping->lock, i); in create_namespaces()
2446 nd_mapping = &nd_region->mapping[reverse]; in create_namespaces()
2447 mutex_unlock(&nd_mapping->lock); in create_namespaces()
2458 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in init_active_labels() local
2459 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in init_active_labels()
2460 struct nvdimm *nvdimm = nd_mapping->nvdimm; in init_active_labels()
2477 dev_name(&nd_mapping->nvdimm->dev), in init_active_labels()
2482 nd_mapping->ndd = ndd; in init_active_labels()
2499 mutex_lock(&nd_mapping->lock); in init_active_labels()
2500 list_add_tail(&label_ent->list, &nd_mapping->labels); in init_active_labels()
2501 mutex_unlock(&nd_mapping->lock); in init_active_labels()
2507 mutex_lock(&nd_mapping->lock); in init_active_labels()
2508 nd_mapping_free_labels(nd_mapping); in init_active_labels()
2509 mutex_unlock(&nd_mapping->lock); in init_active_labels()