STRUCT UBIFS_LP_STATS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ 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 LEBs
  • idx_lebs β€” number of indexing LEBs
  • total_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: keep taken_empty_lebs in the mix for gc_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 dated October 2026, and it’s the struct ubifs_lp_stats(9) Kernel API Manual entry. bye bestie, go count those LEBs πŸ’…
πŸ“¦ where this page comes from