ubi_eba_copy_leb(9)
π ubi_eba_copy_leb(9) β the glow-up edition π
okay so bestie, we're deep in the UBI (unsorted block images) part of the kernel here, and this one is literally about moving a logical eraseblock from one physical eraseblock to another. it's giving "moving day but for flash memory" energy. let's get into it β¨
πΈ NAME πΈ
ubi_eba_copy_leb β copy logical eraseblock. that's it, that's the vibe. π
π¦ SYNOPSIS π¦
int ubi_eba_copy_leb (struct ubi_device *ubi , int from , int to ,
struct ubi_vid_io_buf *vidb );
like, look at that signature. iconic. π
π ARGUMENTS π
ubiβ UBI device description object. this is the main character of the operation, fr fr. πfromβ physical eraseblock number from where to copy. the starting point, the origin story. π©toβ physical eraseblock number where to copy. the destination, the new home. π‘vidbβ data structure from where the VID header is derived. so like, the source of truth for the VID header info. πΎ
π₯ DESCRIPTION π₯
okay so here's the tea: this function copies a logical eraseblock from physical eraseblock from to physical eraseblock to. the way it just scoops up the data and plops it somewhere else? slay. π
β¨
β οΈ heads up bestie β the vid_hdr buffer may be changed by this function. so don't come for it later expecting it to be exactly how you left it, iykyk. π«Ά
and it returns:
0in case of success β we love a W. β πMOVE_CANCEL_RACE,MOVE_TARGET_WR_ERR,MOVE_TARGET_BITFLIPS, etc β these are the plot twists, the little "hmm not quite" returns. π- a negative error code in case of failure β the flop era. π
π SEE ALSO π
okay this list is long but every single one is part of the squad, so we're listing them all. no skipping, periodt. π
kernel file ./drivers/mtd/ubi/eba.c, plus:
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)ubi_eba_write_leb_st(9)is_error_sane(9)print_rsvd_warning(9)self_check_eba(9)ubi_eba_init(9)
like, that's the whole friend group right there. go read up on them if you wanna understand the full lore. ππ
and that's the page bestie! this gem lives in ./drivers/mtd/ubi and it's dated October 2026, so it's got that fresh-from-the-future energy. catch you in the kernel, 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