STRUCT NAND_BBT_DESCR(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct nand_bbt_descr(9) β€” the Kernel API Manual glow-up

okay so bestie, this is a page from the Kernel API Manual and it's all about struct nand_bbt_descr, like, the descriptor for a bad block table. iykyk β€” it's niche but she's iconic in her own lane πŸŽ€


✨ NAME ✨

struct nand_bbt_descr β€” bad block table descriptor, no cap 🫢


🌸 SYNOPSIS 🌸

struct nand_bbt_descr {
    int options;
    int pages[NAND_MAX_CHIPS];
    int offs;
    int veroffs;
    uint8_t version[NAND_MAX_CHIPS];
    int len;
    int maxblocks;
    int reserved_block_code;
    uint8_t *pattern;
 };

literally the whole squad right there πŸ‘‘


πŸ¦‹ Members πŸ¦‹

  • options β€” the options for this descriptor. the settings, the personality, the vibe check ✨
  • pages β€” the page(s) where we find the bbt, used with option BBT_ABSPAGE when bbt is searched, and then we store the found bbts pages here. it's an array, and it supports up to 8 chips now πŸ’€ (yes, 8. she's grown.)
  • offs β€” offset of the pattern in the oob area of the page
  • veroffs β€” offset of the bbt version counter in the oob are of the page
  • version β€” version read from the bbt page during scan. the receipts from the scan, basically πŸ”
  • len β€” length of the pattern. and lowkey important: if 0, no pattern check is performed at all πŸ™ˆ
  • maxblocks β€” maximum number of blocks to search for a bbt. this number of blocks is reserved at the end of the device where the tables are written. so like, she carves out her space at the back of the device, periodt πŸ‘‘
  • reserved_block_code β€” if non-0, this pattern denotes a reserved (rather than bad) block in the stored bbt. so we're not calling it bad, we're calling it reserved, and that's a whole different thing bestie πŸ’…
  • pattern β€” pattern to identify bad block table or factory marked good / bad blocks, can be NULL, if len = 0

πŸ’– Description πŸ’–

okay so real talk: this whole struct is the descriptor for the bad block table marker, plus the descriptor for the pattern which identifies good and bad blocks. two jobs, one struct, main character energy fr fr 🌈

the assumption being made here β€” and she is an assumption, don't come for her β€” is that the pattern and the version count are always located in the oob area of the first block. that's the rule. that's the assignment. ✨

ngl the whole thing hinges on that placement assumption, so like… know it, bestie 🫢

πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./include/linux/mtd/bbm.h
  • struct bbm_info(9)

go read bbm.h if you're obsessed (i am) πŸ’œ

🌸 okay bye bestie, this page was brought to you straight out of ./include/linux/mtd, dated October 2026, and yes that's the same struct nand_bbt_descr(9) in the corner of every page like a little watermark. slay, stay hydrated, and don't forget the oob area πŸ’…βœ¨

πŸ“¦ where this page comes from