fscrypt_policy_from_context(9)
π fscrypt_policy_from_context π
okay so bestie, welcome to the Kernel API Manual β¨ this one is a lil function that turns your fscrypt_context into an fscrypt_policy, and honestly? it's giving "glow-up transformation" π¦
πΈ NAME πΈ
fscrypt_policy_from_context β convert an fscrypt_context to an fscrypt_policy π
β¨ SYNOPSIS β¨
int fscrypt_policy_from_context (union fscrypt_policy *policy_u , const
union fscrypt_context *ctx_u , int ctx_size );
π ARGUMENTS π
policy_uβ the output policy π«Ά this is where the magic landsctx_uβ the input context, aka the raw material you're feeding inctx_sizeβ how big the input context is, in bytes (yes, bytes, we're counting π₯)
π DESCRIPTION π
Given an fscrypt_context, build the corresponding fscrypt_policy. Literally that's it, no cap β context in, policy out, slay β¨
but bestie, listen: this does not validate the settings within the policy itself β like the modes, flags, and reserved bits? yeah, not its job π if you want that check done, use fscrypt_supported_policy for it. this function is just the converter, not the bouncer at the door π
π RETURN π
0on success β we love a clean win π-EINVALif thefscrypt_contexthas an unrecognized version number or size β like, it doesn't recognize the vibe check π
π¦ SEE ALSO π¦
Kernel file ./fs/crypto/policy.c plus the whole squad:
fscrypt_policies_equal(9)fscrypt_supported_policy(9)fscrypt_new_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)
and that's the whole page, bestie π«Ά this iconic lil number lives in ./fs/crypto and the version/date stamp on it is October 2026 β periodt π
π¦ 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