STRUCT UBI_WORK(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct ubi_work(9) β€” the Kernel API Manual, bestie edition

okay so. welcome to struct ubi_work(9) ✨ this is the page for UBI work description data structure β€” yes that's the actual NAME line, and yes it's literally a lil struct that describes a chunk of work the wear-leveling girlies need to get done. let's go πŸŽ€


✨ SYNOPSIS ✨

struct ubi_work {
    struct list_head list;
    int (*func)(struct ubi_device *ubi, struct ubi_work *wrk, int shutdown);
    struct ubi_wl_entry *e;
    int vol_id;
    int lnum;
    int torture;
 };

like… look at her. she's giving organized. πŸ¦‹


🌸 Members 🌸

  • list β€” a link in the list of pending works. she's in the queue, she's waiting her turn, main character energy but polite about it 🫢
  • func β€” worker function. the actual doer of the thing, iykyk πŸ”₯
  • e β€” physical eraseblock to erase. this is the block that's getting got πŸ’…
  • vol_id β€” the volume ID on which this erasure is being performed. which volume? this one. slay.
  • lnum β€” the logical eraseblock number. the number of the logical eraseblock, no cap πŸ“Œ
  • torture β€” if the physical eraseblock has to be tortured 😭 yes that's really the field name and yes it's really about torturing the PEB. iconic, honestly.

πŸ‘‘ Description πŸ‘‘

ok so. the func pointer points to the worker function. that's the whole vibe.

and here's the important part, bestie, don't skip this one πŸ™ˆ β€” if the shutdown argument is not zero, the worker has to free the resources and exit immediately, because the WL sub-system is shutting down. like, pack it up, we're closed, go home πŸƒβ€β™€οΈπŸ’¨

and the worker has to return zero in case of success, and a negative error code in case of failure. zero = ate, negative = πŸ’€. no in-between. periodt.


πŸ¦‹ SEE ALSO πŸ¦‹

the Kernel file ./drivers/mtd/ubi/ubi.h and honestly her whole friend group:

like the whole squad showed up to the function πŸ’œ


and that's the page!! 🧚 from ./drivers/mtd/ubi, stamped October 2026, filed under struct ubi_work(9) β€” mwah, go read the source, ily, bye πŸ“πŸ’–

πŸ“¦ where this page comes from