diff options
author | NeilBrown <neilb@cse.unsw.edu.au> | 2005-09-09 19:23:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-09 19:39:12 -0400 |
commit | 72626685dc66d455742a7f215a0535c551628b9e (patch) | |
tree | 91e19a61a5a3b782007132b6b2e353e8936dd656 /drivers/md/md.c | |
parent | 0002b2718dd04da67c21f8a7830de8d95a9b0345 (diff) |
[PATCH] md: add write-intent-bitmap support to raid5
Most awkward part of this is delaying write requests until bitmap updates have
been flushed.
To achieve this, we have a sequence number (seq_flush) which is incremented
each time the raid5 is unplugged.
If the raid thread notices that this has changed, it flushes bitmap changes,
and assigned the value of seq_flush to seq_write.
When a write request arrives, it is given the number from seq_write, and that
write request may not complete until seq_flush is larger than the saved seq
number.
We have a new queue for storing stripes which are waiting for a bitmap flush
and an extra flag for stripes to record if the write was 'degraded' and so
should not clear the a bit in the bitmap.
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 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index be7873c61b3c..dbf540a7fccc 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -645,7 +645,7 @@ static int super_90_validate(mddev_t *mddev, mdk_rdev_t *rdev) | |||
645 | 645 | ||
646 | if (sb->state & (1<<MD_SB_BITMAP_PRESENT) && | 646 | if (sb->state & (1<<MD_SB_BITMAP_PRESENT) && |
647 | mddev->bitmap_file == NULL) { | 647 | mddev->bitmap_file == NULL) { |
648 | if (mddev->level != 1) { | 648 | if (mddev->level != 1 && mddev->level != 5) { |
649 | /* FIXME use a better test */ | 649 | /* FIXME use a better test */ |
650 | printk(KERN_WARNING "md: bitmaps only support for raid1\n"); | 650 | printk(KERN_WARNING "md: bitmaps only support for raid1\n"); |
651 | return -EINVAL; | 651 | return -EINVAL; |
@@ -3517,7 +3517,6 @@ void md_done_sync(mddev_t *mddev, int blocks, int ok) | |||
3517 | */ | 3517 | */ |
3518 | void md_write_start(mddev_t *mddev, struct bio *bi) | 3518 | void md_write_start(mddev_t *mddev, struct bio *bi) |
3519 | { | 3519 | { |
3520 | DEFINE_WAIT(w); | ||
3521 | if (bio_data_dir(bi) != WRITE) | 3520 | if (bio_data_dir(bi) != WRITE) |
3522 | return; | 3521 | return; |
3523 | 3522 | ||