diff options
author | Ming Lei <ming.lei@redhat.com> | 2017-07-14 10:14:43 +0200 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2017-07-21 21:47:20 +0200 |
commit | fb0eb5df09307603b21845af1d143cc910154593 (patch) | |
tree | 7415f28242bf25b9351bde3ea2bd7fcadede3392 /drivers/md/raid10.c | |
parent | md: remove 'idx' from 'struct resync_pages' (diff) | |
download | linux-fb0eb5df09307603b21845af1d143cc910154593.tar.xz linux-fb0eb5df09307603b21845af1d143cc910154593.zip |
md: raid1/raid10: initialize bvec table via bio_add_page()
We will support multipage bvec soon, so initialize bvec
table using the standardy way instead of writing the
talbe directly. Otherwise it won't work any more once
multipage bvec is enabled.
Acked-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to '')
-rw-r--r-- | drivers/md/raid10.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index fa8bcf04e791..9952721e1cde 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -110,6 +110,8 @@ static void end_reshape(struct r10conf *conf); #define raid10_log(md, fmt, args...) \ do { if ((md)->queue) blk_add_trace_msg((md)->queue, "raid10 " fmt, ##args); } while (0) +#include "raid1-10.c" + /* * 'strct resync_pages' stores actual pages used for doing the resync * IO, and it is per-bio, so make .bi_private points to it. @@ -2086,8 +2088,8 @@ static void sync_request_write(struct mddev *mddev, struct r10bio *r10_bio) rp = get_resync_pages(tbio); bio_reset(tbio); - tbio->bi_vcnt = vcnt; - tbio->bi_iter.bi_size = fbio->bi_iter.bi_size; + md_bio_reset_resync_pages(tbio, rp, fbio->bi_iter.bi_size); + rp->raid_bio = r10_bio; tbio->bi_private = rp; tbio->bi_iter.bi_sector = r10_bio->devs[i].addr; |