STRUCT UBIFS_LP_STATS(9)
π¦ struct ubifs_lp_stats(9) β Kernel API Manual π¦
okay bestie, this is the Kernel API Manual entry for struct ubifs_lp_stats, and itβs literally the stats situation for eraseblocks in the main area. no cap, itβs giving βaccounting struct that knows too muchβ energy π
β¨ NAME β¨
struct ubifs_lp_stats β statistics of eraseblocks in the main area. π
π¦ SYNOPSIS π¦
struct ubifs_lp_stats {
int empty_lebs;
int taken_empty_lebs;
int idx_lebs;
long long total_free;
long long total_dirty;
long long total_used;
long long total_dead;
long long total_dark;
};
π§ Members π§
empty_lebsβ number of empty LEBs πΈtaken_empty_lebsβ number of taken LEBsidx_lebsβ number of indexing LEBstotal_freeβ total free space in bytes (includes all LEBs) πtotal_dirtyβ total dirty space in bytes (includes all LEBs)total_usedβ total used space in bytes (does not include index LEBs)total_deadβ total dead space in bytes (does not include index LEBs)total_darkβ total dark space in bytes (does not include index LEBs)
π Description π
okay so the taken_empty_lebs field counts the LEBs that are in the transient state of having been βtakenβ for use but not yet written to. bestie, taken_empty_lebs is needed to account correctly for gc_lnum, otherwise empty_lebs could be used by itself (in which case 'unused_lebs' would be a better name). In the case of gc_lnum, it is βtakenβ at mount time or whenever a LEB is retained by GC, but unlike other empty LEBs that are βtakenβ, it may not be written straight away (i.e. before the next commit start or unmount), so either gc_lnum must be specially accounted for, or the current approach followed i.e. count it under taken_empty_lebs.
empty_lebs includes taken_empty_lebs. π«Ά
total_used, total_dead and total_dark fields do not account indexing LEBs. periodt.
π«Ά reminder: keeptaken_empty_lebsin the mix forgc_lnumβ itβs not just a vibe.
π₯ SEE ALSO π₯
Kernel file ./fs/ubifs/ubifs.h β then the whole squad: 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_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), struct ubifs_info(9), ubifs_check_hash(9), ubifs_check_hmac(9), ubifs_branch_hash(9), ubifs_copy_hash(9), ubifs_auth_node_sz(9).
π«Ά cute sign-off: this pageβs source is./fs/ubifs, itβs datedOctober 2026, and itβs thestruct ubifs_lp_stats(9)Kernel API Manual entry. bye bestie, go count those LEBs π
π¦ 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