STRUCT UBIFS_SB_NODE(9)
π 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 ofenum 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
- 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