Skip to content

Commit

Permalink
blk-crypto: remove blk_crypto_insert_cloned_request()
Browse files Browse the repository at this point in the history
blk_crypto_insert_cloned_request() is the same as
blk_crypto_rq_get_keyslot(), so just use that directly.

Signed-off-by: Eric Biggers <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
ebiggers authored and axboe committed Mar 16, 2023
1 parent 5c7cb94 commit 435c0e9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
3 changes: 1 addition & 2 deletions Documentation/block/inline-encryption.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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,
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
initialize and prepare the clone as necessary; see
``blk_crypto_insert_cloned_request()``.
initialize and prepare the clone as necessary.

Interaction between inline encryption and blk integrity
=======================================================
Expand Down
15 changes: 0 additions & 15 deletions block/blk-crypto-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,21 +205,6 @@ static inline int blk_crypto_rq_bio_prep(struct request *rq, struct bio *bio,
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

int blk_crypto_fallback_start_using_mode(enum blk_crypto_mode_num mode_num);
Expand Down
2 changes: 1 addition & 1 deletion block/blk-mq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
return BLK_STS_IOERR;

if (blk_crypto_insert_cloned_request(rq))
if (blk_crypto_rq_get_keyslot(rq))
return BLK_STS_IOERR;

blk_account_io_start(rq);
Expand Down

0 comments on commit 435c0e9

Please sign in to comment.