Commit 435c0e99 authored by Eric Biggers's avatar Eric Biggers Committed by Jens Axboe

blk-crypto: remove blk_crypto_insert_cloned_request()

blk_crypto_insert_cloned_request() is the same as
blk_crypto_rq_get_keyslot(), so just use that directly.
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20230315183907.53675-2-ebiggers@kernel.orgSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 5c7cb944
...@@ -270,8 +270,7 @@ Request queue based layered devices like dm-rq that wish to support inline ...@@ -270,8 +270,7 @@ Request queue based layered devices like dm-rq that wish to support inline
encryption need to create their own blk_crypto_profile for their request_queue, encryption need to create their own blk_crypto_profile for their request_queue,
and expose whatever functionality they choose. When a layered device wants to and expose whatever functionality they choose. When a layered device wants to
pass a clone of that request to another request_queue, blk-crypto will pass a clone of that request to another request_queue, blk-crypto will
initialize and prepare the clone as necessary; see initialize and prepare the clone as necessary.
``blk_crypto_insert_cloned_request()``.
Interaction between inline encryption and blk integrity Interaction between inline encryption and blk integrity
======================================================= =======================================================
......
...@@ -205,21 +205,6 @@ static inline int blk_crypto_rq_bio_prep(struct request *rq, struct bio *bio, ...@@ -205,21 +205,6 @@ static inline int blk_crypto_rq_bio_prep(struct request *rq, struct bio *bio,
return 0; return 0;
} }
/**
* blk_crypto_insert_cloned_request - Prepare a cloned request to be inserted
* into a request queue.
* @rq: the request being queued
*
* Return: BLK_STS_OK on success, nonzero on error.
*/
static inline blk_status_t blk_crypto_insert_cloned_request(struct request *rq)
{
if (blk_crypto_rq_is_encrypted(rq))
return blk_crypto_rq_get_keyslot(rq);
return BLK_STS_OK;
}
#ifdef CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK #ifdef CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK
int blk_crypto_fallback_start_using_mode(enum blk_crypto_mode_num mode_num); int blk_crypto_fallback_start_using_mode(enum blk_crypto_mode_num mode_num);
......
...@@ -3049,7 +3049,7 @@ blk_status_t blk_insert_cloned_request(struct request *rq) ...@@ -3049,7 +3049,7 @@ blk_status_t blk_insert_cloned_request(struct request *rq)
if (q->disk && should_fail_request(q->disk->part0, blk_rq_bytes(rq))) if (q->disk && should_fail_request(q->disk->part0, blk_rq_bytes(rq)))
return BLK_STS_IOERR; return BLK_STS_IOERR;
if (blk_crypto_insert_cloned_request(rq)) if (blk_crypto_rq_get_keyslot(rq))
return BLK_STS_IOERR; return BLK_STS_IOERR;
blk_account_io_start(rq); blk_account_io_start(rq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment