fscrypt_fnam...crypted_size(9)
π fscrypt_fname_encrypted_size(9) π
okay bestie so this is a page from the Kernel API Manual β specifically the entry for fscrypt_fname_encrypted_size, and ngl it's a little cutie that does exactly one job and does it slayfully β¨
πΈ NAME πΈ
fscrypt_fname_encrypted_size β literally just calculates the length of an encrypted filename π
π¦ SYNOPSIS π¦
bool fscrypt_fname_encrypted_size(const struct inode *inode, u32 orig_len,
u32 max_len, u32 *encrypted_len_ret);
β¨ ARGUMENTS β¨
inodeβ the parent inode of the dentry name being encrypted. heads up bestie, the key must already be set up before you call this πorig_lenβ the length of the original filename, the pre-glow-up version πmax_lenβ the maximum length this function is allowed to return. it's the vibe ceiling, fr frencrypted_len_retβ where the calculated length gets returned (on success). it's giving "out-parameter main character energy" π
π DESCRIPTION π
so here's the tea π΅ β filenames that are shorter than the maximum length may have their lengths increased slightly by encryption. why? because of padding that gets applied. that's it, that's the whole thing. the padding is the reason, not me πΈ
π₯ RETURN π₯
falseiforig_lenis greater thanmax_lenπ (too long, no thank you)- otherwise
true, andencrypted_len_retgets filled out with the length (up tomax_len) β
like, it literally cannot go over max_len, that's the whole boundary check. respect the boundary π«Ά
π SEE ALSO π
kernel file ./fs/crypto/fname.c plus the whole friend group:
fscrypt_fname_encrypt(9)fname_decrypt(9)fscrypt_fname_alloc_buffer(9)fscrypt_fname_free_buffer(9)fscrypt_fname_disk_to_usr(9)fscrypt_setup_filename(9)fscrypt_match_name(9)fscrypt_fname_siphash(9)
and that's the whole page bestie, no crumbs left π this one lives in ./fs/crypto, from October 2026, in the Kernel API Manual β mwah, go encrypt some filenames 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