diff options
author | Christoph Hellwig <hch@lst.de> | 2022-02-28 14:25:01 +0300 |
---|---|---|
committer | Song Liu <song@kernel.org> | 2022-03-09 09:55:04 +0300 |
commit | 0dd00cba99c352dc9afd62979f350d808c215cb9 (patch) | |
tree | 053c197ff37c2c5e5c647298994968a6a6bea875 /drivers/md | |
parent | 9f7c3f837a3768ce8d5a5c34070a47608a4a0209 (diff) | |
download | linux-0dd00cba99c352dc9afd62979f350d808c215cb9.tar.xz |
raid5-cache: fully initialize flush_bio when needed
Stop using bio_reset and just initialize the bio fully when needed.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Song Liu <song@kernel.org>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/raid5-cache.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c index 86e2bb89d9c7..8907d18c225a 100644 --- a/drivers/md/raid5-cache.c +++ b/drivers/md/raid5-cache.c @@ -1266,6 +1266,8 @@ static void r5l_log_flush_endio(struct bio *bio) r5l_io_run_stripes(io); list_splice_tail_init(&log->flushing_ios, &log->finished_ios); spin_unlock_irqrestore(&log->io_list_lock, flags); + + bio_uninit(bio); } /* @@ -1301,7 +1303,7 @@ void r5l_flush_stripe_to_raid(struct r5l_log *log) if (!do_flush) return; - bio_reset(&log->flush_bio, log->rdev->bdev, + bio_init(&log->flush_bio, log->rdev->bdev, NULL, 0, REQ_OP_WRITE | REQ_PREFLUSH); log->flush_bio.bi_end_io = r5l_log_flush_endio; submit_bio(&log->flush_bio); @@ -3105,7 +3107,6 @@ int r5l_init_log(struct r5conf *conf, struct md_rdev *rdev) INIT_LIST_HEAD(&log->io_end_ios); INIT_LIST_HEAD(&log->flushing_ios); INIT_LIST_HEAD(&log->finished_ios); - bio_init(&log->flush_bio, NULL, NULL, 0, 0); log->io_kc = KMEM_CACHE(r5l_io_unit, 0); if (!log->io_kc) |