aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-log.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-log.c')
-rw-r--r--drivers/md/dm-log.c15
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
552static void core_complete_resync_work(struct dirty_log *log, region_t region, 552static 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
564static region_t core_get_sync_count(struct dirty_log *log) 567static 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};