STRUCT UBI_WORK(9)
π 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:
struct ubi_vid_io_buf(9)struct ubi_wl_entry(9)struct ubi_ltree_entry(9)struct ubi_rename_entry(9)struct ubi_fastmap_layout(9)struct ubi_fm_pool(9)struct ubi_eba_leb_desc(9)struct ubi_volume(9)struct ubi_volume_desc(9)struct ubi_debug_info(9)struct ubi_device(9)struct ubi_ainf_peb(9)struct ubi_ainf_volume(9)struct ubi_attach_info(9)ubi_init_vid_buf(9)ubi_free_vid_buf(9)ubi_get_vid_hdr(9)ubi_ro_mode(9)vol_id2idx(9)idx2vol_id(9)ubi_is_fm_vol(9)ubi_find_fm_block(9)
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
- 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