get_name(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 a NAME_MAX+1 char buffer to store the name. so like, size it right or it's giving chaos 😭 NAME_MAX+1 is 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 🌈

iykyk, these are the sibling functions and they're all in the same friend group 🫢 go read them next, bestie.


πŸ’€ tiny note: name really does need to point at a NAME_MAX+1 char 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