summaryrefslogtreecommitdiff
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
authorLogan Gunthorpe <logang@deltatee.com>2022-06-16 13:19:34 -0600
committerJens Axboe <axboe@kernel.dk>2022-08-02 17:14:40 -0600
commit8757fef675d8c34f8b2e2d8322385d5a6b403210 (patch)
tree9953ac9b9c091abd2837d8133eb8f706bba7bfc5 /drivers/md/raid5.c
parent27fb701046c39879411ff064fb2c9ca8d02d89df (diff)
md/raid5: Move stripe_add_to_batch_list() call out of add_stripe_bio()
stripe_add_to_batch_list() is better done in the loop in make_request instead of inside add_stripe_bio(). This is clearer and allows for storing the batch_head state outside the loop in a subsequent patch. The call to add_stripe_bio() in retry_aligned_read() is for read and batching only applies to write. So it's impossible for batching to happen at that call site. No functional changes intended. Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Guoqing Jiang <guoqing.jiang@linux.dev> Signed-off-by: Song Liu <song@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r--drivers/md/raid5.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index ee7c1af8dcdb..ae2c1ec8bc20 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -3532,8 +3532,6 @@ static int add_stripe_bio(struct stripe_head *sh, struct bio *bi, int dd_idx,
}
spin_unlock_irq(&sh->stripe_lock);
- if (stripe_can_batch(sh))
- stripe_add_to_batch_list(conf, sh);
return 1;
overlap:
@@ -5951,6 +5949,9 @@ static bool raid5_make_request(struct mddev *mddev, struct bio * bi)
goto retry;
}
+ if (stripe_can_batch(sh))
+ stripe_add_to_batch_list(conf, sh);
+
if (do_flush) {
set_bit(STRIPE_R5C_PREFLUSH, &sh->state);
/* we only need flush for one stripe */