ubi_eba_copy_leb(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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:

  • 0 in 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:

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