STRUCT UBI_LEB_CHANGE_REQ(9)
π struct ubi_leb_change_req(9) β the kernel API manual, bestie edition
okay so picture this: it's struct ubi_leb_change_req(9), from the Kernel API Manual, and it's literally the data structure you pass in when you want an atomic LEB change. That's it. That's the whole vibe. β¨
π NAME π
struct ubi_leb_change_req β a data structure used in atomic LEB change requests. no cap, that's what it is.
πΈ SYNOPSIS πΈ
struct ubi_leb_change_req {
__s32 lnum;
__s32 bytes;
__s8 dtype;
__s8 padding[7];
};
look at her. iconic. four fields, zero notes. π«Ά
π Members π
lnumβ the logical eraseblock number you're changing. like, which LEB, bestie. π―bytesβ how many bytes will be written to the logical eraseblock. count 'em. π’dtypeβ pass"3"for better compatibility with old kernels. yes, literally the string three, the value 3, you get it. πpaddingβ reserved for future, not used, has to be zeroed. it's giving "seat saved for someone who's never showing up" π β but fr fr, zero it out.
π¦ Description π¦
okay so story time, because dtype has lore. πβ¨
The dtype field used to inform UBI about what kind of data will be written to the LEB, and the options were:
- long term (value 1)
- short term (value 2)
- unknown (value 3)
UBI tried to pick a PEB with lower erase counter for short term data and a PEB with higher erase counter for long term data. the way it was out here trying to be smart π
But this was not really used β because users usually do not know this and could easily mislead UBI. imagine that. misleading the kernel. embarrassing but relatable. π
So we removed this feature in May 2012. periodt. ποΈ
UBI currently just ignores the dtype field. but for better compatibility with older kernels it is recommended to set dtype to 3 (unknown). so yeah β set it to 3. it's the safe, cute, universally-agreed-upon choice. π
ngl if you're out here setting dtype to 1 or 2 expecting special treatment: UBI is not reading that. she's ignoring you. respectfully. π
π₯ SEE ALSO π₯
- Kernel file
./include/uapi/mtd/ubi-user.h struct ubi_attach_req(9)struct ubi_mkvol_req(9)struct ubi_rsvol_req(9)struct ubi_rnvol_req(9)struct ubi_ecinfo_req(9)struct ubi_map_req(9)struct ubi_set_vol_prop_req(9)struct ubi_blkcreate_req(9)
the whole friend group, all linked, all slaying in their own little headers. iykyk π
π sign-off π
and that's the page, bestie! this little beauty lives in ./include/uapi/mtd, the date on it is October 2026, and it's filed under struct ubi_leb_change_req(9) β go forth, zero your padding, set dtype to 3, and slay. πππ§ββοΈβ
π¦ 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