From: Greg Farnum Date: Tue, 3 Sep 2013 23:31:50 +0000 (-0700) Subject: Objecter: write a helper function to clean up ops that need to be retried X-Git-Tag: v0.71~137^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=29133fdae55ceb15562687e0a668da3659ba0ff2;p=ceph.git Objecter: write a helper function to clean up ops that need to be retried We have a little block to clean them up if we get back EAGAIN, but it's actually leaking map references; we will also use this for redirects from the OSDs. Signed-off-by: Greg Farnum --- diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 34a02c0fb44..f5ee22557d9 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -1548,6 +1548,15 @@ void Objecter::throttle_op(Op *op, int op_budget) } } +void Objecter::unregister_op(Op *op) +{ + if (op->onack) + num_unacked--; + if (op->oncommit) + num_uncommitted--; + ops.erase(op->tid); +} + /* This function DOES put the passed message before returning */ void Objecter::handle_osd_op_reply(MOSDOpReply *m) { @@ -1596,10 +1605,7 @@ void Objecter::handle_osd_op_reply(MOSDOpReply *m) if (rc == -EAGAIN) { ldout(cct, 7) << " got -EAGAIN, resubmitting" << dendl; - if (op->onack) - num_unacked--; - if (op->oncommit) - num_uncommitted--; + unregister_op(op); op_submit(op); m->put(); return; diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index f1c41e5e3f9..58d52405a90 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -1309,6 +1309,7 @@ private: // low-level tid_t op_submit(Op *op); tid_t _op_submit(Op *op); + inline void unregister_op(Op *op); // public interface public: