Lines Matching refs:rq
193 bool bio_crypt_rq_ctx_compatible(struct request *rq, struct bio *bio)
195 return bio_crypt_ctx_compatible(rq->crypt_ctx, bio->bi_crypt_context);
228 blk_status_t __blk_crypto_rq_get_keyslot(struct request *rq)
230 return blk_crypto_get_keyslot(rq->q->crypto_profile,
231 rq->crypt_ctx->bc_key,
232 &rq->crypt_keyslot);
235 void __blk_crypto_rq_put_keyslot(struct request *rq)
237 blk_crypto_put_keyslot(rq->crypt_keyslot);
238 rq->crypt_keyslot = NULL;
241 void __blk_crypto_free_request(struct request *rq)
244 if (WARN_ON_ONCE(rq->crypt_keyslot))
245 __blk_crypto_rq_put_keyslot(rq);
247 mempool_free(rq->crypt_ctx, bio_crypt_ctx_pool);
248 rq->crypt_ctx = NULL;
303 int __blk_crypto_rq_bio_prep(struct request *rq, struct bio *bio,
306 if (!rq->crypt_ctx) {
307 rq->crypt_ctx = mempool_alloc(bio_crypt_ctx_pool, gfp_mask);
308 if (!rq->crypt_ctx)
311 *rq->crypt_ctx = *bio->bi_crypt_context;