fscrypt_mergeable_bio(9)
π fscrypt_mergeable_bio(9) β¨
ok so we're in the Kernel API Manual bestie, and this is the page for fscrypt_mergeable_bio(9) β the little vibe-check function that tells you whether more data can join your bio. π§
πΈ NAME πΈ
fscrypt_mergeable_bio β literally just testing whether data can be added to a bio π
β¨ SYNOPSIS β¨
bool fscrypt_mergeable_bio(struct bio *bio, const struct inode *inode,
loff_t pos);
π ARGUMENTS π
bioβ the bio you're currently building up, the main character of this whole situation πinodeβ the inode for the next part of the I/O, like the next guest arriving at the party π¦posβ the next file position (in bytes) in the I/O, so we know exactly where we're at π
π DESCRIPTION π
So here's the tea, bestie π: when you're building a bio that might contain data which needs to go through encryption (or decryption) via fscrypt, filesystems should call this function to make sure the resulting bio contains only contiguous data unit numbers. No cap. That's the whole assignment. β¨
It'll return false if the next part of the I/O can't be merged with the bio, because either:
- the encryption key would be different π, or
- the encryption data unit numbers would be discontiguous π
β οΈ Heads up babes:fscrypt_set_bio_crypt_ctxmust have already been called on thebio. Like, before this. Non-negotiable. π
And ngl, this function isn't required in cases where crypto-mergeability is ensured in another way β for example, I/O targeting only a single file (and thus a single key) combined with fscrypt_limit_io_blocks to ensure DUN contiguity. iykyk π
π₯ RETURN π₯
true iff the I/O is mergeable. That's it, that's the whole vibe check π
π SEE ALSO π
- Kernel file
./fs/crypto/block.cβ the source, the origin story π fscrypt_set_bio_crypt_ctx(9)βfscrypt_limit_io_blocks(9)βfscrypt_zeroout_range(9)β
ok that's the page, mwah π«Ά β this gem lives over in ./fs/crypto, dated October 2026, and it's the fscrypt_mergeable_bio(9) page, 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