fscrypt_nee...s_encryption(9)
β¨ fscrypt_needs_contents_encryption β¨
okay bestie, gather round, because today we're looking at a little function from the Kernel API Manual called fscrypt_needs_contents_encryption π
and honestly? it's giving "small but mighty" energy
πΈ SYNOPSIS πΈ
bool fscrypt_needs_contents_encryption(const struct inode *inode);
like, that's it. that's the whole vibe. one inode in, one bool out π
π¦ ARGUMENTS π¦
inodeβ the inode you wanna check, bestie. that's the whole assignment π
π RETURN π
so it returns true iff the inode is an encrypted regular file and the kernel was built with fscrypt support β¨
read that "iff" carefully babes, it's doing a LOT of heavy lifting β both conditions gotta be slaying at the same time or it's a no from her π
π DESCRIPTION π
okay so here's the tea, and it's important so don't scroll past π«Ά
if you need to know whether the encrypt bit is set even when the kernel was built without fscrypt support, you must use IS_ENCRYPTED directly instead. like, that's the move. no cap. fscrypt_needs_contents_encryption will not help you there and that's just the rules π
fr fr, remember: this function cares about both the file being an encrypted regular file and the kernel having fscrypt support. if the second one's missing, she's not the one you want β go straight to IS_ENCRYPTED π
π₯ SEE ALSO π₯
the squad, the entourage, the whole friend group π«Ά all hanging out in the kernel file ./include/linux/fscrypt.h:
fscrypt_is_nokey_name(9)fscrypt_has_encryption_key(9)fscrypt_prepare_link(9)fscrypt_prepare_rename(9)fscrypt_prepare_lookup(9)fscrypt_prepare_readdir(9)fscrypt_prepare_setattr(9)fscrypt_encrypt_symlink(9)
like, go off, entire fscrypt family ππ
alright that's the page bestie, mwah π this lil icon lives in ./include/linux, it's part of the Kernel API Manual, and it's dated October 2026 β periodt, that's the sign-off, love u, bye πβ¨π¦
π¦ 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