ubi_eba_write_leb(9)
β¨ ubi_eba_write_leb(9) β¨
okay so bestie, welcome to the Kernel API Manual π β literally the manual page for ubi_eba_write_leb(9), and yes we're gonna get through it together, no cap.
πΈ NAME πΈ
ubi_eba_write_leb β write data to a dynamic volume, periodt π
π¦ SYNOPSIS π¦
int ubi_eba_write_leb (struct ubi_device *ubi , struct ubi_volume *vol ,
int lnum , const void *buf , int offset , int len );
like, that's the whole signature, copy it exactly bestie, don't @ me π
π ARGUMENTS π
ubiβ the UBI device description object. it's giving "who am I writing to" main character energy πvolβ the volume description object, aka the vibe of the volume you're touching β¨lnumβ the logical eraseblock number. yes, logical. not physical. keep up π«Άbufβ literally the data to write, the actual contents, the star of the show βoffsetβ offset within the logical eraseblock where to write, so like, where in the block you're dropping it πlenβ how many bytes to write. how many. count them. π₯
π DESCRIPTION π
so this function writes data to logical eraseblock lnum of a dynamic volume vol β that's the whole thing, she's an icon, she does one job π
returns zero in case of success and a negative error code in case of failure. love that for her π
β οΈ ok important caveat bestie: in case of error, it is possible that something was still written to the flash media, but may be some garbage. so like... not a clean fail, there might be β¨mystery garbageβ¨ left behind π
also she's persistent β this function retries UBI_IO_RETRIES times before giving up. she does NOT go down without a fight π₯
π SEE ALSO π
kernel file ./drivers/mtd/ubi/eba.c and honestly the whole friend group π:
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_st(9), is_error_sane(9), ubi_eba_copy_leb(9), print_rsvd_warning(9), self_check_eba(9), ubi_eba_init(9)
that's the whole page bestie, go write some eraseblocks responsibly π§ββοΈπ β this one came from ./drivers/mtd/ubi, dated October 2026, and it's ubi_eba_write_leb(9) signing off πβ¨π«Ά
π¦ 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