fscrypt_prep...okup_partial(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… fscrypt_prep...okup_partial(9)

okay so this is a page straight out of the Kernel API Manual, and bestie, it's a lil niche one but we're gonna make it make sense πŸ’–


✨ NAME ✨

fscrypt_prepare_lookup_partial β€” prepare lookup without the filename setup

like yes she does the prep work, but she is NOT doing the whole name thing, and that's the entire point πŸŽ€


🌸 SYNOPSIS 🌸

int fscrypt_prepare_lookup_partial (struct inode *dir , struct dentry
*dentry );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • dir β€” the encrypted directory being searched πŸ‘€ that's the one we're digging around in
  • dentry β€” the dentry being looked up in dir, aka the thing we're trying to find in there πŸ”

πŸ’œ DESCRIPTION πŸ’œ

okay so here's the vibe check: this function is for the ->lookup and ->atomic_open methods of filesystems that handle filename encryption and no-key name encoding themselves β€” meaning they literally can't use fscrypt_prepare_lookup. like, they're built different, they do it their own way, respect πŸ’…

so what does she actually do? like fscrypt_prepare_lookup, this function will try to set up the directory's encryption key πŸ”‘ and it will set DCACHE_NOKEY_NAME on the dentry if the key is unavailable. periodt.

but β€” and this is the main character difference β€” this function does not set up a struct fscrypt_name for the filename. nope! not her job! someone else's problem! πŸ™ˆ


⭐ RETURN ⭐

  • 0 on success πŸŽ‰
  • -errno on error 😭
wait, before you panic: the encryption key being unavailable is not considered an error. nope, not a vibe killer. also β€” it's not an error if the encryption policy is unsupported by this kernel either! that's just treated like the key being unavailable, so that files can still be deleted πŸ—‘οΈβœ¨ (yes that's intentional, she's being nice so you can still clean up)

🌈 SEE ALSO 🌈

like, go read the whole friend group honestly, they're all iconic πŸ‘‘


🫢 and that's the page! brought to you by the fine folks over at ./fs/crypto, dated October 2026 β€” ty for coming to my ted talk, mwah πŸ’‹πŸŒΈ

πŸ“¦ where this page comes from