ubi_is_mapped(9)
πΈ 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 volumelnumβ 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
1if the LEB is mapped β - returns
0if 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 π¦
ubi_do_get_device_info(9)ubi_get_device_info(9)ubi_do_get_volume_info(9)ubi_get_volume_info(9)ubi_open_volume(9)ubi_open_volume_nm(9)ubi_get_num_by_path(9)ubi_open_volume_path(9)ubi_close_volume(9)leb_read_sanity_check(9)ubi_leb_read(9)ubi_leb_read_sg(9)ubi_leb_write(9)ubi_leb_erase(9)ubi_leb_unmap(9)ubi_leb_map(9)ubi_sync(9)ubi_register_volume_notifier(9)ubi_unregister_volume_notifier(9)
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
- 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