ubi_eba_write_leb_st(9)
π ubi_eba_write_leb_st(9) β the Kernel API Manual glow-up π
okay so bestie, welcome to the ubi_eba_write_leb_st(9) page β¨ this is straight out of the Kernel API Manual and it's gonna be a whole vibe, trust.
πΈ NAME πΈ
ubi_eba_write_leb_st β write data to static volume. that's it, that's the entire job description, and she does it slayfully π
π¦ SYNOPSIS π¦
int ubi_eba_write_leb_st (struct ubi_device *ubi , struct ubi_volume
*vol , int lnum , const void *buf , int len , int used_ebs );
yes she takes SIX arguments, main character energy fr fr π
π ARGUMENTS π
ubiβ the UBI device description object. like, the device itself, the whole situation.volβ the volume description object. the specific volume we're messing with πlnumβ logical eraseblock number. literally which LEB we're writing to, no cap.bufβ the data to write. the actual goods πlenβ how many bytes to write. how much of the goods.used_ebsβ how many logical eraseblocks this volume will contain. the full count, bestie, we need the whole picture π
β¨ DESCRIPTION β¨
so this function writes data to logical eraseblock lnum of static volume vol. super self-explanatory, she's an icon. the used_ebs argument should contain the total number of logical eraseblock in this static volume β yes, total, all of them, don't skimp π
now here's the part where you gotta pay attention because it's giving specific:
when you're writing to the last logical eraseblock, the len argument doesn't have to be aligned to the minimal I/O unit size. instead, it has to be equivalent to the real data size β even though the buf buffer still has to contain the alignment. like, the buffer stays aligned, but len tells the truth about the actual data. in all other cases, len has to be aligned. periodt. π₯
π¨ real talk, highkey important: it is prohibited to write more than once to logical eraseblocks of static volumes. once and done. no take-backs, no double-dipping π
she returns zero in case of success and a negative error code in case of failure. classic.
π SEE ALSO π
buckle up, this list is LONG and honestly iconic. all of these live in the kernel file ./drivers/mtd/ubi/eba.c, and here's the whole squad:
struct ubi_eba_entry(9)struct ubi_eba_table(9)ubi_next_sqnum(9)ubi_get_compat(9)ubi_eba_get_ldesc(9)ubi_eba_create_table(9)ubi_eba_destroy_table(9)ubi_eba_copy_table(9)ubi_eba_replace_table(9)ltree_lookup(9)ltree_add_entry(9)leb_read_lock(9)leb_read_unlock(9)leb_write_lock(9)leb_write_trylock(9)leb_write_unlock(9)ubi_eba_is_mapped(9)ubi_eba_unmap_leb(9)check_mapping(9)ubi_eba_read_leb(9)ubi_eba_read_leb_sg(9)try_recover_peb(9)recover_peb(9)try_write_vid_and_data(9)ubi_eba_write_leb(9)is_error_sane(9)ubi_eba_copy_leb(9)print_rsvd_warning(9)self_check_eba(9)ubi_eba_init(9)
ngl that's a lot of friends but they're all valid π«Ά
π cute lil sign-off: this page came from./drivers/mtd/ubi, dated October 2026, and it's filed underubi_eba_write_leb_st(9). go forth and write your static volume exactly once, bestie. mwah ππ
π¦ 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