Lines Matching refs:nd_mapping

272 	struct nd_mapping *nd_mapping = &nd_region->mapping[0];
273 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
290 struct nd_mapping *nd_mapping = &nd_region->mapping[0];
291 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
422 struct nd_mapping *nd_mapping, struct nd_label_id *label_id,
426 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
485 struct nd_mapping *nd_mapping = &nd_region->mapping[i];
488 rc = scan_free(nd_region, nd_mapping, label_id, n);
497 struct nd_region *nd_region, struct nd_mapping *nd_mapping,
501 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
508 first_dpa = nd_mapping->start + nd_mapping->size - n;
510 first_dpa = nd_mapping->start;
558 struct nd_mapping *nd_mapping = &nd_region->mapping[0];
561 .nd_mapping = nd_mapping,
562 .available = nd_mapping->size,
595 struct nd_mapping *nd_mapping, struct nd_label_id *label_id,
598 resource_size_t mapping_end = nd_mapping->start + nd_mapping->size - 1;
600 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
609 valid.start = nd_mapping->start;
621 /* ignore resources outside this nd_mapping */
624 if (res->end < nd_mapping->start)
628 if (!first++ && res->start > nd_mapping->start) {
629 valid.start = nd_mapping->start;
742 return init_dpa_allocation(label_id, nd_region, nd_mapping, n);
747 struct nd_mapping *nd_mapping, struct nd_label_id *label_id)
749 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
794 struct nd_mapping *nd_mapping = &nd_region->mapping[i];
797 if (nd_mapping->nvdimm != nvdimm)
800 n = nd_pmem_available_dpa(nd_region, nd_mapping, &rem);
803 rem = scan_allocate(nd_region, nd_mapping, &label_id, n);
815 struct nd_mapping *nd_mapping)
817 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
826 struct nd_mapping *nd_mapping)
828 struct nvdimm *nvdimm = nd_mapping->nvdimm;
834 release_free_pmem(nvdimm_bus, nd_mapping);
859 struct nd_mapping *nd_mapping = &nd_region->mapping[i];
871 rc = reserve_free_pmem(nvdimm_bus, nd_mapping);
875 rem = scan_allocate(nd_region, nd_mapping,
878 release_free_pmem(nvdimm_bus, nd_mapping);
892 rc = merge_dpa(nd_region, nd_mapping, label_id);
912 struct nd_mapping *nd_mapping = &nd_region->mapping[0];
913 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
927 offset = (res->start - nd_mapping->start)
955 struct nd_mapping *nd_mapping;
998 nd_mapping = &nd_region->mapping[i];
999 ndd = to_ndd(nd_mapping);
1130 struct nd_mapping *nd_mapping = &nd_region->mapping[i];
1131 struct nvdimm *nvdimm = nd_mapping->nvdimm;
1204 struct nd_mapping *nd_mapping = &nd_region->mapping[i];
1213 if (list_empty(&nd_mapping->labels))
1220 struct nd_mapping *nd_mapping = &nd_region->mapping[i];
1221 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
1230 mutex_lock(&nd_mapping->lock);
1231 list_for_each_entry(label_ent, &nd_mapping->labels, list) {
1242 mutex_unlock(&nd_mapping->lock);
1403 struct nd_mapping *nd_mapping = &nd_region->mapping[i];
1404 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
1424 struct nd_mapping *nd_mapping = &nd_region->mapping[i];
1425 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
1841 struct nd_mapping *nd_mapping = &nd_region->mapping[i];
1843 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
1847 list_for_each_entry(label_ent, &nd_mapping->labels, list) {
1899 struct nd_mapping *nd_mapping = &nd_region->mapping[i];
1900 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
1905 lockdep_assert_held(&nd_mapping->lock);
1906 list_for_each_entry(label_ent, &nd_mapping->labels, list) {
1924 hw_start = nd_mapping->start;
1925 hw_end = hw_start + nd_mapping->size;
1938 list_move(&label_ent->list, &nd_mapping->labels);
1957 struct nd_mapping *nd_mapping;
2030 nd_mapping = &nd_region->mapping[i];
2031 label_ent = list_first_entry_or_null(&nd_mapping->labels,
2049 ndd = to_ndd(nd_mapping);
2222 struct nd_mapping *nd_mapping = &nd_region->mapping[0];
2223 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
2260 struct nd_mapping *nd_mapping = &nd_region->mapping[0];
2262 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
2347 struct nd_mapping *nd_mapping = &nd_region->mapping[0];
2348 resource_size_t map_end = nd_mapping->start + nd_mapping->size - 1;
2351 list_for_each_entry_safe(label_ent, e, &nd_mapping->labels, list) {
2366 if (__le64_to_cpu(nd_label->dpa) < nd_mapping->start ||
2385 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
2414 nd_mapping_free_labels(nd_mapping);
2446 nd_mapping = &nd_region->mapping[i];
2447 if (list_empty(&nd_mapping->labels)) {
2453 list_for_each_safe(l, e, &nd_mapping->labels) {
2458 nd_mapping_free_labels(nd_mapping);
2459 list_splice_init(&list, &nd_mapping->labels);
2482 struct nd_mapping *nd_mapping;
2491 nd_mapping = &nd_region->mapping[i];
2492 mutex_lock_nested(&nd_mapping->lock, i);
2500 nd_mapping = &nd_region->mapping[reverse];
2501 mutex_unlock(&nd_mapping->lock);
2513 struct nd_mapping *nd_mapping = &nd_region->mapping[i];
2514 struct nvdimm_drvdata *ndd = nd_mapping->ndd;
2515 struct nvdimm *nvdimm = nd_mapping->nvdimm;
2517 mutex_lock(&nd_mapping->lock);
2518 nd_mapping_free_labels(nd_mapping);
2519 mutex_unlock(&nd_mapping->lock);
2522 nd_mapping->ndd = NULL;
2533 struct nd_mapping *nd_mapping = &nd_region->mapping[i];
2534 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
2535 struct nvdimm *nvdimm = nd_mapping->nvdimm;
2552 dev_name(&nd_mapping->nvdimm->dev),
2558 nd_mapping->ndd = ndd;
2581 mutex_lock(&nd_mapping->lock);
2582 list_add_tail(&label_ent->list, &nd_mapping->labels);
2583 mutex_unlock(&nd_mapping->lock);