ubi_is_mapped(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 ubi_is_mapped(9) 🌸

okay so bestie, welcome to the ubi_is_mapped page from the Kernel API Manual πŸ’… this one's a little kernel function that tells you whether a logical eraseblock is mapped, and honestly? she's iconic. let's get into it 🫢


✨ NAME ✨

ubi_is_mapped β€” check if logical eraseblock is mapped. literally that's her whole job πŸŽ€


✨ SYNOPSIS ✨

int ubi_is_mapped (struct ubi_volume_desc *desc , int lnum );

✨ ARGUMENTS ✨

  • desc β€” the volume descriptor πŸ’– like your VIP pass to the volume
  • lnum β€” the logical eraseblock number 🌈 which LEB we're checking, bestie

✨ DESCRIPTION ✨

so this function checks whether logical eraseblock lnum is mapped to a physical eraseblock. simple enough, right? πŸ’€

but here's the plot twist πŸ‘€ if a logical eraseblock is un-mapped, that does not necessarily mean it'll still be un-mapped after the UBI device gets re-attached. ngl, that LEB might come back mapped to the physical eraseblock it was last mapped to. it's giving "main character energy with a mysterious past" 😭

the return values, because we love clarity:

  • returns 1 if the LEB is mapped βœ…
  • returns 0 if it's not ❌
  • returns a negative error code in case of failure πŸ™ˆ

and if the volume is damaged because of an interrupted update, this function just returns immediately with the -EBADF error code. no cap, it's outta there πŸ’¨


✨ SEE ALSO ✨

bestie the whole friend group is here, plus the kernel file she lives in:

Kernel file ./drivers/mtd/ubi/kapi.c πŸ¦‹


aaaand that's the whole page, bestie ✨ mwah πŸ’‹ this one came from ./drivers/mtd/ubi, dated October 2026, filed under ubi_is_mapped(9) β€” slay, go read the kernel source, ily πŸ§šπŸ’œ

πŸ“¦ where this page comes from