STRUCT BTT(9)
π struct btt(9) π
okay so bestie, welcome to the Kernel API Manual, and today's main character is struct btt β literally the handle for a BTT instance. that's it, that's the vibe. it's the little struct that holds the whole BTT situation together π«Ά
β¨ SYNOPSIS β¨
struct btt {
struct gendisk *btt_disk;
struct list_head arena_list;
struct dentry *debugfs_dir;
struct nd_btt *nd_btt;
u64 nlba;
unsigned long long rawsize;
u32 lbasize;
u32 sector_size;
struct nd_region *nd_region;
struct mutex init_lock;
int init_state;
int num_arenas;
struct badblocks *phys_bb;
};
πΈ MEMBERS πΈ
so. let's meet the cast. every single field, no skipping, i promise π
btt_diskβ pointer to thegendiskfor the BTT device. the whole disk situation, basically πarena_listβ head of the list of arenas. yes we're talking linked-list head energy, it's givinglist_headand we love that for usdebugfs_dirβ the debugfs dentry. your little doorway into debugfs land πͺnd_bttβ parentnd_bttstruct. it's got a whole parent, very family-oriented of itnlbaβ number of logical blocks exposed to the upper layers, after you subtract all the space that metadata ate. metadata really said "i'm taking some of that" πrawsizeβ total size in bytes of the available backing device. the full snack, unfilteredlbasizeβ LBA size as requested and presented to the upper layers. lowkey important: this issector_sizeplus the size of any metadata. yes, the metadata is baked in πsector_sizeβ the Linux sector size β512or4096. those are the only two options, no in-between, no cap π§nd_regionβstruct nd_regionpointer. that's it, that's the fieldinit_lockβ mutex used for the BTT initialization. please respect the lock, bestie, or it gets ugly πinit_stateβ flag describing the initialization state for the BTT. is it initialized? is it not? the flag knows πnum_arenasβ number of arenas in the BTT instance. count 'em π₯phys_bbβ pointer to the namespace'sbadblocksstructure. everybody's got a lil list of bad blocks, no judgement π
β SEE ALSO β
- Kernel file
./drivers/nvdimm/btt.h struct arena_info(9)
not me documenting a kernel struct like it's a group chat π but honestly? it ate. go read the source, bestie, iykyk π¦
and that's a wrap! this page came straight out of ./drivers/nvdimm, dated October 2026 β iconic, timeless, periodt πβ¨π
π¦ 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