aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-raid1.c
diff options
context:
space:
mode:
authorJonathan E Brassow <jbrassow@redhat.com>2006-12-08 05:41:11 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:29:09 -0500
commitf3ee6b2f621fec7bc8bfe43fb465e938c37c8d20 (patch)
tree3d790014bbd3280fc7b0232dc212f4b34f06092f /drivers/md/dm-raid1.c
parent31c93a0c29bf96efd806ccf4ee81cacf04f255de (diff)
[PATCH] dm: log: rename complete_resync_work
The complete_resync_work function only provides the ability to change an out-of-sync region to in-sync. This patch enhances the function to allow us to change the status from in-sync to out-of-sync as well, something that is needed when a mirror write to one of the devices or an initial resync on a given region fails. Signed-off-by: Jonathan E Brassow <jbrassow@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com> Cc: dm-devel@redhat.com Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/dm-raid1.c')
-rw-r--r--drivers/md/dm-raid1.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index 3b3f4c9c3f09..23a642619bed 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -344,6 +344,17 @@ static void dispatch_bios(struct mirror_set *ms, struct bio_list *bio_list)
344 } 344 }
345} 345}
346 346
347static void complete_resync_work(struct region *reg, int success)
348{
349 struct region_hash *rh = reg->rh;
350
351 rh->log->type->set_region_sync(rh->log, reg->key, success);
352 dispatch_bios(rh->ms, &reg->delayed_bios);
353 if (atomic_dec_and_test(&rh->recovery_in_flight))
354 wake_up_all(&_kmirrord_recovery_stopped);
355 up(&rh->recovery_count);
356}
357
347static void rh_update_states(struct region_hash *rh) 358static void rh_update_states(struct region_hash *rh)
348{ 359{
349 struct region *reg, *next; 360 struct region *reg, *next;
@@ -383,11 +394,7 @@ static void rh_update_states(struct region_hash *rh)
383 */ 394 */
384 list_for_each_entry_safe (reg, next, &recovered, list) { 395 list_for_each_entry_safe (reg, next, &recovered, list) {
385 rh->log->type->clear_region(rh->log, reg->key); 396 rh->log->type->clear_region(rh->log, reg->key);
386 rh->log->type->complete_resync_work(rh->log, reg->key, 1); 397 complete_resync_work(reg, 1);
387 dispatch_bios(rh->ms, &reg->delayed_bios);
388 if (atomic_dec_and_test(&rh->recovery_in_flight))
389 wake_up_all(&_kmirrord_recovery_stopped);
390 up(&rh->recovery_count);
391 mempool_free(reg, rh->region_pool); 398 mempool_free(reg, rh->region_pool);
392 } 399 }
393 400