diff options
author | NeilBrown <neilb@suse.com> | 2017-04-05 14:05:50 +1000 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2017-04-11 10:08:47 -0700 |
commit | cb83efcfd26a28b76eef8815a41158c1896fc5ba (patch) | |
tree | 092bd3e26ca8d832bffbaa94d501845e81ca39ad /drivers/md | |
parent | c230e7e53526c223a3e1caf40747d6e37c0e4394 (diff) |
md/raid1: simplify alloc_behind_master_bio()
Now that we always always pass an offset of 0 and a size
that matches the bio to alloc_behind_master_bio(),
we can remove the offset/size args and simplify the code.
We could probably remove bio_copy_data_partial() too.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/raid1.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 94f1d754aa09..18af00c86b42 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1091,9 +1091,9 @@ static void unfreeze_array(struct r1conf *conf) } static struct bio *alloc_behind_master_bio(struct r1bio *r1_bio, - struct bio *bio, - int offset, int size) + struct bio *bio) { + int size = bio->bi_iter.bi_size; unsigned vcnt = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; int i = 0; struct bio *behind_bio = NULL; @@ -1120,8 +1120,7 @@ static struct bio *alloc_behind_master_bio(struct r1bio *r1_bio, i++; } - bio_copy_data_partial(behind_bio, bio, offset, - behind_bio->bi_iter.bi_size); + bio_copy_data(behind_bio, bio); skip_copy: r1_bio->behind_master_bio = behind_bio;; set_bit(R1BIO_BehindIO, &r1_bio->state); @@ -1462,9 +1461,7 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio, (atomic_read(&bitmap->behind_writes) < mddev->bitmap_info.max_write_behind) && !waitqueue_active(&bitmap->behind_wait)) { - mbio = alloc_behind_master_bio(r1_bio, bio, - 0, - max_sectors << 9); + mbio = alloc_behind_master_bio(r1_bio, bio); } bitmap_startwrite(bitmap, r1_bio->sector, |