Signed-off-by: Samuel Just <sjust@redhat.com>
op->mark_queued_for_pg();
logger->tinc(l_osd_op_before_queue_op_lat, latency);
- if (type == MSG_OSD_PG_PUSH ||
- type == MSG_OSD_PG_PUSH_REPLY) {
+ if (PGRecoveryMsg::is_recovery_msg(op)) {
op_shardedwq.queue(
OpSchedulerItem(
unique_ptr<OpSchedulerItem::OpQueueable>(new PGRecoveryMsg(pg, std::move(op))),
public:
PGRecoveryMsg(spg_t pg, OpRequestRef op) : PGOpQueueable(pg), op(std::move(op)) {}
+ static bool is_recovery_msg(OpRequestRef &op) {
+ switch (op->get_req()->get_type()) {
+ case MSG_OSD_PG_PUSH:
+ case MSG_OSD_PG_PUSH_REPLY:
+ return true;
+ default:
+ return false;
+ }
+ }
+
std::ostream &print(std::ostream &rhs) const final {
return rhs << "PGRecoveryMsg(op=" << *(op->get_req()) << ")";
}