From efe5abfca0891e654a0f0659e12e6864821e7eb4 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 13 Oct 2011 12:52:13 -0700 Subject: [PATCH] osd: make C_OSD_CommittedPushedObject::op optional This lets us reuse this helper for commiting recovery ops that aren't a result of a push. Signed-off-by: Sage Weil --- src/osd/ReplicatedPG.cc | 3 ++- src/osd/ReplicatedPG.h | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 485277d3bdcc2..a027394c82072 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -4072,7 +4072,8 @@ void ReplicatedPG::_committed_pushed_object(MOSDSubOp *op, epoch_t same_since, e dout(10) << "_committed_pushed_object pg has changed, not touching last_complete_ondisk" << dendl; } - log_subop_stats(op, l_osd_sop_push_inb, l_osd_sop_push_lat); + if (op) + log_subop_stats(op, l_osd_sop_push_inb, l_osd_sop_push_lat); unlock(); put(); diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index eab3c3de69927..ffdf414152037 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -683,12 +683,14 @@ protected: epoch_t same_since; eversion_t last_complete; C_OSD_CommittedPushedObject(ReplicatedPG *p, MOSDSubOp *o, epoch_t ss, eversion_t lc) : pg(p), op(o), same_since(ss), last_complete(lc) { - op->get(); + if (op) + op->get(); pg->get(); } void finish(int r) { pg->_committed_pushed_object(op, same_since, last_complete); - op->put(); + if (op) + op->put(); } }; -- 2.39.5