From ec163579a22e8187b882d09225243e8995a59609 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Thu, 7 Nov 2013 15:34:27 -0800 Subject: [PATCH] OSD: replace handle_pg_scan, handle_pg_backfill with handle_replica_op Signed-off-by: Samuel Just Reviewed-by: Greg Farnum --- src/osd/OSD.cc | 68 +++++--------------------------------------------- src/osd/OSD.h | 3 --- 2 files changed, 6 insertions(+), 65 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 2ca8431f04ec2..1f6b94c5fb341 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -4917,12 +4917,6 @@ void OSD::dispatch_op(OpRequestRef op) assert(0 == "received MOSDPGMissing; this message is supposed to be unused!?!"); break; - case MSG_OSD_PG_SCAN: - handle_pg_scan(op); - break; - case MSG_OSD_PG_BACKFILL: - handle_pg_backfill(op); - break; case MSG_OSD_BACKFILL_RESERVE: handle_pg_backfill_reserve(op); @@ -4952,6 +4946,12 @@ void OSD::dispatch_op(OpRequestRef op) case MSG_OSD_PG_PUSH_REPLY: handle_replica_op(op); break; + case MSG_OSD_PG_SCAN: + handle_replica_op(op); + break; + case MSG_OSD_PG_BACKFILL: + handle_replica_op(op); + break; case MSG_OSD_EC_WRITE: handle_replica_op(op); break; @@ -6777,62 +6777,6 @@ void OSD::handle_pg_trim(OpRequestRef op) } } -void OSD::handle_pg_scan(OpRequestRef op) -{ - MOSDPGScan *m = static_cast(op->get_req()); - assert(m->get_header().type == MSG_OSD_PG_SCAN); - dout(10) << "handle_pg_scan " << *m << " from " << m->get_source() << dendl; - - if (!require_osd_peer(op)) - return; - if (!require_same_or_newer_map(op, m->query_epoch)) - return; - - if (m->pgid.preferred() >= 0) { - dout(10) << "ignoring localized pg " << m->pgid << dendl; - return; - } - - PG *pg; - - if (!_have_pg(m->pgid)) { - return; - } - - pg = _lookup_pg(m->pgid); - assert(pg); - - enqueue_op(pg, op); -} - -void OSD::handle_pg_backfill(OpRequestRef op) -{ - MOSDPGBackfill *m = static_cast(op->get_req()); - assert(m->get_header().type == MSG_OSD_PG_BACKFILL); - dout(10) << "handle_pg_backfill " << *m << " from " << m->get_source() << dendl; - - if (!require_osd_peer(op)) - return; - if (!require_same_or_newer_map(op, m->query_epoch)) - return; - - if (m->pgid.preferred() >= 0) { - dout(10) << "ignoring localized pg " << m->pgid << dendl; - return; - } - - PG *pg; - - if (!_have_pg(m->pgid)) { - return; - } - - pg = _lookup_pg(m->pgid); - assert(pg); - - enqueue_op(pg, op); -} - void OSD::handle_pg_backfill_reserve(OpRequestRef op) { MBackfillReserve *m = static_cast(op->get_req()); diff --git a/src/osd/OSD.h b/src/osd/OSD.h index ce8b74c6328c5..946f228016422 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1522,9 +1522,6 @@ protected: void handle_pg_info(OpRequestRef op); void handle_pg_trim(OpRequestRef op); - void handle_pg_scan(OpRequestRef op); - - void handle_pg_backfill(OpRequestRef op); void handle_pg_backfill_reserve(OpRequestRef op); void handle_pg_recovery_reserve(OpRequestRef op); -- 2.39.5