Lines Matching +full:state +full:- +full:labels

1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright(c) 2013-2015 Intel Corporation. All rights reserved.
20 * support and is an input to the geometry/on-disk-format of a
42 if (ndd->cxl) in nsl_ref_name()
43 return nd_label->cxl.name; in nsl_ref_name()
44 return nd_label->efi.name; in nsl_ref_name()
50 if (ndd->cxl) in nsl_get_name()
51 return memcpy(name, nd_label->cxl.name, NSLABEL_NAME_LEN); in nsl_get_name()
52 return memcpy(name, nd_label->efi.name, NSLABEL_NAME_LEN); in nsl_get_name()
60 if (ndd->cxl) in nsl_set_name()
61 return memcpy(nd_label->cxl.name, name, NSLABEL_NAME_LEN); in nsl_set_name()
62 return memcpy(nd_label->efi.name, name, NSLABEL_NAME_LEN); in nsl_set_name()
68 if (ndd->cxl) in nsl_get_slot()
69 return __le32_to_cpu(nd_label->cxl.slot); in nsl_get_slot()
70 return __le32_to_cpu(nd_label->efi.slot); in nsl_get_slot()
76 if (ndd->cxl) in nsl_set_slot()
77 nd_label->cxl.slot = __cpu_to_le32(slot); in nsl_set_slot()
79 nd_label->efi.slot = __cpu_to_le32(slot); in nsl_set_slot()
85 if (ndd->cxl) in nsl_get_checksum()
86 return __le64_to_cpu(nd_label->cxl.checksum); in nsl_get_checksum()
87 return __le64_to_cpu(nd_label->efi.checksum); in nsl_get_checksum()
94 if (ndd->cxl) in nsl_set_checksum()
95 nd_label->cxl.checksum = __cpu_to_le64(checksum); in nsl_set_checksum()
97 nd_label->efi.checksum = __cpu_to_le64(checksum); in nsl_set_checksum()
103 if (ndd->cxl) in nsl_get_flags()
104 return __le32_to_cpu(nd_label->cxl.flags); in nsl_get_flags()
105 return __le32_to_cpu(nd_label->efi.flags); in nsl_get_flags()
111 if (ndd->cxl) in nsl_set_flags()
112 nd_label->cxl.flags = __cpu_to_le32(flags); in nsl_set_flags()
114 nd_label->efi.flags = __cpu_to_le32(flags); in nsl_set_flags()
120 if (ndd->cxl) in nsl_get_dpa()
121 return __le64_to_cpu(nd_label->cxl.dpa); in nsl_get_dpa()
122 return __le64_to_cpu(nd_label->efi.dpa); in nsl_get_dpa()
128 if (ndd->cxl) in nsl_set_dpa()
129 nd_label->cxl.dpa = __cpu_to_le64(dpa); in nsl_set_dpa()
131 nd_label->efi.dpa = __cpu_to_le64(dpa); in nsl_set_dpa()
137 if (ndd->cxl) in nsl_get_rawsize()
138 return __le64_to_cpu(nd_label->cxl.rawsize); in nsl_get_rawsize()
139 return __le64_to_cpu(nd_label->efi.rawsize); in nsl_get_rawsize()
146 if (ndd->cxl) in nsl_set_rawsize()
147 nd_label->cxl.rawsize = __cpu_to_le64(rawsize); in nsl_set_rawsize()
149 nd_label->efi.rawsize = __cpu_to_le64(rawsize); in nsl_set_rawsize()
156 if (dev_WARN_ONCE(ndd->dev, ndd->cxl, in nsl_get_isetcookie()
157 "CXL labels do not use the isetcookie concept\n")) in nsl_get_isetcookie()
159 return __le64_to_cpu(nd_label->efi.isetcookie); in nsl_get_isetcookie()
166 if (!ndd->cxl) in nsl_set_isetcookie()
167 nd_label->efi.isetcookie = __cpu_to_le64(isetcookie); in nsl_set_isetcookie()
178 if (ndd->cxl) in nsl_validate_isetcookie()
180 return cookie == __le64_to_cpu(nd_label->efi.isetcookie); in nsl_validate_isetcookie()
186 if (ndd->cxl) in nsl_get_position()
187 return __le16_to_cpu(nd_label->cxl.position); in nsl_get_position()
188 return __le16_to_cpu(nd_label->efi.position); in nsl_get_position()
195 if (ndd->cxl) in nsl_set_position()
196 nd_label->cxl.position = __cpu_to_le16(position); in nsl_set_position()
198 nd_label->efi.position = __cpu_to_le16(position); in nsl_set_position()
204 if (ndd->cxl) in nsl_get_nlabel()
206 return __le16_to_cpu(nd_label->efi.nlabel); in nsl_get_nlabel()
213 if (!ndd->cxl) in nsl_set_nlabel()
214 nd_label->efi.nlabel = __cpu_to_le16(nlabel); in nsl_set_nlabel()
220 if (ndd->cxl) in nsl_get_nrange()
221 return __le16_to_cpu(nd_label->cxl.nrange); in nsl_get_nrange()
229 if (ndd->cxl) in nsl_set_nrange()
230 nd_label->cxl.nrange = __cpu_to_le16(nrange); in nsl_set_nrange()
237 * Yes, for some reason the EFI labels convey a massive 64-bit in nsl_get_lbasize()
240 if (ndd->cxl) in nsl_get_lbasize()
241 return __le16_to_cpu(nd_label->cxl.lbasize); in nsl_get_lbasize()
242 return __le64_to_cpu(nd_label->efi.lbasize); in nsl_get_lbasize()
249 if (ndd->cxl) in nsl_set_lbasize()
250 nd_label->cxl.lbasize = __cpu_to_le16(lbasize); in nsl_set_lbasize()
252 nd_label->efi.lbasize = __cpu_to_le64(lbasize); in nsl_set_lbasize()
259 if (ndd->cxl) in nsl_get_uuid()
260 import_uuid(uuid, nd_label->cxl.uuid); in nsl_get_uuid()
262 import_uuid(uuid, nd_label->efi.uuid); in nsl_get_uuid()
270 if (ndd->cxl) in nsl_set_uuid()
271 export_uuid(nd_label->cxl.uuid, uuid); in nsl_set_uuid()
273 export_uuid(nd_label->efi.uuid, uuid); in nsl_set_uuid()
283 if (ndd->cxl) in nsl_uuid_equal()
284 import_uuid(&tmp, nd_label->cxl.uuid); in nsl_uuid_equal()
286 import_uuid(&tmp, nd_label->efi.uuid); in nsl_uuid_equal()
293 if (ndd->cxl) in nsl_uuid_raw()
294 return nd_label->cxl.uuid; in nsl_uuid_raw()
295 return nd_label->efi.uuid; in nsl_uuid_raw()
313 unsigned int num = 1 << ndrd->hints_shift; in ndrd_get_flush_wpq()
314 unsigned int mask = num - 1; in ndrd_get_flush_wpq()
316 return ndrd->flush_wpq[dimm * num + (hint & mask)]; in ndrd_get_flush_wpq()
322 unsigned int num = 1 << ndrd->hints_shift; in ndrd_set_flush_wpq()
323 unsigned int mask = num - 1; in ndrd_set_flush_wpq()
325 ndrd->flush_wpq[dimm * num + (hint & mask)] = flush; in ndrd_set_flush_wpq()
334 return ndd->data + sizeof_namespace_index(ndd) * i; in to_namespace_index()
340 return to_namespace_index(ndd, ndd->ns_current); in to_current_namespace_index()
346 return to_namespace_index(ndd, ndd->ns_next); in to_next_namespace_index()
352 (!ndd->cxl && offsetof(struct nvdimm_efi_label, field) \
356 dev_dbg((r) ? &(r)->dev : (d)->dev, "%s: %.13s: %#llx @ %#llx " fmt, \
357 (r) ? dev_name((d)->dev) : "", res ? res->name : "null", \
359 (unsigned long long) (res ? res->start : 0), ##arg)
362 for (res = (ndd)->dpa.child; res; res = res->sibling)
365 for (res = (ndd)->dpa.child, next = res ? res->sibling : NULL; \
366 res; res = next, next = next ? next->sibling : NULL)
392 struct list_head labels; member
397 * conversions use to_ndd() which respects enabled state of the
432 if (ndd->cxl) in nsl_validate_nlabel()
434 return nsl_get_nlabel(ndd, nd_label) == nd_region->ndr_mappings; in nsl_validate_nlabel()
536 char reserved[SZ_4K - 8];
549 return -ENODEV; in nd_btt_probe()
579 return -ENODEV; in nd_pfn_probe()
594 return -ENODEV; in nd_pfn_validate()
607 return -ENODEV; in nd_dax_probe()
660 return -ENXIO; in nvdimm_setup_pfn()
667 if (bb->count) { in is_bad_pmem()