get_name(9)
β¨ get_name(9) β¨
okay so bestie, we're deep in the Kernel API Manual today and this one is a lil function called get_name π like yes she's giving "who am I, really?" but for dentries. very main character, very filesystem-core π
πΈ NAME πΈ
get_name β the default export_operations->get_name function β¨
like, if nobody else defined a get_name for their export ops, this is the one that shows up. she's the default, she's the blueprint, she ate π«Ά
π¦ SYNOPSIS π¦
int get_name (const struct path *path , char *name , struct dentry
*child );
three args in, one int out, no cap π
π ARGUMENTS π
pathβ the directory in which to find a name. it's the parent dir we're snooping around in πnameβ a pointer to aNAME_MAX+1char buffer to store the name. so like, size it right or it's giving chaos πNAME_MAX+1is literally the requirement, not a suggestion.childβ the dentry for the child directory. this is the one whose name we're hunting for, lowkey the whole reason we're here π
π DESCRIPTION π
so the vibe is: get_name calls readdir on the parent, over and over, until it finds an entry with the same inode number as the child β and then it returns that. periodt β¨
that's it. that's the function. she reads the parent directory until the inode numbers match, and that matching entry is the answer we were looking for π« genuinely iconic behavior, ngl.
π SEE ALSO π
- the kernel file
./fs/exportfs/expfs.cβ that's where the lore lives π exportfs_encode_ino64_fid(9)exportfs_encode_inode_fh(9)exportfs_encode_fh(9)
iykyk, these are the sibling functions and they're all in the same friend group π«Ά go read them next, bestie.
π tiny note:namereally does need to point at aNAME_MAX+1char buffer. don't skimp. the function is trusting you and we do not betray her.
mwah π that's the page!! sourced from ./fs/exportfs and dated October 2026 β screenshot it, cite it, put it on your mood board, whatever, just remember the details πΈπ§ββοΈβ¨
π¦ 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