[RFC v2 02/17] bio: rename bio_chain arguments

From: Andreas Gruenbacher

Date: Sat Dec 20 2025 - 21:52:53 EST


Use the same argument names in bio_chain() as in bio_chain_and_submit()
to be consistent. Slightly improve the function description.

Signed-off-by: Andreas Gruenbacher <agruenba@xxxxxxxxxx>
Reviewed-by: Christoph Hellwig <hch@xxxxxx>
---
block/bio.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/block/bio.c b/block/bio.c
index b3a79285c278..3f408e1ba13f 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -327,22 +327,22 @@ static void bio_chain_endio(struct bio *bio)

/**
* bio_chain - chain bio completions
- * @bio: the target bio
- * @parent: the parent bio of @bio
+ * @prev: the bio to chain
+ * @new: the bio to chain to
*
- * The caller won't have a bi_end_io called when @bio completes - instead,
- * @parent's bi_end_io won't be called until both @parent and @bio have
- * completed; the chained bio will also be freed when it completes.
+ * The caller won't have a bi_end_io called when @prev completes. Instead,
+ * @new's bi_end_io will be called once both @new and @prev have completed.
+ * Like an unchained bio, @prev will be put when it completes.
*
- * The caller must not set bi_private or bi_end_io in @bio.
+ * The caller must not set bi_private or bi_end_io in @prev.
*/
-void bio_chain(struct bio *bio, struct bio *parent)
+void bio_chain(struct bio *prev, struct bio *new)
{
- BUG_ON(bio->bi_private || bio->bi_end_io);
+ BUG_ON(prev->bi_private || prev->bi_end_io);

- bio->bi_private = parent;
- bio->bi_end_io = bio_chain_endio;
- bio_inc_remaining(parent);
+ prev->bi_private = new;
+ prev->bi_end_io = bio_chain_endio;
+ bio_inc_remaining(new);
}
EXPORT_SYMBOL(bio_chain);

--
2.52.0