fscrypt_dec...lock_inplace(9)
π fscrypt_decrypt_block_inplace β the Kernel API Manual, but make it make sense π
okay so bestie, welcome to the Kernel API Manual page for fscrypt_dec...lock_inplace(9) β yes the header truncates it like that, it's giving "my name is too long for the title bar" energy, but the real full name is fscrypt_decrypt_block_inplace, and we're gonna get you through it together π«Ά
β¨ NAME β¨
fscrypt_decrypt_block_inplace β decrypt a filesystem block in-place, literally right where it's sitting, no moving boxes required π¦π
π¦ SYNOPSIS π¦
int fscrypt_decrypt_block_inplace (const struct inode *inode , struct
page *page , unsigned int len , unsigned int offs , u64 lblk_num );
that's the whole signature, copied exactly, no cap. five arguments, one int coming back at you π₯
π ARGUMENTS π
inodeβ the inode this block belongs to. like, whose block is this? this one. πΈpageβ the page that's holding the block you wanna decrypt. it's right there, in a page. π¦lenβ how big the block to decrypt is. important: this must be a multiple ofFSCRYPT_CONTENTS_ALIGNMENT. not kinda-sorta a multiple. a multiple. periodt β¨offsβ byte offset withinpagewhere the block to decrypt starts. so like, where in the page the vibes begin πlblk_numβ the filesystem logical block number of the block, i.e. the 0-based number of the block within the file. zero-based, bestie, we start counting at 0 in this house π’π
π DESCRIPTION π
so what does it actually do? it decrypts a possibly-compressed filesystem block that lives in an arbitrary page β and by arbitrary I mean not necessarily the original pagecache page. the block is just vibing somewhere else, and this function is the one that handles it π§
and here's the thing: you have to specify inode and lblk_num yourself, because they literally cannot be determined from page. the page doesn't know, okay? it's not omniscient. you gotta tell it. π
β οΈ big caveat incoming: this function only supports non-block-based filesystems that don't support sub-block data units β as indicated by the fscrypt_operations fields. so if that's not your setup, this is not your function, bestie. vibe check failed π
β RETURN β
0on success π slay-errnoon failure π it's giving error code
π SEE ALSO π
- Kernel file
./fs/crypto/crypto.c fscrypt_free_bounce_page(9)fscrypt_encrypt_pagecache_blocks(9)fscrypt_encrypt_block_inplace(9)fscrypt_initialize(9)
all of these are real and listed in the original, go read them, iykyk ππ
and that's the page!! π this little icon lives in ./fs/crypto, it's dated October 2026, and it's part of the Kernel API Manual β mwah, go decrypt something, ily, 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