schedule_erase(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ schedule_erase(9) ✨

okay so bestie, we're diving into the Kernel API Manual today β€” this one's schedule_erase(9) and it's literally the little function that could 🫢 it just... schedules an erase. that's the whole vibe. main character energy for a work item, ngl.


🌸 NAME 🌸

schedule_erase β€” schedule an erase work.

like, yes, that's it, that's the tweet πŸ’… it puts an erase job on the schedule and moves on with its life.


πŸ¦‹ SYNOPSIS πŸ¦‹

int schedule_erase (struct ubi_device *ubi , struct ubi_wl_entry *e ,
int vol_id , int lnum , int torture , bool nested );

returns an int, takes six whole arguments, she's thriving on parameters okay 😭


πŸŽ€ ARGUMENTS πŸŽ€

  • ubi β€” the UBI device description object. the big boss struct, the main character of the whole subsystem 🫢
  • e β€” the WL entry of the physical eraseblock to erase. that's the actual PEB we're sending off to get wiped ✨
  • vol_id β€” the volume ID that last used this PEB. receipts of who was here last πŸ‘‘
  • lnum β€” the last used logical eraseblock number for the PEB. the LEB tea β˜•
  • torture β€” if the physical eraseblock has to be tortured πŸ˜­πŸ’€ yes that's the real name, and yes it means what it means: whether this PEB gets the torture treatment
  • nested β€” denotes whether the work_sem is already held. lowkey important, don't lie to her about this one πŸ™ˆ

πŸ’– DESCRIPTION πŸ’–

so here's the whole plot: this function returns zero in case of success and a -ENOMEM in case of failure. that's it. zero? slay, we're good πŸ’… -ENOMEM? out of memory, not slay, go fix your allocation situation 😭

no cap, -ENOMEM is the only failure she documents here, so don't go making up other error codes, bestie.

🌈 SEE ALSO 🌈

okay this list is long and she ate, honestly. here's the whole squad from the kernel file ./drivers/mtd/ubi/wl.c β€” every single one:

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), 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)

iykyk πŸ§šπŸ’œ go read them, they're all in their wear-leveling era.


and that's the page, bestie! this little icon lives at ./drivers/mtd/ubi and the manual's dated October 2026 β€” so yes, she's from the future and she's still scheduling erases πŸ’€ see you in the group chat πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from