aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.h
diff options
context:
space:
mode:
authorMing Lei <tom.leiming@gmail.com>2017-03-17 00:12:31 +0800
committerShaohua Li <shli@fb.com>2017-03-24 10:41:37 -0700
commit841c1316c7da6199a7df473893c141943991a756 (patch)
tree77bd223263ff1bc03d860f16b4ba4f60571e62b7 /drivers/md/raid1.h
parentmd: raid1: move 'offset' out of loop (diff)
downloadlinux-dev-841c1316c7da6199a7df473893c141943991a756.tar.xz
linux-dev-841c1316c7da6199a7df473893c141943991a756.zip
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.