STRUCT ND_NAMESPACE_INDEX(9)
๐ struct nd_namespace_index(9) ๐
okay bestie so this is a page straight out of the Kernel API Manual, and we're talking about a struct โ a label set superblock, no cap. yes it's giving very specific-and-niche but honestly? iconic. let's get into it ๐ซถ
๐ธ NAME ๐ธ
struct nd_namespace_index โ the label set superblock, literally the main character of your label area โจ
๐ฆ SYNOPSIS ๐ฆ
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[];
};
likeโฆ look at her. she's structured. she's aligned. she's everything ๐
๐ Members ๐
sigโNAMESPACE_INDEX๐ท๏ธ that's the signature, periodt.flagsโ placeholder. yeah that's it. that's the whole vibe. a placeholder ๐labelsizeโ log2 size, and note the deets: v1 labels are 128 bytes, v2 labels are 256 bytes. lowkey important ๐seqโ the sequence number for this index ๐ขmyoffโ offset of this index in the label area ๐mysizeโ size of this index struct, so she knows her own size ๐otheroffโ offset of the other index ๐ there's always another onelabeloffโ offset of the first label slot ๐ฏnslotโ total number of label slots ๐๏ธmajorโ label area major version ๐ฅminorโ label area minor version โจchecksumโ fletcher64 of all fields ๐งฎ every single field, she's thoroughfreeโ a bitmap,nlabelbits long ๐ง
๐ Description ๐
so here's the tea โ โ the size of free[] gets rounded up so that the total struct size is a multiple of NSINDEX_ALIGN bytes. that's just how it has to be, bestie ๐
and listen: any bits this allocates beyond the nlabel bits must be zero. not "should", not "ideally" โ must. zero. no cap, that's the rule ๐
๐ SEE ALSO ๐
- Kernel file
./drivers/nvdimm/label.h struct cxl_region_label(9)struct nvdimm_efi_label(9)struct nvdimm_cxl_label(9)struct nd_label_id(9)
go read those too, they're all linked in the lore ๐ซถ
okay that's the whole page!! mwah ๐ this one lives in ./drivers/nvdimm, dated October 2026, and it's struct nd_namespace_index(9) all the way down. slay, stay aligned, and remember: the extra bits are zero ๐โจ
๐ฆ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms