diff options
author | Jonathan E Brassow <jbrassow@redhat.com> | 2006-12-08 05:41:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-08 11:29:09 -0500 |
commit | f3ee6b2f621fec7bc8bfe43fb465e938c37c8d20 (patch) | |
tree | 3d790014bbd3280fc7b0232dc212f4b34f06092f /drivers/md/dm-log.c | |
parent | 31c93a0c29bf96efd806ccf4ee81cacf04f255de (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-log.c')
-rw-r--r-- | drivers/md/dm-log.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c index 64b764bd02cc..ce5c5d6fc107 100644 --- a/drivers/md/dm-log.c +++ b/drivers/md/dm-log.c | |||
@@ -549,16 +549,19 @@ static int core_get_resync_work(struct dirty_log *log, region_t *region) | |||
549 | return 1; | 549 | return 1; |
550 | } | 550 | } |
551 | 551 | ||
552 | static void core_complete_resync_work(struct dirty_log *log, region_t region, | 552 | static void core_set_region_sync(struct dirty_log *log, region_t region, |
553 | int success) | 553 | int in_sync) |
554 | { | 554 | { |
555 | struct log_c *lc = (struct log_c *) log->context; | 555 | struct log_c *lc = (struct log_c *) log->context; |
556 | 556 | ||
557 | log_clear_bit(lc, lc->recovering_bits, region); | 557 | log_clear_bit(lc, lc->recovering_bits, region); |
558 | if (success) { | 558 | if (in_sync) { |
559 | log_set_bit(lc, lc->sync_bits, region); | 559 | log_set_bit(lc, lc->sync_bits, region); |
560 | lc->sync_count++; | 560 | lc->sync_count++; |
561 | } | 561 | } else if (log_test_bit(lc->sync_bits, region)) { |
562 | lc->sync_count--; | ||
563 | log_clear_bit(lc, lc->sync_bits, region); | ||
564 | } | ||
562 | } | 565 | } |
563 | 566 | ||
564 | static region_t core_get_sync_count(struct dirty_log *log) | 567 | static region_t core_get_sync_count(struct dirty_log *log) |
@@ -625,7 +628,7 @@ static struct dirty_log_type _core_type = { | |||
625 | .mark_region = core_mark_region, | 628 | .mark_region = core_mark_region, |
626 | .clear_region = core_clear_region, | 629 | .clear_region = core_clear_region, |
627 | .get_resync_work = core_get_resync_work, | 630 | .get_resync_work = core_get_resync_work, |
628 | .complete_resync_work = core_complete_resync_work, | 631 | .set_region_sync = core_set_region_sync, |
629 | .get_sync_count = core_get_sync_count, | 632 | .get_sync_count = core_get_sync_count, |
630 | .status = core_status, | 633 | .status = core_status, |
631 | }; | 634 | }; |
@@ -644,7 +647,7 @@ static struct dirty_log_type _disk_type = { | |||
644 | .mark_region = core_mark_region, | 647 | .mark_region = core_mark_region, |
645 | .clear_region = core_clear_region, | 648 | .clear_region = core_clear_region, |
646 | .get_resync_work = core_get_resync_work, | 649 | .get_resync_work = core_get_resync_work, |
647 | .complete_resync_work = core_complete_resync_work, | 650 | .set_region_sync = core_set_region_sync, |
648 | .get_sync_count = core_get_sync_count, | 651 | .get_sync_count = core_get_sync_count, |
649 | .status = disk_status, | 652 | .status = disk_status, |
650 | }; | 653 | }; |