fscrypt_new_context(9)
β¨ NAME β¨
hiii bestie π welcome to fscrypt_new_context(9) from the Kernel API Manual π β this one is literally about creating a new fscrypt_context, no cap.
πΈ SYNOPSIS πΈ
the way this function pulls up is lowkey iconic:
int fscrypt_new_context (union fscrypt_context *ctx_u , const union
fscrypt_policy *policy_u , const u8 nonce[FSCRYPT_FILE_NONCE_SIZE] );
π¦ ARGUMENTS π¦
ctx_uβ the output context π«Ά β like, this is where the new context goes.policy_uβ the input policy β¨ β the encryption policy you're working with.nonceβ the nonce to use π β and the description has a whole rule about this one: it must be a new random nonce. not me catching you trying to reuse one π
π DESCRIPTION π
okay so this function creates an fscrypt_context for an inode that is being assigned the given encryption policy π. that's the main character move.
and bestie, listen: nonce must be a new random nonce π₯. like, fr fr, do not play with that. fresh random nonce only.
π RETURN π
it returns the size of the new context in bytes β that's the whole return vibe, periodt π β¨.
π SEE ALSO π
peep the kernel file over at ./fs/crypto/policy.c π, plus these function besties:
fscrypt_policies_equal(9)fscrypt_supported_policy(9)fscrypt_policy_from_context(9)fscrypt_has_permitted_context(9)fscrypt_context_for_new_inode(9)fscrypt_set_context(9)fscrypt_parse_test_dummy_encryption(9)fscrypt_dummy_policies_equal(9)fscrypt_show_test_dummy_encryption(9)
mwah π this page's source/version is ./fs/crypto, and it's dated October 2026 β cute little sign-off, slay π§π
π¦ 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