Lines Matching refs:bio
101 void bio_crypt_set_ctx(struct bio *bio, const struct blk_crypto_key *key, in bio_crypt_set_ctx() argument
117 bio->bi_crypt_context = bc; in bio_crypt_set_ctx()
120 void __bio_crypt_free_ctx(struct bio *bio) in __bio_crypt_free_ctx() argument
122 mempool_free(bio->bi_crypt_context, bio_crypt_ctx_pool); in __bio_crypt_free_ctx()
123 bio->bi_crypt_context = NULL; in __bio_crypt_free_ctx()
126 int __bio_crypt_clone(struct bio *dst, struct bio *src, gfp_t gfp_mask) in __bio_crypt_clone()
154 void __bio_crypt_advance(struct bio *bio, unsigned int bytes) in __bio_crypt_advance() argument
156 struct bio_crypt_ctx *bc = bio->bi_crypt_context; in __bio_crypt_advance()
203 bool bio_crypt_rq_ctx_compatible(struct request *rq, struct bio *bio) in bio_crypt_rq_ctx_compatible() argument
205 return bio_crypt_ctx_compatible(rq->crypt_ctx, bio->bi_crypt_context); in bio_crypt_rq_ctx_compatible()
223 static bool bio_crypt_check_alignment(struct bio *bio) in bio_crypt_check_alignment() argument
226 bio->bi_crypt_context->bc_key->crypto_cfg.data_unit_size; in bio_crypt_check_alignment()
230 bio_for_each_segment(bv, bio, iter) { in bio_crypt_check_alignment()
283 bool __blk_crypto_bio_prep(struct bio **bio_ptr) in __blk_crypto_bio_prep()
285 struct bio *bio = *bio_ptr; in __blk_crypto_bio_prep() local
286 const struct blk_crypto_key *bc_key = bio->bi_crypt_context->bc_key; in __blk_crypto_bio_prep()
289 if (WARN_ON_ONCE(!bio_has_data(bio))) { in __blk_crypto_bio_prep()
290 bio->bi_status = BLK_STS_IOERR; in __blk_crypto_bio_prep()
294 if (!bio_crypt_check_alignment(bio)) { in __blk_crypto_bio_prep()
295 bio->bi_status = BLK_STS_IOERR; in __blk_crypto_bio_prep()
303 if (blk_crypto_config_supported_natively(bio->bi_bdev, in __blk_crypto_bio_prep()
313 int __blk_crypto_rq_bio_prep(struct request *rq, struct bio *bio, in __blk_crypto_rq_bio_prep() argument
321 *rq->crypt_ctx = *bio->bi_crypt_context; in __blk_crypto_rq_bio_prep()