ubi_wl_flush(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ubi_wl_flush(9) β€” a page from the Kernel API Manual, bestie

okay so welcome to the glow-up of ubi_wl_flush(9), straight out of the kernel API manual. this is the wear-leveling girlie who makes sure all your pending work actually gets done. let's get into it πŸŽ€


✨ NAME ✨

ubi_wl_flush β€” flush all pending works.

like, all of them. every last one. no stragglers. periodt. πŸ’…


🌸 SYNOPSIS 🌸

int ubi_wl_flush (struct ubi_device *ubi , int vol_id , int lnum );

three args, one int back. she's lowkey compact, highkey powerful πŸ¦‹


🫢 ARGUMENTS 🫢

  • ubi β€” the UBI device description object. your main character struct, fr fr πŸ’–
  • vol_id β€” the volume id to flush for. which volume are we serving today πŸ‘‘
  • lnum β€” the logical eraseblock number to flush for. the specific little eraseblock in question ✨

πŸ”₯ DESCRIPTION πŸ”₯

okay so here's the vibe: this function executes all pending works for a particular vol_id / lnum pair β€” like, the whole pairing. it's giving "clean slate, nothing left hanging." 🌈

and here's the iconic part: if either value is set to UBI_ALL, then it acts as a wildcard for all of the corresponding volume numbers or logical eraseblock numbers. so you can be like "idc which one, flush UBI_ALL of them" and she ate. πŸ’€βœ¨

returns zero in case of success and a negative error code in case of failure. so if you see a negative number, that's not a slay, that's a problem 😭


πŸ¦‹ SEE ALSO πŸ¦‹

kernel file ./drivers/mtd/ubi/wl.c, plus the whole friend group:

wl_tree_add(9), 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_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 that's a whole group chat and they're all in the wl.c server πŸ’œ


just a lil reminder: the wildcard is UBI_ALL and it works on either vol_id or lnum. don't forget or you'll be flushing one thing at a time like a rookie πŸ™ˆ

and that's the page!! πŸŽ€ sign-off time: this one lives in ./drivers/mtd/ubi, dated October 2026, and yes she's still called ubi_wl_flush(9) πŸ’– byeee ✨

πŸ“¦ where this page comes from