From e85d368f15ba14ba4408ba74b15e1344a60dc767 Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Tue, 30 Mar 2010 14:47:57 -0700 Subject: [PATCH] msg: fix uses of MOSDSubOp destructor to use put() --- src/osd/OSD.cc | 6 +++--- src/osd/PG.cc | 4 ++-- src/osd/ReplicatedPG.cc | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 59d69fe37c1d3..9da87fc895c67 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -4215,7 +4215,7 @@ void OSD::handle_sub_op(MOSDSubOp *op) dout(10) << "handle_sub_op " << *op << " epoch " << op->map_epoch << dendl; if (op->map_epoch < up_epoch) { dout(3) << "replica op from before up" << dendl; - delete op; + op->put(); return; } @@ -4234,7 +4234,7 @@ void OSD::handle_sub_op(MOSDSubOp *op) if (!_have_pg(pgid)) { // hmm. - delete op; + op->put(); return; } @@ -4249,7 +4249,7 @@ void OSD::handle_sub_op(MOSDSubOp *op) << " after " << op->map_epoch << ", dropping" << dendl; pg->unlock(); - delete op; + op->put(); return; } diff --git a/src/osd/PG.cc b/src/osd/PG.cc index bd9689d63da44..70e5933946be7 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -2345,7 +2345,7 @@ void PG::sub_op_scrub(MOSDSubOp *op) if (op->map_epoch < info.history.same_acting_since) { dout(10) << "sub_op_scrub discarding old sub_op from " << op->map_epoch << " < " << info.history.same_acting_since << dendl; - delete op; + op->put(); return; } @@ -2356,7 +2356,7 @@ void PG::sub_op_scrub(MOSDSubOp *op) ::encode(map, reply->get_data()); osd->messenger->send_message(reply, op->get_source_inst()); - delete op; + op->put(); } void PG::sub_op_scrub_reply(MOSDSubOpReply *op) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index ab5bf98f13b4c..4862034fb29fc 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -2474,7 +2474,7 @@ void ReplicatedPG::sub_op_modify_applied(RepModify *rm) unlock(); if (done) { delete rm->ctx; - delete rm->op; + rm->op->put(); delete rm; put(); } @@ -2502,7 +2502,7 @@ void ReplicatedPG::sub_op_modify_commit(RepModify *rm) unlock(); if (done) { delete rm->ctx; - delete rm->op; + rm->op->put(); delete rm; put(); } @@ -2927,7 +2927,7 @@ void ReplicatedPG::sub_op_pull(MOSDSubOp *op) assert(!is_primary()); // we should be a replica or stray. push(soid, op->get_source().num(), op->data_subset, op->clone_subsets); - delete op; + op->put(); } @@ -3029,7 +3029,7 @@ void ReplicatedPG::sub_op_push(MOSDSubOp *op) dout(10) << "sub_op_push need " << data_needed << ", got " << data_subset << dendl; if (!data_needed.subset_of(data_subset)) { dout(0) << " we did not get enough of " << soid << " object data" << dendl; - delete op; + op->put(); return; } @@ -3211,7 +3211,7 @@ void ReplicatedPG::sub_op_push(MOSDSubOp *op) */ } - delete op; // at the end... soid is a ref to op->soid! + op->put(); // at the end... soid is a ref to op->soid! } -- 2.39.5