wl_tree_add(9)
π wl_tree_add(9) β the Kernel API Manual page you actually wanna read π
okay so this is wl_tree_add(9) straight out of the Kernel API Manual, and honestly? she's a tiny little function with main character energy. no cap, one job, does it slayfully. let's get into it bestie π¦
β¨ NAME β¨
wl_tree_add β add a wear-leveling entry to a WL RB-tree π
like⦠that's it. that's the whole vibe. she adds one (1) wear-leveling entry to a wear-leveling red-black tree and she goes home. iconic.
πΈ SYNOPSIS πΈ
void wl_tree_add (struct ubi_wl_entry *e , struct rb_root *root );
returns void, meaning she gives you NOTHING back except the satisfaction of a job well done. we respect that fr fr π
π ARGUMENTS π
eβ the wear-leveling entry to add π«Ά this is the little guy going into the tree.rootβ the root of the tree π³ like, the actualstruct rb_rootshe's gonna live in.
β DESCRIPTION β
okay so here's the tea, and it's important so listen up π
Note, we use (erase counter, physical eraseblock number) pairs as keys in the ubi->used and ubi->free RB-trees. that's the whole key situation β erase counter first, physical eraseblock number second, and that pair is what sorts everything in those two trees. periodt πβ¨
no like literally, that's the note. it's giving "small but crucial detail" and we're obsessed.
π¦ SEE ALSO π¦
the kernel file lives at ./drivers/mtd/ubi/wl.c and here is the entire friend group, no one left behind, not a single one ππ
wl_entry_destroy(9)do_work(9)in_wl_tree(9)in_pq(9)prot_queue_add(9)find_wl_entry(9)find_mean_wl_entry(9)wl_get_wle(9)prot_queue_del(9)ubi_sync_erase(9)serve_prot_queue(9)__schedule_ubi_work(9)schedule_ubi_work(9)schedule_erase(9)do_sync_erase(9)wear_leveling_worker(9)ensure_wear_leveling(9)__erase_worker(9)ubi_wl_put_peb(9)ubi_wl_scrub_peb(9)ubi_wl_flush(9)ubi_bitflip_check(9)tree_destroy(9)ubi_thread(9)shutdown_work(9)erase_aeb(9)ubi_wl_init(9)protection_queue_destroy(9)ubi_wl_close(9)self_check_ec(9)self_check_in_wl_tree(9)self_check_in_pq(9)produce_free_peb(9)ubi_wl_get_peb(9)
ngl bestie, this page is short but she ate. add your entry, respect the (erase counter, physical eraseblock number) key, and go touch some grass ππΈ
mwah π β brought to you by ./drivers/mtd/ubi, October 2026, and the letter "R" for red-black tree. π§ββοΈπ
π¦ 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