fscrypt_prepare_link(9)
π fscrypt_prepare_link(9) β Kernel API Manual
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 π₯
0on success β we ate. β-ENOKEYif the directory's encryption key is missing ππ-EXDEVif the link would result in an inconsistent encryption policy π«- or another
-errnocode. surprises happen. π
π SEE ALSO π
- Kernel file
./include/linux/fscrypt.h fscrypt_needs_contents_encryption(9)fscrypt_is_nokey_name(9)fscrypt_has_encryption_key(9)fscrypt_prepare_rename(9)fscrypt_prepare_lookup(9)fscrypt_prepare_readdir(9)fscrypt_prepare_setattr(9)fscrypt_encrypt_symlink(9)
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
- 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