From: Samuel Just Date: Thu, 6 Apr 2023 04:23:23 +0000 (+0000) Subject: osd/: move PGRecoveryMsg check from osd into PGRecoveryMsg::is_recovery_msg X-Git-Tag: v18.1.0~122^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8c2a808cc46afab22e56eb28db88011b7eae2af6;p=ceph.git osd/: move PGRecoveryMsg check from osd into PGRecoveryMsg::is_recovery_msg Signed-off-by: Samuel Just --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 750923f83e30..bcc85145fc70 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -9573,8 +9573,7 @@ void OSD::enqueue_op(spg_t pg, OpRequestRef&& op, epoch_t epoch) 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(new PGRecoveryMsg(pg, std::move(op))), diff --git a/src/osd/scheduler/OpSchedulerItem.h b/src/osd/scheduler/OpSchedulerItem.h index d9b655091569..c326585d6b95 100644 --- a/src/osd/scheduler/OpSchedulerItem.h +++ b/src/osd/scheduler/OpSchedulerItem.h @@ -561,6 +561,16 @@ class PGRecoveryMsg : public PGOpQueueable { 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()) << ")"; }