Browse Source

Remove in_progress_ops

blocking-uring-test
Vitaliy Filippov 3 years ago
parent
commit
2d0334f9b9
  1. 1
      blockstore.h
  2. 2
      blockstore_read.cpp
  3. 3
      blockstore_sync.cpp
  4. 3
      blockstore_write.cpp

1
blockstore.h

@ -233,7 +233,6 @@ class blockstore
std::deque<obj_ver_id> unsynced_big_writes;
int unsynced_small_writes = 0;
std::list<blockstore_operation*> in_progress_syncs;
std::set<blockstore_operation*> in_progress_ops; // FIXME purpose of tracking this is unclear
uint32_t block_order, block_size;
uint64_t block_count;
allocator *data_alloc;

2
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);
}
}

3
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;

3
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))
{

Loading…
Cancel
Save