drivers/nvdimm/label.h
Source file repositories/reference/linux-study-clean/drivers/nvdimm/label.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/nvdimm/label.h- Extension
.h- Size
- 6597 bytes
- Lines
- 227
- Domain
- Driver Families
- Bucket
- drivers/nvdimm
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/ndctl.hlinux/sizes.hlinux/uuid.hlinux/io.h
Detected Declarations
struct nd_namespace_indexstruct cxl_region_labelstruct nvdimm_efi_labelstruct nvdimm_cxl_labelstruct nd_namespace_labelstruct nd_label_idstruct nvdimm_drvdatastruct nd_regionstruct nd_namespace_pmemfunction MOD
Annotated Snippet
struct nd_namespace_index {
u8 sig[NSINDEX_SIG_LEN];
u8 flags[3];
u8 labelsize;
__le32 seq;
__le64 myoff;
__le64 mysize;
__le64 otheroff;
__le64 labeloff;
__le32 nslot;
__le16 major;
__le16 minor;
__le64 checksum;
u8 free[];
};
/**
* struct cxl_region_label - CXL 2.0 Table 211
* @type: uuid identifying this label format (region)
* @uuid: uuid for the region this label describes
* @flags: NSLABEL_FLAG_UPDATING (all other flags reserved)
* @nlabel: 1 per interleave-way in the region
* @position: this label's position in the set
* @dpa: start address in device-local capacity for this label
* @rawsize: size of this label's contribution to region
* @hpa: mandatory system physical address to map this region
* @slot: slot id of this label in label area
* @ig: interleave granularity (1 << @ig) * 256 bytes
* @align: alignment in SZ_256M blocks
* @reserved: reserved
* @checksum: fletcher64 sum of this label
*/
struct cxl_region_label {
u8 type[NSLABEL_UUID_LEN];
u8 uuid[NSLABEL_UUID_LEN];
__le32 flags;
__le16 nlabel;
__le16 position;
__le64 dpa;
__le64 rawsize;
__le64 hpa;
__le32 slot;
__le32 ig;
__le32 align;
u8 reserved[0xac];
__le64 checksum;
};
/**
* struct nvdimm_efi_label - namespace superblock
* @uuid: UUID per RFC 4122
* @name: optional name (NULL-terminated)
* @flags: see NSLABEL_FLAG_*
* @nlabel: num labels to describe this ns
* @position: labels position in set
* @isetcookie: interleave set cookie
* @lbasize: LBA size in bytes or 0 for pmem
* @dpa: DPA of NVM range on this DIMM
* @rawsize: size of namespace
* @slot: slot of this label in label area
* @align: physical address alignment of the namespace
* @reserved: reserved
* @type_guid: copy of struct acpi_nfit_system_address.range_guid
* @abstraction_guid: personality id (btt, btt2, fsdax, devdax....)
* @reserved2: reserved
* @checksum: fletcher64 sum of this object
*/
struct nvdimm_efi_label {
u8 uuid[NSLABEL_UUID_LEN];
u8 name[NSLABEL_NAME_LEN];
__le32 flags;
__le16 nlabel;
__le16 position;
__le64 isetcookie;
__le64 lbasize;
__le64 dpa;
__le64 rawsize;
__le32 slot;
/*
* Accessing fields past this point should be gated by a
* efi_namespace_label_has() check.
*/
u8 align;
u8 reserved[3];
guid_t type_guid;
guid_t abstraction_guid;
u8 reserved2[88];
__le64 checksum;
};
Annotation
- Immediate include surface: `linux/ndctl.h`, `linux/sizes.h`, `linux/uuid.h`, `linux/io.h`.
- Detected declarations: `struct nd_namespace_index`, `struct cxl_region_label`, `struct nvdimm_efi_label`, `struct nvdimm_cxl_label`, `struct nd_namespace_label`, `struct nd_label_id`, `struct nvdimm_drvdata`, `struct nd_region`, `struct nd_namespace_pmem`, `function MOD`.
- Atlas domain: Driver Families / drivers/nvdimm.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.