From 0d8b5e2ef912bb896c35bb0f3a64d16dd220c998 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sat, 6 Mar 2021 22:53:18 +0300 Subject: [PATCH] Remove unused enqueue_op_first() --- src/blockstore.cpp | 7 +------ src/blockstore.h | 4 ---- src/blockstore_impl.cpp | 14 +++----------- src/blockstore_impl.h | 2 +- 4 files changed, 5 insertions(+), 22 deletions(-) diff --git a/src/blockstore.cpp b/src/blockstore.cpp index 427d6222..56de3eb1 100644 --- a/src/blockstore.cpp +++ b/src/blockstore.cpp @@ -35,12 +35,7 @@ bool blockstore_t::is_safe_to_stop() void blockstore_t::enqueue_op(blockstore_op_t *op) { - impl->enqueue_op(op, false); -} - -void blockstore_t::enqueue_op_first(blockstore_op_t *op) -{ - impl->enqueue_op(op, true); + impl->enqueue_op(op); } std::unordered_map & blockstore_t::get_unstable_writes() diff --git a/src/blockstore.h b/src/blockstore.h index a16cd054..6141a845 100644 --- a/src/blockstore.h +++ b/src/blockstore.h @@ -175,10 +175,6 @@ public: // Submission void enqueue_op(blockstore_op_t *op); - // Insert operation into the beginning of the queue - // Intended for the OSD syncer "thread" to be able to stabilize something when the journal is full - void enqueue_op_first(blockstore_op_t *op); - // Unstable writes are added here (map of object_id -> version) std::unordered_map & get_unstable_writes(); diff --git a/src/blockstore_impl.cpp b/src/blockstore_impl.cpp index c2bcb5b3..3a88a129 100644 --- a/src/blockstore_impl.cpp +++ b/src/blockstore_impl.cpp @@ -323,7 +323,7 @@ void blockstore_impl_t::check_wait(blockstore_op_t *op) } } -void blockstore_impl_t::enqueue_op(blockstore_op_t *op, bool first) +void blockstore_impl_t::enqueue_op(blockstore_op_t *op) { if (op->opcode < BS_OP_MIN || op->opcode > BS_OP_MAX || ((op->opcode == BS_OP_READ || op->opcode == BS_OP_WRITE || op->opcode == BS_OP_WRITE_STABLE) && ( @@ -331,8 +331,7 @@ void blockstore_impl_t::enqueue_op(blockstore_op_t *op, bool first) op->len > block_size-op->offset || (op->len % disk_alignment) )) || - readonly && op->opcode != BS_OP_READ && op->opcode != BS_OP_LIST || - first && (op->opcode == BS_OP_WRITE || op->opcode == BS_OP_WRITE_STABLE)) + readonly && op->opcode != BS_OP_READ && op->opcode != BS_OP_LIST) { // Basic verification not passed op->retval = -EINVAL; @@ -387,14 +386,7 @@ void blockstore_impl_t::enqueue_op(blockstore_op_t *op, bool first) PRIV(op)->wait_for = 0; PRIV(op)->op_state = 0; PRIV(op)->pending_ops = 0; - if (!first) - { - submit_queue.push_back(op); - } - else - { - submit_queue.push_front(op); - } + submit_queue.push_back(op); ringloop->wakeup(); } diff --git a/src/blockstore_impl.h b/src/blockstore_impl.h index f589c3ba..5f62d9c7 100644 --- a/src/blockstore_impl.h +++ b/src/blockstore_impl.h @@ -318,7 +318,7 @@ public: bool is_stalled(); // Submission - void enqueue_op(blockstore_op_t *op, bool first = false); + void enqueue_op(blockstore_op_t *op); // Unstable writes are added here (map of object_id -> version) std::unordered_map unstable_writes;