mirror of
https://github.com/ceph/ceph
synced 2025-01-10 21:20:46 +00:00
crimson/common/operation: generalized for multiple reactors
Signed-off-by: Samuel Just <sjust@redhat.com>
This commit is contained in:
parent
5544b2ebd8
commit
6e2d58a92d
@ -414,7 +414,16 @@ protected:
|
||||
return opl.empty();
|
||||
});
|
||||
}
|
||||
|
||||
public:
|
||||
OperationRegistryT(core_id_t core) {
|
||||
// Use core to initialize upper 8 bits of counters to ensure that
|
||||
// ids generated by different cores are disjoint
|
||||
op_id_counters.fill(
|
||||
static_cast<id_t>(core) <<
|
||||
(std::numeric_limits<id_t>::digits - 8));
|
||||
}
|
||||
|
||||
template <size_t REGISTRY_INDEX>
|
||||
const op_list& get_registry() const {
|
||||
static_assert(
|
||||
@ -428,6 +437,18 @@ public:
|
||||
REGISTRY_INDEX < std::tuple_size<decltype(registries)>::value);
|
||||
return registries[REGISTRY_INDEX];
|
||||
}
|
||||
|
||||
/// Removes op from registry
|
||||
void remove_from_registry(Operation &op) {
|
||||
const auto op_type = op.get_type();
|
||||
registries[op_type].erase(op_list::s_iterator_to(op));
|
||||
}
|
||||
|
||||
/// Adds op to registry
|
||||
void add_to_registry(Operation &op) {
|
||||
const auto op_type = op.get_type();
|
||||
registries[op_type].push_back(op);
|
||||
}
|
||||
};
|
||||
|
||||
class PipelineExitBarrierI {
|
||||
|
@ -38,6 +38,7 @@ void OSDOperationRegistry::do_stop()
|
||||
}
|
||||
|
||||
OSDOperationRegistry::OSDOperationRegistry()
|
||||
: OperationRegistryT(seastar::this_shard_id())
|
||||
{
|
||||
constexpr auto historic_reg_index =
|
||||
static_cast<size_t>(OperationTypeCode::historic_client_request);
|
||||
|
Loading…
Reference in New Issue
Block a user