Lines Matching defs:bio

10  * as part of the bio, instead of the filesystem doing the crypto itself via
227 * fscrypt_set_bio_crypt_ctx() - prepare a file contents bio for inline crypto
228 * @bio: a bio which will eventually be submitted to the file
235 * encryption, then assign the appropriate encryption context to the bio.
237 * Normally the bio should be newly allocated (i.e. no pages added yet), as
240 * The encryption context will be freed automatically when the bio is freed.
242 void fscrypt_set_bio_crypt_ctx(struct bio *bio, const struct inode *inode,
253 bio_crypt_set_ctx(bio, &ci->ci_enc_key.blk_key->base, dun, gfp_mask);
282 * fscrypt_set_bio_crypt_ctx_bh() - prepare a file contents bio for inline
284 * @bio: a bio which will eventually be submitted to the file
291 void fscrypt_set_bio_crypt_ctx_bh(struct bio *bio,
299 fscrypt_set_bio_crypt_ctx(bio, inode, first_lblk, gfp_mask);
304 * fscrypt_mergeable_bio() - test whether data can be added to a bio
305 * @bio: the bio being built up
309 * When building a bio which may contain data which should undergo inline
311 * to ensure that the resulting bio contains only contiguous data unit numbers.
313 * bio because either the encryption key would be different or the encryption
316 * fscrypt_set_bio_crypt_ctx() must have already been called on the bio.
320 bool fscrypt_mergeable_bio(struct bio *bio, const struct inode *inode,
323 const struct bio_crypt_ctx *bc = bio->bi_crypt_context;
340 return bio_crypt_dun_is_contiguous(bc, bio->bi_iter.bi_size, next_dun);
345 * fscrypt_mergeable_bio_bh() - test whether data can be added to a bio
346 * @bio: the bio being built up
354 bool fscrypt_mergeable_bio_bh(struct bio *bio,
361 return !bio->bi_crypt_context;
363 return fscrypt_mergeable_bio(bio, inode, next_lblk);