diff options
Diffstat (limited to 'include/linux/raid')
-rw-r--r-- | include/linux/raid/bitmap.h | 15 | ||||
-rw-r--r-- | include/linux/raid/md_k.h | 3 | ||||
-rw-r--r-- | include/linux/raid/raid1.h | 13 |
3 files changed, 26 insertions, 5 deletions
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h index 4bf1659f8aa8..9de99198caf1 100644 --- a/include/linux/raid/bitmap.h +++ b/include/linux/raid/bitmap.h | |||
@@ -7,7 +7,7 @@ | |||
7 | #define BITMAP_H 1 | 7 | #define BITMAP_H 1 |
8 | 8 | ||
9 | #define BITMAP_MAJOR 3 | 9 | #define BITMAP_MAJOR 3 |
10 | #define BITMAP_MINOR 38 | 10 | #define BITMAP_MINOR 39 |
11 | 11 | ||
12 | /* | 12 | /* |
13 | * in-memory bitmap: | 13 | * in-memory bitmap: |
@@ -147,8 +147,9 @@ typedef struct bitmap_super_s { | |||
147 | __u32 state; /* 48 bitmap state information */ | 147 | __u32 state; /* 48 bitmap state information */ |
148 | __u32 chunksize; /* 52 the bitmap chunk size in bytes */ | 148 | __u32 chunksize; /* 52 the bitmap chunk size in bytes */ |
149 | __u32 daemon_sleep; /* 56 seconds between disk flushes */ | 149 | __u32 daemon_sleep; /* 56 seconds between disk flushes */ |
150 | __u32 write_behind; /* 60 number of outstanding write-behind writes */ | ||
150 | 151 | ||
151 | __u8 pad[256 - 60]; /* set to zero */ | 152 | __u8 pad[256 - 64]; /* set to zero */ |
152 | } bitmap_super_t; | 153 | } bitmap_super_t; |
153 | 154 | ||
154 | /* notes: | 155 | /* notes: |
@@ -226,6 +227,9 @@ struct bitmap { | |||
226 | 227 | ||
227 | unsigned long flags; | 228 | unsigned long flags; |
228 | 229 | ||
230 | unsigned long max_write_behind; /* write-behind mode */ | ||
231 | atomic_t behind_writes; | ||
232 | |||
229 | /* | 233 | /* |
230 | * the bitmap daemon - periodically wakes up and sweeps the bitmap | 234 | * the bitmap daemon - periodically wakes up and sweeps the bitmap |
231 | * file, cleaning up bits and flushing out pages to disk as necessary | 235 | * file, cleaning up bits and flushing out pages to disk as necessary |
@@ -260,9 +264,10 @@ int bitmap_setallbits(struct bitmap *bitmap); | |||
260 | void bitmap_write_all(struct bitmap *bitmap); | 264 | void bitmap_write_all(struct bitmap *bitmap); |
261 | 265 | ||
262 | /* these are exported */ | 266 | /* these are exported */ |
263 | int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors); | 267 | int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, |
264 | void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors, | 268 | unsigned long sectors, int behind); |
265 | int success); | 269 | void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, |
270 | unsigned long sectors, int success, int behind); | ||
266 | int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int degraded); | 271 | int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int degraded); |
267 | void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); | 272 | void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); |
268 | void bitmap_close_sync(struct bitmap *bitmap); | 273 | void bitmap_close_sync(struct bitmap *bitmap); |
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 7ef78e15ce04..2514e5fcda7f 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
@@ -275,6 +275,9 @@ struct mddev_s | |||
275 | atomic_t writes_pending; | 275 | atomic_t writes_pending; |
276 | request_queue_t *queue; /* for plugging ... */ | 276 | request_queue_t *queue; /* for plugging ... */ |
277 | 277 | ||
278 | atomic_t write_behind; /* outstanding async IO */ | ||
279 | unsigned int max_write_behind; /* 0 = sync */ | ||
280 | |||
278 | struct bitmap *bitmap; /* the bitmap for the device */ | 281 | struct bitmap *bitmap; /* the bitmap for the device */ |
279 | struct file *bitmap_file; /* the bitmap file */ | 282 | struct file *bitmap_file; /* the bitmap file */ |
280 | long bitmap_offset; /* offset from superblock of | 283 | long bitmap_offset; /* offset from superblock of |
diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h index 9d93cf12e890..60e19b667548 100644 --- a/include/linux/raid/raid1.h +++ b/include/linux/raid/raid1.h | |||
@@ -80,6 +80,9 @@ struct r1bio_s { | |||
80 | atomic_t remaining; /* 'have we finished' count, | 80 | atomic_t remaining; /* 'have we finished' count, |
81 | * used from IRQ handlers | 81 | * used from IRQ handlers |
82 | */ | 82 | */ |
83 | atomic_t behind_remaining; /* number of write-behind ios remaining | ||
84 | * in this BehindIO request | ||
85 | */ | ||
83 | sector_t sector; | 86 | sector_t sector; |
84 | int sectors; | 87 | int sectors; |
85 | unsigned long state; | 88 | unsigned long state; |
@@ -107,4 +110,14 @@ struct r1bio_s { | |||
107 | #define R1BIO_Uptodate 0 | 110 | #define R1BIO_Uptodate 0 |
108 | #define R1BIO_IsSync 1 | 111 | #define R1BIO_IsSync 1 |
109 | #define R1BIO_Degraded 2 | 112 | #define R1BIO_Degraded 2 |
113 | #define R1BIO_BehindIO 3 | ||
114 | /* For write-behind requests, we call bi_end_io when | ||
115 | * the last non-write-behind device completes, providing | ||
116 | * any write was successful. Otherwise we call when | ||
117 | * any write-behind write succeeds, otherwise we call | ||
118 | * with failure when last write completes (and all failed). | ||
119 | * Record that bi_end_io was called with this flag... | ||
120 | */ | ||
121 | #define R1BIO_Returned 4 | ||
122 | |||
110 | #endif | 123 | #endif |