fscrypt_zeroout_range(9)
π fscrypt_zeroout_range(9) β the Kernel API Manual glow-up π
okay bestie, welcome to the Kernel API Manual entry for fscrypt_zeroout_range(9) β yes that's the full manual name, we're fancy like that β¨
β¨ NAME β¨
fscrypt_zeroout_range β zero out a range of blocks in an encrypted file π«Ά
πΈ SYNOPSIS πΈ
int fscrypt_zeroout_range (const struct inode *inode , loff_t pos ,
sector_t sector , u64 len );
π¦ ARGUMENTS π¦
inodeβ the file's inode, like the file's main character ID πposβ the first file position (in bytes) to zero out πsectorβ the first sector to zero out π§lenβ bytes to zero out, and yes it's counting bytes, not vibes π
π₯ DESCRIPTION π₯
So what this actually does: it zeroes out filesystem blocks in an encrypted regular file on-disk β meaning it writes ciphertext blocks that decrypt to the all-zeroes block. Not me explaining crypto at 2am but here we are π
The blocks have to be both logically and physically contiguous. No skipping, no gaps, no chaos, periodt π
It's also assumed that the filesystem only uses a single block device, ->s_bdev. That's the vibe check it's operating under π
And len must be a multiple of the file system logical block size. Like, mandatory. No cap π¨
Also important, bestie: since each block uses a different IV, this involves writing a different ciphertext to each block β we can't simply reuse the same one. Each block gets its own little encrypted outfit, iykyk π
β RETURN β
0 on success; -errno on failure. Slay when it works, errno when it doesn't π
π SEE ALSO π
Kernel file ./fs/crypto/block.c and its besties:
and that's the whole page, iconically complete πβ¨π
source/version: ./fs/crypto Β· date: October 2026 Β· page: fscrypt_zeroout_range(9) β mwah, go read the kernel docs bestie π«Άπ
π¦ 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