fscrypt_dec...lock_inplace(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 of FSCRYPT_CONTENTS_ALIGNMENT. not kinda-sorta a multiple. a multiple. periodt ✨
  • offs β€” byte offset within page where 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 ⭐

  • 0 on success πŸŽ‰ slay
  • -errno on failure πŸ˜” it's giving error code

πŸ” SEE ALSO πŸ”

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