fscrypt_mergeable_bio(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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_ctx must have already been called on the bio. 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 πŸ‘‘


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