Lines Matching refs:nd_mapping
297 struct nd_mapping *nd_mapping, struct nd_label_id *label_id, in scan_free() argument
300 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in scan_free()
351 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in shrink_dpa_allocation() local
354 rc = scan_free(nd_region, nd_mapping, label_id, n); in shrink_dpa_allocation()
363 struct nd_region *nd_region, struct nd_mapping *nd_mapping, in init_dpa_allocation() argument
366 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in init_dpa_allocation()
371 res = nvdimm_allocate_dpa(ndd, label_id, nd_mapping->start, n); in init_dpa_allocation()
437 struct nd_mapping *nd_mapping, struct nd_label_id *label_id, in scan_allocate() argument
440 resource_size_t mapping_end = nd_mapping->start + nd_mapping->size - 1; in scan_allocate()
441 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in scan_allocate()
450 valid.start = nd_mapping->start; in scan_allocate()
465 if (res->end < nd_mapping->start) in scan_allocate()
469 if (!first++ && res->start > nd_mapping->start) { in scan_allocate()
470 valid.start = nd_mapping->start; in scan_allocate()
574 return init_dpa_allocation(label_id, nd_region, nd_mapping, n); in scan_allocate()
579 struct nd_mapping *nd_mapping, struct nd_label_id *label_id) in merge_dpa() argument
581 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in merge_dpa()
626 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in __reserve_free_pmem() local
629 if (nd_mapping->nvdimm != nvdimm) in __reserve_free_pmem()
632 n = nd_pmem_available_dpa(nd_region, nd_mapping); in __reserve_free_pmem()
635 rem = scan_allocate(nd_region, nd_mapping, &label_id, n); in __reserve_free_pmem()
647 struct nd_mapping *nd_mapping) in release_free_pmem() argument
649 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in release_free_pmem()
678 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in grow_dpa_allocation() local
682 rem = scan_allocate(nd_region, nd_mapping, label_id, rem); in grow_dpa_allocation()
690 rc = merge_dpa(nd_region, nd_mapping, label_id); in grow_dpa_allocation()
710 struct nd_mapping *nd_mapping = &nd_region->mapping[0]; in nd_namespace_pmem_set_resource() local
711 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in nd_namespace_pmem_set_resource()
725 offset = (res->start - nd_mapping->start) in nd_namespace_pmem_set_resource()
754 struct nd_mapping *nd_mapping; in __size_store() local
791 nd_mapping = &nd_region->mapping[i]; in __size_store()
792 ndd = to_ndd(nd_mapping); in __size_store()
912 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in nvdimm_namespace_locked() local
913 struct nvdimm *nvdimm = nd_mapping->nvdimm; in nvdimm_namespace_locked()
984 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in namespace_update_uuid() local
993 if (list_empty(&nd_mapping->labels)) in namespace_update_uuid()
1000 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in namespace_update_uuid() local
1001 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in namespace_update_uuid()
1010 mutex_lock(&nd_mapping->lock); in namespace_update_uuid()
1011 list_for_each_entry(label_ent, &nd_mapping->labels, list) { in namespace_update_uuid()
1024 mutex_unlock(&nd_mapping->lock); in namespace_update_uuid()
1161 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in dpa_extents_show() local
1162 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in dpa_extents_show()
1182 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in btt_claim_class() local
1183 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in btt_claim_class()
1569 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in has_uuid_at_pos() local
1571 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in has_uuid_at_pos()
1575 list_for_each_entry(label_ent, &nd_mapping->labels, list) { in has_uuid_at_pos()
1616 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in select_pmem_id() local
1617 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in select_pmem_id()
1622 lockdep_assert_held(&nd_mapping->lock); in select_pmem_id()
1623 list_for_each_entry(label_ent, &nd_mapping->labels, list) { in select_pmem_id()
1641 hw_start = nd_mapping->start; in select_pmem_id()
1642 hw_end = hw_start + nd_mapping->size; in select_pmem_id()
1656 list_move(&label_ent->list, &nd_mapping->labels); in select_pmem_id()
1670 struct nd_mapping *nd_mapping, in create_namespace_pmem() argument
1673 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in create_namespace_pmem()
1752 nd_mapping = &nd_region->mapping[i]; in create_namespace_pmem()
1753 label_ent = list_first_entry_or_null(&nd_mapping->labels, in create_namespace_pmem()
1762 ndd = to_ndd(nd_mapping); in create_namespace_pmem()
1893 struct nd_mapping *nd_mapping = &nd_region->mapping[0]; in add_namespace_resource() local
1894 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in add_namespace_resource()
1936 struct nd_mapping *nd_mapping = &nd_region->mapping[0]; in scan_labels() local
1937 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in scan_labels()
1938 resource_size_t map_end = nd_mapping->start + nd_mapping->size - 1; in scan_labels()
1945 list_for_each_entry_safe(label_ent, e, &nd_mapping->labels, list) { in scan_labels()
1953 if (nsl_get_dpa(ndd, nd_label) < nd_mapping->start || in scan_labels()
1971 dev = create_namespace_pmem(nd_region, nd_mapping, nd_label); in scan_labels()
1992 nd_mapping_free_labels(nd_mapping); in scan_labels()
2008 nd_mapping = &nd_region->mapping[i]; in scan_labels()
2009 if (list_empty(&nd_mapping->labels)) { in scan_labels()
2015 list_for_each_safe(l, e, &nd_mapping->labels) { in scan_labels()
2020 nd_mapping_free_labels(nd_mapping); in scan_labels()
2021 list_splice_init(&list, &nd_mapping->labels); in scan_labels()
2040 struct nd_mapping *nd_mapping; in create_namespaces() local
2049 nd_mapping = &nd_region->mapping[i]; in create_namespaces()
2050 mutex_lock_nested(&nd_mapping->lock, i); in create_namespaces()
2058 nd_mapping = &nd_region->mapping[reverse]; in create_namespaces()
2059 mutex_unlock(&nd_mapping->lock); in create_namespaces()
2071 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in deactivate_labels() local
2072 struct nvdimm_drvdata *ndd = nd_mapping->ndd; in deactivate_labels()
2073 struct nvdimm *nvdimm = nd_mapping->nvdimm; in deactivate_labels()
2075 mutex_lock(&nd_mapping->lock); in deactivate_labels()
2076 nd_mapping_free_labels(nd_mapping); in deactivate_labels()
2077 mutex_unlock(&nd_mapping->lock); in deactivate_labels()
2080 nd_mapping->ndd = NULL; in deactivate_labels()
2091 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in init_active_labels() local
2092 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in init_active_labels()
2093 struct nvdimm *nvdimm = nd_mapping->nvdimm; in init_active_labels()
2110 dev_name(&nd_mapping->nvdimm->dev), in init_active_labels()
2116 nd_mapping->ndd = ndd; in init_active_labels()
2133 mutex_lock(&nd_mapping->lock); in init_active_labels()
2134 list_add_tail(&label_ent->list, &nd_mapping->labels); in init_active_labels()
2135 mutex_unlock(&nd_mapping->lock); in init_active_labels()