Lines Matching refs:rq
186 bool bio_crypt_rq_ctx_compatible(struct request *rq, struct bio *bio) in bio_crypt_rq_ctx_compatible() argument
188 return bio_crypt_ctx_compatible(rq->crypt_ctx, bio->bi_crypt_context); in bio_crypt_rq_ctx_compatible()
221 blk_status_t __blk_crypto_rq_get_keyslot(struct request *rq) in __blk_crypto_rq_get_keyslot() argument
223 return blk_ksm_get_slot_for_key(rq->q->ksm, rq->crypt_ctx->bc_key, in __blk_crypto_rq_get_keyslot()
224 &rq->crypt_keyslot); in __blk_crypto_rq_get_keyslot()
227 void __blk_crypto_rq_put_keyslot(struct request *rq) in __blk_crypto_rq_put_keyslot() argument
229 blk_ksm_put_slot(rq->crypt_keyslot); in __blk_crypto_rq_put_keyslot()
230 rq->crypt_keyslot = NULL; in __blk_crypto_rq_put_keyslot()
233 void __blk_crypto_free_request(struct request *rq) in __blk_crypto_free_request() argument
236 if (WARN_ON_ONCE(rq->crypt_keyslot)) in __blk_crypto_free_request()
237 __blk_crypto_rq_put_keyslot(rq); in __blk_crypto_free_request()
239 mempool_free(rq->crypt_ctx, bio_crypt_ctx_pool); in __blk_crypto_free_request()
240 rq->crypt_ctx = NULL; in __blk_crypto_free_request()
296 int __blk_crypto_rq_bio_prep(struct request *rq, struct bio *bio, in __blk_crypto_rq_bio_prep() argument
299 if (!rq->crypt_ctx) { in __blk_crypto_rq_bio_prep()
300 rq->crypt_ctx = mempool_alloc(bio_crypt_ctx_pool, gfp_mask); in __blk_crypto_rq_bio_prep()
301 if (!rq->crypt_ctx) in __blk_crypto_rq_bio_prep()
304 *rq->crypt_ctx = *bio->bi_crypt_context; in __blk_crypto_rq_bio_prep()