do_lookup_nm(9)
π do_lookup_nm(9) β the kernel API manual, but make it make sense
okay so this is a page from the Kernel API Manual (yes, section 9, the kernel-y one) and honestly? it's a whole vibe. we're talking about do_lookup_nm today bestie, so grab a strawberry drink π and let's get into it.
β¨ NAME β¨
do_lookup_nm β look up a "hashed" node. that's it, that's the tweet. π
πΈ SYNOPSIS πΈ
int do_lookup_nm (struct ubifs_info *c , const union ubifs_key *key ,
void *node , const struct fscrypt_name *nm );
like, four things go in, an int comes out. main character signature fr fr.
π ARGUMENTS π
cβ the UBIFS file-system description object. the whole file system's little ID card, basically πͺͺkeyβ the node key we're looking up. this is the search term, the vibe check, the ~what are we even here for~ πnodeβ the node gets returned here. it's an out-param bestie, you bring the bucket, the function fills it πͺ£nmβ the node name. the name-name, not the hashed-ish name π
π¦ DESCRIPTION π¦
so the way that this function works is β it looks up and reads a node that contains the name hash in the key. periodt. π
but here's the thing: because the hash can have collisions π there may be many nodes sharing the exact same key. so no, we can't just grab the first one and call it a day (not me being lazy). we have to sequentially look at all of them until the needed one is found. one by one. icon behavior, honestly π§
as for what it returns:
0if it's a success β slay β¨-ENOENTif the node was not found β it's giving ghosted π- a negative error code if something failed β rough, but we move π
ngl, that collision part is the whole plot. don't skip it. the hash matching key does not guarantee you found the right node, so the scan is not optional. π₯
π SEE ALSO π
all the siblings, cousins, and adjacent characters in the family group chat β every single one of them, no cap:
kernel file ./fs/ubifs/tnc.c and then, breathe, here we go:
insert_old_idx(9), insert_old_idx_znode(9), ins_clr_old_idx_znode(9), destroy_old_idx(9), copy_znode(9), add_idx_dirt(9), replace_znode(9), dirty_cow_znode(9), lnc_add(9), lnc_free(9), tnc_read_hashed_node(9), try_read_node(9), fallible_read_node(9), matches_name(9), get_znode(9), tnc_next(9), tnc_prev(9), resolve_collision(9), fallible_matches_name(9), fallible_resolve_collision(9), matches_position(9), resolve_collision_directly(9), dirty_cow_bottom_up(9), ubifs_lookup_level0(9), lookup_level0_dirty(9), maybe_leb_gced(9), ubifs_tnc_locate(9), ubifs_tnc_get_bu_keys(9), read_wbuf(9), validate_data_node(9), ubifs_tnc_bulk_read(9), ubifs_tnc_lookup_nm(9), ubifs_tnc_lookup_dh(9), correct_parent_keys(9), insert_zbranch(9), tnc_insert(9), ubifs_tnc_add(9), ubifs_tnc_replace(9), ubifs_tnc_add_nm(9), tnc_delete(9), ubifs_tnc_remove(9), ubifs_tnc_remove_nm(9), ubifs_tnc_remove_dh(9), key_in_range(9), ubifs_tnc_remove_range(9), ubifs_tnc_remove_ino(9), ubifs_tnc_next_ent(9), tnc_destroy_cnext(9), ubifs_tnc_close(9), left_znode(9), right_znode(9), lookup_znode(9), is_idx_node_in_tnc(9), is_leaf_node_in_tnc(9), ubifs_tnc_has_node(9), ubifs_dirty_idx_node(9), dbg_check_inode_size(9).
like, that's the entire friend group. say hi to all of them or it's weird. π«Ά
and that's the page! π it comes to you courtesy of the source ./fs/ubifs, dated October 2026 β so mark your calendar bestie, this manual page is a Scorpio (or maybe a Libra, don't quote me) and it said see you then. 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