ubi_eba_write_leb(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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