preamble_index(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– preamble_index(9) πŸ’–

hiii bestie ✨ welcome to the Kernel API Manual, where we read kernel source so you don't have to (jk, you absolutely should, but like… together πŸ’…). Today's main character is preamble_index(9) β€” the little setup gremlin that gets all your variables ready before the nd_label_* routines do their thing. no cap, it's giving "prep work that nobody claps for but everything falls apart without" 🫢


🌸 NAME 🌸

preamble_index β€” the common variable initialization for the nd_label_* routines. literally just the shared setup, bestie πŸŽ€


✨ SYNOPSIS ✨

bool preamble_index (struct nvdimm_drvdata *ndd , int idx , struct
nd_namespace_index **nsindex_out , unsigned long **free , u32 *nslot );

she returns a bool, she takes five args, she's iconic πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

okay so here's who's who in the group chat:

  • ndd β€” the dimm container for the relevant label set. the vibe check container, if you will 🧚
  • idx β€” the namespace_index index. yes it's an index into an index, don't ask, it's fine 🌈
  • nsindex_out β€” on return, set to the currently active namespace index. she's an output param, she reports back πŸ’Œ
  • free β€” on return, set to the free label bitmap in the index. the "what's still available" map, slay πŸ—ΊοΈ
  • nslot β€” on return, set to the number of slots in the label space. the headcount, basically ⭐
fr fr bestie, notice that nsindex_out, free and nslot are all on return values β€” so like, you pass the pointer in, the function fills in the answer. don't be out here reading them before the call πŸ’€

πŸ‘€ SEE ALSO πŸ‘€

Kernel file ./drivers/nvdimm/label.c β€” go read it, it's right there, iykyk πŸ“–πŸ’œ


and that's the whole page bestie πŸŽ€ this one came to you from ./drivers/nvdimm, dated October 2026, filed under preamble_index(9) β€” go forth and initialize those variables, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from