diff options
author | Christoph Hellwig <hch@lst.de> | 2021-01-26 15:52:43 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-01-27 09:51:48 -0700 |
commit | 6a5965696856f5dc6834f351f093cc99bf2f03c8 (patch) | |
tree | 5dfb9425470b361f923293eeaf274e9256c72898 | |
parent | 32637385b834062d785a261841980ae7cffea007 (diff) | |
download | linux-stable-6a5965696856f5dc6834f351f093cc99bf2f03c8.tar.gz linux-stable-6a5965696856f5dc6834f351f093cc99bf2f03c8.tar.bz2 linux-stable-6a5965696856f5dc6834f351f093cc99bf2f03c8.zip |
md: remove md_bio_alloc_sync
md_bio_alloc_sync is never called with a NULL mddev, and ->sync_set is
initialized in md_run, so it always must be initialized as well. Just
open code the remaining call to bio_alloc_bioset.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Song Liu <song@kernel.org>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Acked-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | drivers/md/md.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 6a27f52007c8..399c81bddc1a 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -340,14 +340,6 @@ static int start_readonly; */ static bool create_on_open = true; -static struct bio *md_bio_alloc_sync(struct mddev *mddev) -{ - if (!mddev || !bioset_initialized(&mddev->sync_set)) - return bio_alloc(GFP_NOIO, 1); - - return bio_alloc_bioset(GFP_NOIO, 1, &mddev->sync_set); -} - /* * We have a system wide 'event count' that is incremented * on any 'interesting' event, and readers of /proc/mdstat @@ -989,7 +981,7 @@ void md_super_write(struct mddev *mddev, struct md_rdev *rdev, if (test_bit(Faulty, &rdev->flags)) return; - bio = md_bio_alloc_sync(mddev); + bio = bio_alloc_bioset(GFP_NOIO, 1, &mddev->sync_set); atomic_inc(&rdev->nr_pending); |