STRUCT UBIFS_SB_NODE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct ubifs_sb_node(9) β€” the superblock node, bestie πŸ’–

okay so this is a page from the Kernel API Manual, and it's literally all about struct ubifs_sb_node β€” the superblock node. that's it, that's the whole vibe. it's giving "the main character of your UBIFS filesystem's metadata" πŸ‘‘


✨ SYNOPSIS ✨

here's the whole struct, copied exactly, no notes:

struct ubifs_sb_node {
    struct ubifs_ch ch;
    __u8 padding[2];
    __u8 key_hash;
    __u8 key_fmt;
    __le32 flags;
    __le32 min_io_size;
    __le32 leb_size;
    __le32 leb_cnt;
    __le32 max_leb_cnt;
    __le64 max_bud_bytes;
    __le32 log_lebs;
    __le32 lpt_lebs;
    __le32 orph_lebs;
    __le32 jhead_cnt;
    __le32 fanout;
    __le32 lsave_cnt;
    __le32 fmt_version;
    __le16 default_compr;
    __u8 padding1[2];
    __le32 rp_uid;
    __le32 rp_gid;
    __le64 rp_size;
    __le32 time_gran;
    __u8 uuid[16];
    __le32 ro_compat_version;
    __u8 hmac[UBIFS_MAX_HMAC_LEN];
    __u8 hmac_wkm[UBIFS_MAX_HMAC_LEN];
    __le16 hash_algo;
    __u8 hash_mst[UBIFS_MAX_HASH_LEN];
    __u8 padding2[3774];
};

slay. now let's meet the members one by one, they all have main character energy in their own way 🫢


🌸 Members 🌸

  • ch β€” the common header. every struct needs a little hello.
  • padding β€” reserved for future, zeroes. it's just vibing, holding space πŸ’…
  • key_hash β€” the type of hash function used in keys.
  • key_fmt β€” the format of the key.
  • flags β€” file-system flags (UBIFS_FLG_BIGLPT, etc). yes there are more, this is just the example, iykyk.
  • min_io_size β€” minimal input/output unit size.
  • leb_size β€” logical eraseblock size in bytes.
  • leb_cnt β€” count of LEBs used by the file-system.
  • max_leb_cnt β€” maximum count of LEBs used by the file-system. the ceiling, the limit, the "don't push it" βœ‹
  • max_bud_bytes β€” maximum amount of data stored in buds.
  • log_lebs β€” log size in logical eraseblocks.
  • lpt_lebs β€” number of LEBs used for the lprops table.
  • orph_lebs β€” number of LEBs used for recording orphans. πŸ₯Ί they're not really orphans, they're just between parents rn.
  • jhead_cnt β€” count of journal heads.
  • fanout β€” tree fanout (max. number of links per indexing node).
  • lsave_cnt β€” number of LEB numbers in LPT's save table.
  • fmt_version β€” UBIFS on-flash format version.
  • default_compr β€” default compression algorithm (UBIFS_COMPR_LZO, etc). squish it, bestie πŸ—œοΈ
  • padding1 β€” reserved for future, zeroes. second reserved block, still zeroes, still chillin'.
  • rp_uid β€” reserve pool UID.
  • rp_gid β€” reserve pool GID.
  • rp_size β€” size of the reserved pool in bytes.
  • time_gran β€” time granularity in nanoseconds. tiny tiny time baby ⏱️
  • uuid β€” UUID generated when the file system image was created. its little birth certificate πŸŽ€
  • ro_compat_version β€” UBIFS R/O compatibility version.
  • hmac β€” HMAC to authenticate the superblock node.
  • hmac_wkm β€” HMAC of a well known message (the string "UBIFS") as a convenience to the user to check if the correct key is passed. cute lil key vibe check πŸ”‘βœ¨
  • hash_algo β€” The hash algo used for this filesystem (one of enum hash_algo).
  • hash_mst β€” hash of the master node, only valid for signed images in which the master node does not contain a hmac.
  • padding2 β€” reserved for future, zeroes. and it's a big one: padding2[3774] β€” yes, 3774 whole bytes of absolutely nothing. iconic. not me being jealous of a padding array's peace and quiet 😭

πŸ‘€ SEE ALSO πŸ‘€

go read these next, fr fr β€” from the kernel file ./fs/ubifs/ubifs-media.h:

struct ubifs_ch(9), union ubifs_dev_desc(9), struct ubifs_ino_node(9), struct ubifs_dent_node(9), struct ubifs_data_node(9), struct ubifs_trun_node(9), struct ubifs_pad_node(9), struct ubifs_mst_node(9), struct ubifs_ref_node(9), struct ubifs_auth_node(9), struct ubifs_sig_node(9), struct ubifs_branch(9), struct ubifs_idx_node(9), struct ubifs_cs_node(9), struct ubifs_orph_node(9)

the whole node family reunion, honestly 🌈


and that's a wrap, bestie πŸ¦‹ this page lives in ./fs/ubifs and it's dated October 2026 β€” straight from the Kernel API Manual. mwah, go forth and read your superblock nodes πŸ’œβ­

πŸ“¦ where this page comes from