Lines Matching refs:nd_mapping

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