From 2d0334f9b9f7af67af0ad94d7789fd01830c4f2d Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sun, 10 Nov 2019 12:48:09 +0300 Subject: [PATCH] Remove in_progress_ops --- blockstore.h | 1 - blockstore_read.cpp | 2 -- blockstore_sync.cpp | 3 --- blockstore_write.cpp | 3 --- 4 files changed, 9 deletions(-) diff --git a/blockstore.h b/blockstore.h index 54e7b4e6..997b46c1 100644 --- a/blockstore.h +++ b/blockstore.h @@ -233,7 +233,6 @@ class blockstore std::deque unsynced_big_writes; int unsynced_small_writes = 0; std::list in_progress_syncs; - std::set in_progress_ops; // FIXME purpose of tracking this is unclear uint32_t block_order, block_size; uint64_t block_count; allocator *data_alloc; diff --git a/blockstore_read.cpp b/blockstore_read.cpp index 57504271..3552122a 100644 --- a/blockstore_read.cpp +++ b/blockstore_read.cpp @@ -126,7 +126,6 @@ int blockstore::dequeue_read(blockstore_operation *read_op) } read_op->retval = 0; read_op->pending_ops = read_op->read_vec.size(); - in_progress_ops.insert(read_op); return 1; } @@ -143,6 +142,5 @@ void blockstore::handle_read_event(ring_data_t *data, blockstore_operation *op) if (op->retval == 0) op->retval = op->len; op->callback(op); - in_progress_ops.erase(op); } } diff --git a/blockstore_sync.cpp b/blockstore_sync.cpp index a001dab9..3c3d13d5 100644 --- a/blockstore_sync.cpp +++ b/blockstore_sync.cpp @@ -29,7 +29,6 @@ int blockstore::dequeue_sync(blockstore_operation *op) int done = ack_sync(op); if (!done) { - in_progress_ops.insert(op); op->prev_sync_count = in_progress_syncs.size(); op->in_progress_ptr = in_progress_syncs.insert(in_progress_syncs.end(), op); } @@ -206,14 +205,12 @@ int blockstore::ack_sync(blockstore_operation *op) done_syncs++; // Acknowledge next_sync in_progress_syncs.erase(next_sync->in_progress_ptr); - in_progress_ops.erase(next_sync); next_sync->retval = 0; next_sync->callback(next_sync); } } // Acknowledge sync in_progress_syncs.erase(op->in_progress_ptr); - in_progress_ops.erase(op); op->retval = 0; op->callback(op); return 1; diff --git a/blockstore_write.cpp b/blockstore_write.cpp index a767c506..e4fb4b36 100644 --- a/blockstore_write.cpp +++ b/blockstore_write.cpp @@ -29,7 +29,6 @@ int blockstore::dequeue_write(blockstore_operation *op) ); op->pending_ops = 1; op->min_used_journal_sector = op->max_used_journal_sector = 0; - in_progress_ops.insert(op); } else { @@ -111,7 +110,6 @@ int blockstore::dequeue_write(blockstore_operation *op) journal.sector_info[journal.cur_sector].usage_count++; op->pending_ops = 2; op->min_used_journal_sector = op->max_used_journal_sector = 1 + journal.cur_sector; - in_progress_ops.insert(op); } return 1; } @@ -146,7 +144,6 @@ void blockstore::handle_write_event(ring_data_t *data, blockstore_operation *op) // Acknowledge write without sync op->retval = op->len; op->callback(op); - in_progress_ops.erase(op); // Remember write as unsynced if (IS_BIG_WRITE(dirty_it->second.state)) {