STRUCT UBIFS_INFO(9)
okay bestie, buckle up β this is struct ubifs_info(9) from the Kernel API Manual, and it is a whole mood. Think of it as the UBIFS file-system description data structure (per-superblock) β yes, one of these per superblock, main character energy fr fr.
π NAME π
struct ubifs_info β the UBIFS file-system description data structure (per-superblock).
β¨ SYNOPSIS β¨
here's the whole struct, copied exactly so you can vibe-check every single member β no cap, we are not skipping anything:
struct ubifs_info {
struct super_block *vfs_sb;
struct ubifs_sb_node *sup_node;
ino_t highest_inum;
unsigned long long max_sqnum;
unsigned long long cmt_no;
spinlock_t cnt_lock;
int fmt_version;
int ro_compat_version;
unsigned char uuid[16];
int lhead_lnum;
int lhead_offs;
int ltail_lnum;
struct mutex log_mutex;
int min_log_bytes;
long long cmt_bud_bytes;
struct rb_root buds;
long long bud_bytes;
spinlock_t buds_lock;
int jhead_cnt;
struct ubifs_jhead *jheads;
long long max_bud_bytes;
long long bg_bud_bytes;
struct list_head old_buds;
int max_bud_cnt;
atomic_t need_wait_space;
wait_queue_head_t reserve_space_wq;
struct rw_semaphore commit_sem;
int cmt_state;
spinlock_t cs_lock;
wait_queue_head_t cmt_wq;
struct kobject kobj;
struct completion kobj_unregister;
unsigned int big_lpt:1;
unsigned int space_fixup:1;
unsigned int double_hash:1;
unsigned int encrypted:1;
unsigned int no_chk_data_crc:1;
unsigned int bulk_read:1;
unsigned int default_compr:2;
unsigned int rw_incompat:1;
unsigned int assert_action:2;
unsigned int authenticated:1;
unsigned int superblock_need_write:1;
struct mutex tnc_mutex;
struct ubifs_zbranch zroot;
struct ubifs_znode *cnext;
struct ubifs_znode *enext;
int *gap_lebs;
void *cbuf;
void *ileb_buf;
int ileb_len;
int ihead_lnum;
int ihead_offs;
int *ilebs;
int ileb_cnt;
int ileb_nxt;
struct rb_root old_idx;
int *bottom_up_buf;
struct ubifs_mst_node *mst_node;
int mst_offs;
int max_bu_buf_len;
struct mutex bu_mutex;
struct bu_info bu;
struct mutex write_reserve_mutex;
void *write_reserve_buf;
int log_lebs;
long long log_bytes;
int log_last;
int lpt_lebs;
int lpt_first;
int lpt_last;
int orph_lebs;
int orph_first;
int orph_last;
int main_lebs;
int main_first;
long long main_bytes;
uint8_t key_hash_type;
uint32_t (*key_hash)(const char *str, int len);
int key_fmt;
int key_len;
int hash_len;
int fanout;
int min_io_size;
int min_io_shift;
int max_write_size;
int max_write_shift;
int leb_size;
int leb_start;
int half_leb_size;
int idx_leb_size;
int leb_cnt;
int max_leb_cnt;
unsigned int ro_media:1;
unsigned int ro_mount:1;
unsigned int ro_error:1;
atomic_long_t dirty_pg_cnt;
atomic_long_t dirty_zn_cnt;
atomic_long_t clean_zn_cnt;
spinlock_t space_lock;
struct ubifs_lp_stats lst;
struct ubifs_budg_info bi;
unsigned long long calc_idx_sz;
int ref_node_alsz;
int mst_node_alsz;
int min_idx_node_sz;
int max_idx_node_sz;
long long max_inode_sz;
int max_znode_sz;
int leb_overhead;
int dead_wm;
int dark_wm;
int block_cnt;
struct ubifs_node_range ranges[UBIFS_NODE_TYPES_CNT];
struct ubi_volume_desc *ubi;
struct ubi_device_info di;
struct ubi_volume_info vi;
struct rb_root orph_tree;
struct list_head orph_list;
struct list_head orph_new;
struct ubifs_orphan *orph_cnext;
struct ubifs_orphan *orph_dnext;
spinlock_t orphan_lock;
void *orph_buf;
int new_orphans;
int cmt_orphans;
int tot_orphans;
int max_orphans;
int ohead_lnum;
int ohead_offs;
int no_orphs;
struct task_struct *bgt;
char bgt_name[sizeof(BGT_NAME_PATTERN) + 9];
int need_bgt;
int need_wbuf_sync;
int gc_lnum;
void *sbuf;
struct list_head idx_gc;
int idx_gc_cnt;
int gc_seq;
int gced_lnum;
struct list_head infos_list;
struct mutex umount_mutex;
unsigned int shrinker_run_no;
int space_bits;
int lpt_lnum_bits;
int lpt_offs_bits;
int lpt_spc_bits;
int pcnt_bits;
int lnum_bits;
int nnode_sz;
int pnode_sz;
int ltab_sz;
int lsave_sz;
int pnode_cnt;
int nnode_cnt;
int lpt_hght;
int pnodes_have;
struct mutex lp_mutex;
int lpt_lnum;
int lpt_offs;
int nhead_lnum;
int nhead_offs;
int lpt_drty_flgs;
int dirty_nn_cnt;
int dirty_pn_cnt;
int check_lpt_free;
long long lpt_sz;
void *lpt_nod_buf;
void *lpt_buf;
struct ubifs_nnode *nroot;
struct ubifs_cnode *lpt_cnext;
struct ubifs_lpt_heap lpt_heap[LPROPS_HEAP_CNT];
struct ubifs_lpt_heap dirty_idx;
struct list_head uncat_list;
struct list_head empty_list;
struct list_head freeable_list;
struct list_head frdi_idx_list;
int freeable_cnt;
int in_a_category_cnt;
int ltab_lnum;
int ltab_offs;
struct ubifs_lpt_lprops *ltab;
struct ubifs_lpt_lprops *ltab_cmt;
int lsave_cnt;
int lsave_lnum;
int lsave_offs;
int *lsave;
int lscan_lnum;
long long rp_size;
long long report_rp_size;
kuid_t rp_uid;
kgid_t rp_gid;
struct crypto_shash *hash_tfm;
struct crypto_shash *hmac_tfm;
int hmac_desc_len;
char *auth_key_name;
char *auth_hash_name;
enum hash_algo auth_hash_algo;
struct shash_desc *log_hash;
unsigned int empty:1;
unsigned int need_recovery:1;
unsigned int replaying:1;
unsigned int mounting:1;
unsigned int remounting_rw:1;
unsigned int probing:1;
struct list_head replay_list;
struct list_head replay_buds;
unsigned long long cs_sqnum;
struct list_head unclean_leb_list;
struct ubifs_mst_node *rcvrd_mst_node;
struct rb_root size_tree;
struct ubifs_mount_opts mount_opts;
struct ubifs_debug_info *dbg;
struct ubifs_stats_info *stats;
};
π«Ά Members π«Ά
okay so this is the part where every single field gets its little explanation. we are not skipping any β this is a full send.
vfs_sbβ the VFSstruct super_blockobject. iconic handshake with the VFS.sup_nodeβ the super block node as read from the device.highest_inumβ highest used inode number.max_sqnumβ current global sequence number.cmt_noβ commit number of the last successfully completed commit, protected bycommit_sem.cnt_lockβ protectshighest_inumandmax_sqnumcounters.fmt_versionβ UBIFS on-flash format version.ro_compat_versionβ R/O compatibility version.uuidβ UUID from super block.lhead_lnumβ log head logical eraseblock number.lhead_offsβ log head offset.ltail_lnumβ log tail logical eraseblock number (offset is always0). zero, bestie.log_mutexβ protects the log,lhead_lnum,lhead_offs,ltail_lnum, andbud_bytes.min_log_bytesβ minimum required number of bytes in the log.cmt_bud_bytesβ used during commit to temporarily amount of bytes in committed buds.budsβ tree of all buds indexed by bud LEB number.bud_bytesβ how many bytes of flash is used by buds.buds_lockβ protects thebudstree,bud_bytes, and per-journal head bud lists.jhead_cntβ count of journal heads.jheadsβ journal heads (head zero is base head).max_bud_bytesβ maximum number of bytes allowed in buds.bg_bud_bytesβ number of bud bytes when background commit is initiated.old_budsβ buds to be released after commit ends.max_bud_cntβ maximum number of buds.need_wait_spaceβ Non0means space reservation tasks need to wait in queue.reserve_space_wqβ wait queue to sleep on ifneed_wait_spaceis not0.commit_semβ synchronizes committer with other processes.cmt_stateβ commit state.cs_lockβ commit state lock.cmt_wqβ wait queue to sleep on if the log is full and a commit is running.kobjβ kobject for/sys/fs/ubifs/.kobj_unregisterβ completion to unregister sysfs kobject.big_lptβ flag that LPT is too big to write whole during commit.space_fixupβ flag indicating that free space in LEBs needs to be cleaned up.double_hashβ flag indicating that we can do lookups by hash.encryptedβ flag indicating that this file system contains encrypted files.no_chk_data_crcβ do not check CRCs when reading data nodes (except during recovery). read the exception, bestie.bulk_readβ enable bulk-reads.default_comprβ default compression algorithm (UBIFS_COMPR_LZO, etc).rw_incompatβ the media is not R/W compatible. not R/W compatible, so do not play with it like it is.assert_actionβ action to take when aubifs_assertfails.authenticatedβ flag indicating the FS is mounted in authenticated mode.superblock_need_writeβ superblock node needs to be written.tnc_mutexβ protects the Tree Node Cache (TNC),zroot,cnext,enext, andcalc_idx_sz.zrootβ zbranch which points to the root index node and znode.cnextβ next znode to commit.enextβ next znode to commit to empty space.gap_lebsβ array of LEBs used by the in-gaps commit method.cbufβ commit buffer.ileb_bufβ buffer for commit in-the-gaps method.ileb_lenβ length of data inileb_buf.ihead_lnumβ LEB number of index head.ihead_offsβ offset of index head.ilebsβ pre-allocated index LEBs.ileb_cntβ number of pre-allocated index LEBs.ileb_nxtβ next pre-allocated index LEBs.old_idxβ tree of index nodes obsoleted since the last commit start.bottom_up_bufβ a buffer which is used bydirty_cow_bottom_upintnc.c. iykyk.mst_nodeβ master node.mst_offsβ offset of valid master node.max_bu_buf_lenβ maximum bulk-read buffer length.bu_mutexβ protects the pre-allocated bulk-read buffer andc->bu.buβ pre-allocated bulk-read information.write_reserve_mutexβ protectswrite_reserve_buf.write_reserve_bufβ bestie, on the write path we allocate memory, and sometimes the memory is just not there π so we use this write reserve buffer instead. lowkey a safety net.log_lebsβ the number of logical eraseblocks chilling in the log β¨log_bytesβ the log size in bytes, exactly.log_lastβ the last LEB of the log, periodt.lpt_lebsβ how many LEBs the lprops table is using.lpt_firstβ first LEB of the lprops table area πlpt_lastβ last LEB of the lprops table area πorph_lebsβ the number of LEBs used for the orphan area (yes it's giving orphan era π)orph_firstβ first LEB of the orphan areaorph_lastβ last LEB of the orphan areamain_lebsβ count of LEBs in the main area, the main character obviously πmain_firstβ first LEB of the main areamain_bytesβ main area size in bytes πkey_hash_typeβ the type of the key hashkey_hashβ the direntry key hash functionkey_fmtβ key formatkey_lenβ key lengthhash_lenβ the length of the index node hashes β¨fanoutβ fanout of the index tree, aka the number of links per indexing nodemin_io_sizeβ minimal input/output unit sizemin_io_shiftβ number of bits inmin_io_sizeminus onemax_write_sizeβ the maximum amount of bytes the underlying flash can write at a time (that's the MTD write buffer size, iykyk)max_write_shiftβ number of bits inmax_write_sizeminus oneleb_sizeβ logical eraseblock size in bytes, iconic β¨leb_startβ the starting offset of logical eraseblocks within physical eraseblockshalf_leb_sizeβ half LEB size (math ate π )idx_leb_sizeβ how many bytes of an LEB are effectively available when it's used to store indexing nodes, which isleb_size - max_idx_node_szleb_cntβ count of logical eraseblocksmax_leb_cntβ maximum count of logical eraseblocksro_mediaβ the underlying UBI volume is read-onlyro_mountβ the file-system was mounted as read-onlyro_errorβ UBIFS switched to R/O mode because an error happened π no cap, that's bad newsdirty_pg_cntβ number of dirty pages (not used β she's just vibing there, unused π)dirty_zn_cntβ number of dirty znodesclean_zn_cntβ number of clean znodes β¨space_lockβ this one protectsbiandlstπ«Άlstβ lprops statisticsbiβ budgeting informationcalc_idx_szβ temporary variable used to calculate the new index size (and it contains the accurate new index size at end of TNC commit start, fr fr)ref_node_alszβ size of the LEB reference node aligned to the min. flash I/O unitmst_node_alszβ master node aligned sizemin_idx_node_szβ minimum indexing node aligned on 8-bytes boundarymax_idx_node_szβ maximum indexing node aligned on 8-bytes boundarymax_inode_szβ maximum possible inode size in bytesmax_znode_szβ size of znode in bytesleb_overheadβ how many bytes are wasted in an LEB when it's filled with data nodes of maximum size β used in free space reporting π wasted bytes, we hate to see itdead_wmβ LEB dead space watermarkdark_wmβ LEB dark space watermarkblock_cntβ count of 4KiB blocks on the FSrangesβ UBIFS node length rangesubiβ UBI volume descriptordiβ UBI device informationviβ UBI volume informationorph_treeβ rb-tree of orphan inode numbers π³orph_listβ list of orphan inode numbers in order addedorph_newβ list of orphan inode numbers added since last commitorph_cnextβ next orphan to commitorph_dnextβ next orphan to deleteorphan_lockβ the lock fororph_treeandorph_newπorph_bufβ buffer for orphan nodesnew_orphansβ number of orphans since last commitcmt_orphansβ number of orphans being committedtot_orphansβ number of orphans in the rb_treemax_orphansβ maximum number of orphans allowedohead_lnumβ orphan head LEB numberohead_offsβ orphan head offsetno_orphsβ non-zero if there are no orphans (so like, the opposite of what the name sounds like, iykyk π)bgtβ the UBIFS background thread π§΅bgt_nameβ background thread nameneed_bgtβ set if the background thread should runneed_wbuf_syncβ set if write-buffers have to be synchronizedgc_lnumβ LEB number used for garbage collection β»οΈsbufβ a buffer of LEB size used by GC and replay for scanningidx_gcβ list of index LEBs that have been garbage collectedidx_gc_cntβ number of elements on theidx_gclistgc_seqβ incremented for every non-index LEB garbage collectedgced_lnumβ last non-index LEB that was garbage collectedinfos_listβ links allubifs_infoobjects together π«Άumount_mutexβ serializes shrinker and un-mount, no cutting the line bestie πshrinker_run_noβ shrinker run numberspace_bitsβ number of bits needed to record free or dirty spacelpt_lnum_bitsβ number of bits needed to record a LEB number in the LPTlpt_offs_bitsβ number of bits needed to record an offset in the LPTlpt_spc_bitsβ number of bits needed to record space in the LPTpcnt_bitsβ number of bits needed to record pnode or nnode numberlnum_bitsβ number of bits needed to record LEB numbernnode_szβ size of on-flash nnodepnode_szβ size of on-flash pnodeltab_szβ size of on-flash LPT lprops tablelsave_szβ size of on-flash LPT save tablepnode_cntβ number of pnodesnnode_cntβ number of nnodeslpt_hghtβ height of the LPTpnodes_haveβ number of pnodes in memory π§lp_mutexβ protects the lprops table and all the other lprops-related fieldslpt_lnumβ LEB number of the root nnode of the LPTlpt_offsβ offset of the root nnode of the LPTnhead_lnumβ LEB number of LPT headnhead_offsβ offset of LPT headlpt_drty_flgsβ dirty flags for LPT special nodes, e.g.ltabdirty_nn_cntβ number of dirty nnodesdirty_pn_cntβ number of dirty pnodescheck_lpt_freeβ flag that indicates LPT GC may be needed πlpt_szβ LPT sizelpt_nod_bufβ buffer for an on-flash nnode or pnodelpt_bufβ buffer of LEB size used by LPTnrootβ address in memory of the root nnode of the LPTlpt_cnextβ next LPT node to commitlpt_heapβ array of heaps of categorized lprops β°οΈdirty_idxβ a (reverse sorted) copy of theLPROPS_DIRTY_IDXheap as at previous commit startuncat_listβ list of un-categorized LEBsempty_listβ list of empty LEBsfreeable_listβ list of freeable non-index LEBs (free + dirty ==leb_size)frdi_idx_listβ list of freeable index LEBs (free + dirty ==leb_size)freeable_cntβ number of freeable LEBs infreeable_listin_a_category_cntβ count of lprops which are in a certain category, which basically meants that they were loaded from the flash (yes "meants", we keep it exactly as it is, icon behavior π )ltab_lnumβ LEB number of LPT's own lprops tableltab_offsβ offset of LPT's own lprops tableltabβ LPT's own lprops tableltab_cmtβ LPT's own lprops table (commit copy)lsave_cntβ number of LEB numbers in LPT's save tablelsave_lnumβ LEB number of LPT's save tablelsave_offsβ offset of LPT's save tablelsaveβ LPT's save tablelscan_lnumβ LEB number of last LPT scanrp_sizeβ size of the reserved pool in bytesreport_rp_sizeβ size of the reserved pool reported to user-spacerp_uidβ reserved pool user IDrp_gidβ reserved pool group IDhash_tfmβ the hash transformation used for hashing nodeshmac_tfmβ the HMAC transformation for this filesystemhmac_desc_lenβ length of the HMAC used for authentication πauth_key_nameβ the authentication key nameauth_hash_nameβ the name of the hash algorithm used for authenticationauth_hash_algoβ the authentication hash used for this fslog_hashβ the log hash from the commit start node up to the latest reference nodeemptyβ1if the UBI device is emptyneed_recoveryβ1if the file-system needs recovery πreplayingβ1during journal replaymountingβ1while mountingremounting_rwβ1while re-mounting from R/O mode to R/W modeprobingβ1while attempting to mount if theSB_SILENTmount flag is setreplay_listβ temporary list used during journal replayreplay_budsβ list of buds to replaycs_sqnumβ sequence number of first node in the log (commit start node)unclean_leb_listβ LEBs to recover when re-mounting R/O mounted FS to R/W modercvrd_mst_nodeβ recovered master node to write when re-mounting R/O mounted FS to R/W modesize_treeβ inode size information for recoverymount_optsβ UBIFS-specific mount optionsdbgβ debugging-related information πstatsβ statistics exported over sysfs
β¨ SEE ALSO β¨
Kernel file ./fs/ubifs/ubifs.h β and like, go read these too bestie, they're all connected π«Ά
struct ubifs_old_idx(9)struct ubifs_scan_node(9)struct ubifs_scan_leb(9)struct ubifs_gced_idx_leb(9)struct ubifs_inode(9)struct ubifs_unclean_leb(9)struct ubifs_lprops(9)struct ubifs_lpt_lprops(9)struct ubifs_lp_stats(9)struct ubifs_cnode(9)struct ubifs_pnode(9)struct ubifs_nbranch(9)struct ubifs_nnode(9)struct ubifs_lpt_heap(9)struct ubifs_wbuf(9)struct ubifs_bud(9)struct ubifs_jhead(9)struct ubifs_zbranch(9)struct ubifs_znode(9)struct bu_info(9)struct ubifs_node_range(9)struct ubifs_compressor(9)struct ubifs_budget_req(9)struct ubifs_orphan(9)struct ubifs_mount_opts(9)struct ubifs_budg_info(9)struct ubifs_stats_info(9)ubifs_check_hash(9)ubifs_check_hmac(9)ubifs_branch_hash(9)ubifs_copy_hash(9)ubifs_auth_node_sz(9)
ok that's the whole struct, you actually read all of it?? obsessed with you fr π this page lives at./fs/ubifs, dated October 2026, and it'sstruct ubifs_info(9)β go touch some grass now bestie, you earned it πΈπ¦β¨
π¦ 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