ltree_lookup(9)
π ltree_lookup β the manual page, but make it make sense
okay so bestie, welcome to ltree_lookup(9), a Kernel API Manual moment. this is the lil function that peeks into the lock tree and tells you what's what. short page, but it matters, so let's go π«Ά
β¨ NAME β¨
ltree_lookup β look up the lock tree. that's it, that's the whole vibe. π₯
β¨ SYNOPSIS β¨
struct ubi_ltree_entry * ltree_lookup (struct ubi_device *ubi , int
vol_id , int lnum );
like the signature says β takes a device, a volume ID, and a logical eraseblock number, hands you back a pointer. iconic behavior honestly π
β¨ ARGUMENTS β¨
ubiβ the UBI device description object. this is your main character, the whole device you're poking at πvol_idβ the volume ID. which volume we're talking about, bestie πlnumβ the logical eraseblock number. the specific block inside that volume πΈ
β¨ DESCRIPTION β¨
so here's the tea β β ltree_lookup returns a pointer to the corresponding struct ubi_ltree_entry object if the logical eraseblock is locked. and if it's not locked? you get NULL. no in-between, no "maybe", just pointer or NULL, periodt π
β οΈ real talk though: ubi->ltree_lock has to be locked before you call this. that's not a suggestion, that's the contract. don't be the person who forgets it π
β¨ SEE ALSO β¨
the Kernel file to go look at is ./drivers/mtd/ubi/eba.c β go read it, it's giving lore π
and here's the whole friend group, no cap:
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_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)ubi_eba_copy_leb(9)print_rsvd_warning(9)self_check_eba(9)ubi_eba_init(9)
and that's the page! π¦ this lil cutie lives in ./drivers/mtd/ubi, it's dated October 2026, and yeah β we're calling it ltree_lookup(9). mwah, slay, go lock your ltree_lock πβ¨
π¦ 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