Lines Matching refs:nd_label

211 		struct nd_namespace_label *nd_label)  in to_slot()  argument
213 return nd_label - nd_label_base(ndd); in to_slot()
271 static bool slot_valid(struct nd_namespace_label *nd_label, u32 slot) in slot_valid() argument
274 if (slot != __le32_to_cpu(nd_label->slot)) in slot_valid()
278 if ((__le64_to_cpu(nd_label->dpa) in slot_valid()
279 | __le64_to_cpu(nd_label->rawsize)) % SZ_4K) in slot_valid()
295 struct nd_namespace_label *nd_label; in nd_label_reserve_dpa() local
302 nd_label = nd_label_base(ndd) + slot; in nd_label_reserve_dpa()
304 if (!slot_valid(nd_label, slot)) in nd_label_reserve_dpa()
307 memcpy(label_uuid, nd_label->uuid, NSLABEL_UUID_LEN); in nd_label_reserve_dpa()
308 flags = __le32_to_cpu(nd_label->flags); in nd_label_reserve_dpa()
311 __le64_to_cpu(nd_label->dpa), in nd_label_reserve_dpa()
312 __le64_to_cpu(nd_label->rawsize)); in nd_label_reserve_dpa()
332 struct nd_namespace_label *nd_label; in nd_label_active_count() local
334 nd_label = nd_label_base(ndd) + slot; in nd_label_active_count()
336 if (!slot_valid(nd_label, slot)) { in nd_label_active_count()
337 u32 label_slot = __le32_to_cpu(nd_label->slot); in nd_label_active_count()
338 u64 size = __le64_to_cpu(nd_label->rawsize); in nd_label_active_count()
339 u64 dpa = __le64_to_cpu(nd_label->dpa); in nd_label_active_count()
361 struct nd_namespace_label *nd_label; in nd_label_active() local
363 nd_label = nd_label_base(ndd) + slot; in nd_label_active()
364 if (!slot_valid(nd_label, slot)) in nd_label_active()
487 struct nd_namespace_label *nd_label) in nd_label_offset() argument
489 return (unsigned long) nd_label in nd_label_offset()
500 struct nd_namespace_label *nd_label; in __pmem_label_update() local
516 nd_label = nd_label_base(ndd) + slot; in __pmem_label_update()
517 memset(nd_label, 0, sizeof(struct nd_namespace_label)); in __pmem_label_update()
518 memcpy(nd_label->uuid, nspm->uuid, NSLABEL_UUID_LEN); in __pmem_label_update()
520 memcpy(nd_label->name, nspm->alt_name, NSLABEL_NAME_LEN); in __pmem_label_update()
521 nd_label->flags = __cpu_to_le32(NSLABEL_FLAG_UPDATING); in __pmem_label_update()
522 nd_label->nlabel = __cpu_to_le16(nd_region->ndr_mappings); in __pmem_label_update()
523 nd_label->position = __cpu_to_le16(pos); in __pmem_label_update()
524 nd_label->isetcookie = __cpu_to_le64(cookie); in __pmem_label_update()
527 nd_label->rawsize = __cpu_to_le64(rawsize); in __pmem_label_update()
528 nd_label->dpa = __cpu_to_le64(nd_mapping->start); in __pmem_label_update()
529 nd_label->slot = __cpu_to_le32(slot); in __pmem_label_update()
532 offset = nd_label_offset(ndd, nd_label); in __pmem_label_update()
533 rc = nvdimm_set_config_data(ndd, offset, nd_label, in __pmem_label_update()
552 nd_mapping->labels[0] = nd_label; in __pmem_label_update()
559 struct nd_namespace_label *next_label, *nd_label; in del_label() local
564 nd_label = nd_mapping->labels[l]; in del_label()
565 slot = to_slot(ndd, nd_label); in del_label()
586 struct nd_namespace_label *nd_label) in to_resource() argument
591 if (res->start != __le64_to_cpu(nd_label->dpa)) in to_resource()
593 if (resource_size(res) != __le64_to_cpu(nd_label->rawsize)) in to_resource()
612 struct nd_namespace_label *nd_label; in __blk_label_update() local
653 nd_label = nd_label_base(ndd) + slot; in __blk_label_update()
654 memcpy(uuid, nd_label->uuid, NSLABEL_UUID_LEN); in __blk_label_update()
657 res = to_resource(ndd, nd_label); in __blk_label_update()
661 slot = to_slot(ndd, nd_label); in __blk_label_update()
699 nd_label = nd_label_base(ndd) + slot; in __blk_label_update()
700 memset(nd_label, 0, sizeof(struct nd_namespace_label)); in __blk_label_update()
701 memcpy(nd_label->uuid, nsblk->uuid, NSLABEL_UUID_LEN); in __blk_label_update()
703 memcpy(nd_label->name, nsblk->alt_name, in __blk_label_update()
705 nd_label->flags = __cpu_to_le32(NSLABEL_FLAG_LOCAL); in __blk_label_update()
706 nd_label->nlabel = __cpu_to_le16(0); /* N/A */ in __blk_label_update()
707 nd_label->position = __cpu_to_le16(0); /* N/A */ in __blk_label_update()
708 nd_label->isetcookie = __cpu_to_le64(0); /* N/A */ in __blk_label_update()
709 nd_label->dpa = __cpu_to_le64(res->start); in __blk_label_update()
710 nd_label->rawsize = __cpu_to_le64(resource_size(res)); in __blk_label_update()
711 nd_label->lbasize = __cpu_to_le64(nsblk->lbasize); in __blk_label_update()
712 nd_label->slot = __cpu_to_le32(slot); in __blk_label_update()
715 offset = nd_label_offset(ndd, nd_label); in __blk_label_update()
716 rc = nvdimm_set_config_data(ndd, offset, nd_label, in __blk_label_update()
739 for_each_label(l, nd_label, nd_mapping->labels) { in __blk_label_update()
741 memcpy(uuid, nd_label->uuid, NSLABEL_UUID_LEN); in __blk_label_update()
759 nd_label = nd_label_base(ndd) + slot; in __blk_label_update()
760 memcpy(uuid, nd_label->uuid, NSLABEL_UUID_LEN); in __blk_label_update()
763 res = to_resource(ndd, nd_label); in __blk_label_update()
767 nd_mapping->labels[l++] = nd_label; in __blk_label_update()
793 struct nd_namespace_label *nd_label; in init_labels() local
797 for_each_label(l, nd_label, nd_mapping->labels) in init_labels()
840 struct nd_namespace_label *nd_label; in del_labels() local
855 for_each_label(l, nd_label, nd_mapping->labels) { in del_labels()
856 memcpy(label_uuid, nd_label->uuid, NSLABEL_UUID_LEN); in del_labels()
859 slot = to_slot(ndd, nd_label); in del_labels()