]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
blk-crypto: submit the encrypted bio in blk_crypto_fallback_bio_prep
authorChristoph Hellwig <hch@lst.de>
Fri, 9 Jan 2026 06:07:44 +0000 (07:07 +0100)
committerJens Axboe <axboe@kernel.dk>
Sun, 11 Jan 2026 19:55:41 +0000 (12:55 -0700)
commitaefc2a1fa2edc2a486aaf857e48b3fd13062b0eb
tree0eb16436c4daf4d4284e25757e8f153cedf0cb10
parenta3cc978e61f5c909ca94a38d2daeeddc051a18e0
blk-crypto: submit the encrypted bio in blk_crypto_fallback_bio_prep

Restructure blk_crypto_fallback_bio_prep so that it always submits the
encrypted bio instead of passing it back to the caller, which allows
to simplify the calling conventions for blk_crypto_fallback_bio_prep and
blk_crypto_bio_prep so that they never have to return a bio, and can
use a true return value to indicate that the caller should submit the
bio, and false that the blk-crypto code consumed it.

The submission is handled by the on-stack bio list in the current
task_struct by the block layer and does not cause additional stack
usage or major overhead.  It also prepares for the following optimization
and fixes for the blk-crypto fallback write path.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-core.c
block/blk-crypto-fallback.c
block/blk-crypto-internal.h
block/blk-crypto.c