STRUCT UBI_FM_SB(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’Ύ struct ubi_fm_sb(9) β€” UBI fastmap super block πŸ’Ύ

okay bestie, welcome to the Kernel API Manual ✨ this one's a struct, not a program, so no flags to memorise β€” it's literally just a lil' layout blueprint. Think of it as the cover page of a very important notebook πŸ““πŸ’…


🌸 NAME 🌸

struct ubi_fm_sb β€” the UBI fastmap super block. that's it, that's the name, no notes 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole vibe, copy-pasted with love (and zero edits, because we do not mess with literal code around here 😀):

struct ubi_fm_sb {
    __be32 magic;
    __u8 version;
    __u8 padding1[3];
    __be32 data_crc;
    __be32 used_blocks;
    __be32 block_loc[UBI_FM_MAX_BLOCKS];
    __be32 block_ec[UBI_FM_MAX_BLOCKS];
    __be64 sqnum;
    __u8 padding2[32];
 };

like, look at all those fields. so structured. so organised. main character energy fr fr πŸ‘‘


πŸŽ€ Members πŸŽ€

okay so let's go field by field, no skipping, we don't do that here πŸ’–

  • magic β€” the fastmap super block magic number, and yes it's literally called UBI_FM_SB_MAGIC ✨ iconic name, no notes.
  • version β€” the format version of this fastmap. so you know which era of fastmap you're dealing with πŸ•°οΈ
  • data_crc β€” a CRC check over the fastmap data. gotta make sure nothing got scrambled on the way, y'know? πŸ”
  • used_blocks β€” the number of PEBs this fastmap is using. count 'em, bestie πŸ”’
  • block_loc β€” an array holding the location of all the PEBs of the fastmap. it's giving "map of the map" energy πŸ—ΊοΈ
  • block_ec β€” the erase counter for each used PEB. every single one gets its own little counter, obsessed πŸ’…
  • sqnum β€” the highest sequence number value at the time the fastmap was taken. peak "at the time while taking" behaviour ⏱️
little side note: padding1[3] and padding2[32] are sitting right there in the struct, but the man page doesn't say a single word about them, so I'm not gonna start making stuff up πŸ™ˆ they're just there, living their best life.

🌈 SEE ALSO 🌈

go read the neighbors, they're all in one file together like one big happy kernel family 🫢

  • Kernel file ./drivers/mtd/ubi/ubi-media.h
  • struct ubi_ec_hdr(9)
  • struct ubi_vid_hdr(9)
  • struct ubi_vtbl_record(9)
  • struct ubi_fm_hdr(9)
  • struct ubi_fm_scan_pool(9)
  • struct ubi_fm_ec(9)
  • struct ubi_fm_volhdr(9)
  • struct ubi_fm_eba(9)

and that's the whole page, bestie, you ate that πŸ“βœ¨ this lil' rewrite came straight out of ./drivers/mtd/ubi and it's dated October 2026 β€” so yeah, mark your calendar, this is the version you're getting πŸ’œπŸŽ€ no cap, go forth and read structs πŸ’…

πŸ“¦ where this page comes from