summaryrefslogtreecommitdiffstats
path: root/include/linux/raid/raid1.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@cse.unsw.edu.au>2005-09-09 16:23:47 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-09 16:39:10 -0700
commit4b6d287f627b5fb6a49f78f9e81649ff98c62bb7 (patch)
tree7b6cbc6a997e25a7fb6185da7129e539c4ffda8b /include/linux/raid/raid1.h
parent8ddf9efe6708f3674f0ddfeb6425fd27bea109a2 (diff)
downloadop-kernel-dev-4b6d287f627b5fb6a49f78f9e81649ff98c62bb7.zip
op-kernel-dev-4b6d287f627b5fb6a49f78f9e81649ff98c62bb7.tar.gz
[PATCH] md: add write-behind support for md/raid1
If a device is flagged 'WriteMostly' and the array has a bitmap, and the bitmap superblock indicates that write_behind is allowed, then write_behind is enabled for WriteMostly devices. Write requests will be acknowledges as complete to the caller (via b_end_io) when all non-WriteMostly devices have completed the write, but will not be cleared from the bitmap until all devices complete. This requires memory allocation to make a local copy of the data being written. If there is insufficient memory, then we fall-back on normal write semantics. Signed-Off-By: Paul Clements <paul.clements@steeleye.com> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/raid/raid1.h')
-rw-r--r--include/linux/raid/raid1.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h
index 9d93cf1..60e19b6 100644
--- a/include/linux/raid/raid1.h
+++ b/include/linux/raid/raid1.h
@@ -80,6 +80,9 @@ struct r1bio_s {
atomic_t remaining; /* 'have we finished' count,
* used from IRQ handlers
*/
+ atomic_t behind_remaining; /* number of write-behind ios remaining
+ * in this BehindIO request
+ */
sector_t sector;
int sectors;
unsigned long state;
@@ -107,4 +110,14 @@ struct r1bio_s {
#define R1BIO_Uptodate 0
#define R1BIO_IsSync 1
#define R1BIO_Degraded 2
+#define R1BIO_BehindIO 3
+/* For write-behind requests, we call bi_end_io when
+ * the last non-write-behind device completes, providing
+ * any write was successful. Otherwise we call when
+ * any write-behind write succeeds, otherwise we call
+ * with failure when last write completes (and all failed).
+ * Record that bi_end_io was called with this flag...
+ */
+#define R1BIO_Returned 4
+
#endif
OpenPOWER on IntegriCloud