fscrypt_match_name(9)
π fscrypt_match_name(9) β the Kernel API Manual page you didn't know you needed
okay so bestie, welcome to fscrypt_match_name(9) from the Kernel API Manual β yes that's the manual name, we're not copying the whole header line, we're living it. this one's a little boolean baddie that answers the most dramatic question in all of fscrypt: does this name match this directory entry or not π
β¨ SYNOPSIS β¨
bool fscrypt_match_name (const struct fscrypt_name *fname , const u8
*de_name , u32 de_name_len );
like, it returns a bool, it takes three things, it's giving "small function, big responsibility" energy. periodt. π¦
πΈ ARGUMENTS πΈ
fnameβ the name we're out here searching for, our main character honestly πde_nameβ the name straight out of the directory entry, the one we're checking againstde_name_lenβ how longde_nameis, in bytes. bytes bestie, not vibes π
π DESCRIPTION π
okay so normally, fname->disk_name will be set, and when it is? we literally just compare that to the name stored in the directory entry. simple. clean. no notes. β¨
the one exception (and it's kind of a big one, ngl) is this: if we don't have the key for an encrypted directory and the name we're looking for is very long, then we won't have the full disk_name π β so instead we'll need to match against a fscrypt_nokey_name that includes a strong hash. no key, extra long name, hash-matching era. iykyk π§
it's giving "we can't read the whole thing so we're comparing fingerprints instead" and honestly? iconic.
β RETURN β
true if the name matches, otherwise false. that's it, that's the whole vibe check. π
π₯ SEE ALSO π₯
Kernel file ./fs/crypto/fname.c plus the whole friend group:
fscrypt_fname_encrypt(9)fname_decrypt(9)fscrypt_fname_encrypted_size(9)fscrypt_fname_alloc_buffer(9)fscrypt_fname_free_buffer(9)fscrypt_fname_disk_to_usr(9)fscrypt_setup_filename(9)fscrypt_fname_siphash(9)
and that's the page bestie π«Ά this came from the ./fs/crypto source, dated October 2026, and it's fscrypt_match_name(9) officially signing off β go compare some names, slay, and remember: long encrypted name with no key means hash matching, not a breakdown πβ¨
π¦ 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