Browse Source

Fix used journal sector tracking again

blocking-uring-test
Vitaliy Filippov 3 years ago
parent
commit
1080cbdf12
  1. 2
      blockstore_stable.cpp
  2. 3
      blockstore_sync.cpp
  3. 2
      blockstore_write.cpp

2
blockstore_stable.cpp

@ -131,7 +131,7 @@ void blockstore::handle_stable_event(ring_data_t *data, blockstore_operation *op
journal.sector_info[s-1].usage_count--;
if (s == op->max_used_journal_sector)
break;
s = (s + 1) % journal.sector_count;
s = 1 + s % journal.sector_count;
}
op->min_used_journal_sector = op->max_used_journal_sector = 0;
}

3
blockstore_sync.cpp

@ -39,6 +39,7 @@ int blockstore::dequeue_sync(blockstore_operation *op)
int blockstore::continue_sync(blockstore_operation *op)
{
auto cb = [this, op](ring_data_t *data) { handle_sync_event(data, op); };
op->min_used_journal_sector = op->max_used_journal_sector = 0;
if (op->sync_state == SYNC_HAS_SMALL)
{
// No big writes, just fsync the journal
@ -135,7 +136,7 @@ void blockstore::handle_sync_event(ring_data_t *data, blockstore_operation *op)
journal.sector_info[s-1].usage_count--;
if (s == op->max_used_journal_sector)
break;
s = (s + 1) % journal.sector_count;
s = 1 + s % journal.sector_count;
}
op->min_used_journal_sector = op->max_used_journal_sector = 0;
}

2
blockstore_write.cpp

@ -179,7 +179,7 @@ void blockstore::handle_write_event(ring_data_t *data, blockstore_operation *op)
journal.sector_info[s-1].usage_count--;
if (s == op->max_used_journal_sector)
break;
s = (s + 1) % journal.sector_count;
s = 1 + s % journal.sector_count;
}
op->min_used_journal_sector = op->max_used_journal_sector = 0;
}

Loading…
Cancel
Save