summaryrefslogtreecommitdiff
path: root/drivers/md/raid1.h
diff options
context:
space:
mode:
authorMing Lei <tom.leiming@gmail.com>2017-03-16 19:12:31 +0300
committerShaohua Li <shli@fb.com>2017-03-24 20:41:37 +0300
commit841c1316c7da6199a7df473893c141943991a756 (patch)
tree77bd223263ff1bc03d860f16b4ba4f60571e62b7 /drivers/md/raid1.h
parentd8c84c4f8becc1fb993911e18c8aef5ecf7a72ac (diff)
downloadlinux-841c1316c7da6199a7df473893c141943991a756.tar.xz
md: raid1: improve write behind
This patch improve handling of write behind in the following ways: - introduce behind master bio to hold all write behind pages - fast clone bios from behind master bio - avoid to change bvec table directly - use bio_copy_data() and make code more clean Suggested-by: Shaohua Li <shli@fb.com> Signed-off-by: Ming Lei <tom.leiming@gmail.com> Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/raid1.h')
-rw-r--r--drivers/md/raid1.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/md/raid1.h b/drivers/md/raid1.h
index dd22a37d0d83..4271cd7ac2de 100644
--- a/drivers/md/raid1.h
+++ b/drivers/md/raid1.h
@@ -153,9 +153,13 @@ struct r1bio {
int read_disk;
struct list_head retry_list;
- /* Next two are only valid when R1BIO_BehindIO is set */
- struct bio_vec *behind_bvecs;
- int behind_page_count;
+
+ /*
+ * When R1BIO_BehindIO is set, we store pages for write behind
+ * in behind_master_bio.
+ */
+ struct bio *behind_master_bio;
+
/*
* if the IO is in WRITE direction, then multiple bios are used.
* We choose the number when they are allocated.