Lines Matching refs:nd_mapping

748 static void reap_victim(struct nd_mapping *nd_mapping,  in reap_victim()  argument
751 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in reap_victim()
760 struct nd_mapping *nd_mapping, struct nd_namespace_pmem *nspm, in __pmem_label_update() argument
765 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in __pmem_label_update()
833 mutex_lock(&nd_mapping->lock); in __pmem_label_update()
834 list_for_each_entry(label_ent, &nd_mapping->labels, list) { in __pmem_label_update()
840 reap_victim(nd_mapping, label_ent); in __pmem_label_update()
847 list_for_each_entry(label_ent, &nd_mapping->labels, list) in __pmem_label_update()
859 mutex_unlock(&nd_mapping->lock); in __pmem_label_update()
898 struct nd_mapping *nd_mapping, struct nd_namespace_blk *nsblk, in __blk_label_update() argument
904 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in __blk_label_update()
1079 mutex_lock(&nd_mapping->lock); in __blk_label_update()
1080 list_for_each_entry_safe(label_ent, e, &nd_mapping->labels, list) { in __blk_label_update()
1092 list_splice_tail_init(&list, &nd_mapping->labels); in __blk_label_update()
1093 mutex_unlock(&nd_mapping->lock); in __blk_label_update()
1105 mutex_lock(&nd_mapping->lock); in __blk_label_update()
1106 label_ent = list_first_entry_or_null(&nd_mapping->labels, in __blk_label_update()
1110 mutex_unlock(&nd_mapping->lock); in __blk_label_update()
1122 list_for_each_entry_from(label_ent, &nd_mapping->labels, list) { in __blk_label_update()
1133 mutex_unlock(&nd_mapping->lock); in __blk_label_update()
1153 static int init_labels(struct nd_mapping *nd_mapping, int num_labels) in init_labels() argument
1158 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in init_labels()
1160 mutex_lock(&nd_mapping->lock); in init_labels()
1161 list_for_each_entry(label_ent, &nd_mapping->labels, list) in init_labels()
1163 mutex_unlock(&nd_mapping->lock); in init_labels()
1173 mutex_lock(&nd_mapping->lock); in init_labels()
1174 list_add_tail(&label_ent->list, &nd_mapping->labels); in init_labels()
1175 mutex_unlock(&nd_mapping->lock); in init_labels()
1197 static int del_labels(struct nd_mapping *nd_mapping, u8 *uuid) in del_labels() argument
1199 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in del_labels()
1215 mutex_lock(&nd_mapping->lock); in del_labels()
1216 list_for_each_entry_safe(label_ent, e, &nd_mapping->labels, list) { in del_labels()
1232 list_splice_tail_init(&list, &nd_mapping->labels); in del_labels()
1235 nd_mapping_free_labels(nd_mapping); in del_labels()
1238 mutex_unlock(&nd_mapping->lock); in del_labels()
1250 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in nd_pmem_namespace_label_update() local
1251 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in nd_pmem_namespace_label_update()
1256 rc = del_labels(nd_mapping, nspm->uuid); in nd_pmem_namespace_label_update()
1267 rc = init_labels(nd_mapping, count); in nd_pmem_namespace_label_update()
1271 rc = __pmem_label_update(nd_region, nd_mapping, nspm, i, in nd_pmem_namespace_label_update()
1282 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in nd_pmem_namespace_label_update() local
1284 rc = __pmem_label_update(nd_region, nd_mapping, nspm, i, 0); in nd_pmem_namespace_label_update()
1295 struct nd_mapping *nd_mapping = &nd_region->mapping[0]; in nd_blk_namespace_label_update() local
1300 return del_labels(nd_mapping, nsblk->uuid); in nd_blk_namespace_label_update()
1302 for_each_dpa_resource(to_ndd(nd_mapping), res) in nd_blk_namespace_label_update()
1305 count = init_labels(nd_mapping, count); in nd_blk_namespace_label_update()
1309 return __blk_label_update(nd_region, nd_mapping, nsblk, count); in nd_blk_namespace_label_update()