]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/: move PGRecoveryMsg check from osd into PGRecoveryMsg::is_recovery_msg
authorSamuel Just <sjust@redhat.com>
Thu, 6 Apr 2023 04:23:23 +0000 (04:23 +0000)
committerSridhar Seshasayee <sseshasa@redhat.com>
Mon, 8 May 2023 09:16:25 +0000 (14:46 +0530)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/OSD.cc
src/osd/scheduler/OpSchedulerItem.h

index 84c958acde3b17c55b92fb91bc98fd27ef474286..de9ff3e5fa42af0951dd564093d5935a640682b8 100644 (file)
@@ -9845,8 +9845,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<OpSchedulerItem::OpQueueable>(new PGRecoveryMsg(pg, std::move(op))),
index a60dcb3fbd01f9bef1d5013eed2222ff7fd591c3..70d00d88ad999f4fc3c03e739faac373df69ccee 100644 (file)
@@ -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()) << ")";
   }