fscrypt_nee...s_encryption(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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:

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