fscrypt_prepare_link(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so bestie, welcome to fscrypt_prepare_link(9) β€” the little helper that does the vibe check before you link an inode into a directory that might be encrypted. it's giving "let me check the key situation first" energy and honestly? iconic. πŸŽ€


✨ NAME ✨

fscrypt_prepare_link β€” prepare to link an inode into a possibly-encrypted directory. no cap, that's literally the whole job. πŸ¦‹


🫢 SYNOPSIS 🫢

int fscrypt_prepare_link (struct dentry *old_dentry , struct inode *dir
, struct dentry *dentry );

🌸 ARGUMENTS 🌸

  • old_dentry β€” an existing dentry for the inode being linked. it's the one getting a new home, main character energy fr. πŸ‘‘
  • dir β€” the target directory. this is where the link is tryna land.
  • dentry β€” negative dentry for the target filename. yeah, "negative" like it doesn't have an inode yet β€” don't worry about it, it's fine. πŸ™ˆ

πŸ’– DESCRIPTION πŸ’–

so here's the tea: a new link can only be added to an encrypted directory if the directory's encryption key is available β€” because otherwise we'd have no way to encrypt the filename. like, no key, no name, periodt. 😭

we also verify that the link will not violate the constraint that all files in an encrypted directory tree use the same encryption policy. consistency is slay, bestie β€” everyone in that tree has to match. πŸ’…


πŸ”₯ RETURN πŸ”₯

  • 0 on success β€” we ate. βœ…
  • -ENOKEY if the directory's encryption key is missing πŸ”‘πŸ’€
  • -EXDEV if the link would result in an inconsistent encryption policy 🚫
  • or another -errno code. surprises happen. πŸ“

🌈 SEE ALSO 🌈


and that's the whole page, bestie β€” certified fresh from ./include/linux, straight outta the Kernel API Manual, dated October 2026. go link responsibly πŸ’œβœ¨πŸ§š

πŸ“¦ where this page comes from