X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Fcommon%2FContextCompletion.cc;fp=src%2Fceph%2Fsrc%2Fcommon%2FContextCompletion.cc;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=d5ff9f2204c435201974f8efcf444dad80c083cd;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/common/ContextCompletion.cc b/src/ceph/src/common/ContextCompletion.cc deleted file mode 100644 index d5ff9f2..0000000 --- a/src/ceph/src/common/ContextCompletion.cc +++ /dev/null @@ -1,49 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -// vim: ts=8 sw=2 smarttab -#include "common/ContextCompletion.h" - -namespace ceph -{ - -ContextCompletion::ContextCompletion(Context *ctx, bool ignore_enoent) - : m_lock("ceph::ContextCompletion::m_lock"), m_ctx(ctx), - m_ignore_enoent(ignore_enoent), m_ret(0), m_building(true), m_current_ops(0) -{ -} - -void ContextCompletion::finish_adding_requests() { - bool complete; - { - Mutex::Locker l(m_lock); - m_building = false; - complete = (m_current_ops == 0); - } - if (complete) { - m_ctx->complete(m_ret); - delete this; - } -} - -void ContextCompletion::start_op() { - Mutex::Locker l(m_lock); - ++m_current_ops; -} - -void ContextCompletion::finish_op(int r) { - bool complete; - { - Mutex::Locker l(m_lock); - if (r < 0 && m_ret == 0 && (!m_ignore_enoent || r != -ENOENT)) { - m_ret = r; - } - - --m_current_ops; - complete = (m_current_ops == 0 && !m_building); - } - if (complete) { - m_ctx->complete(m_ret); - delete this; - } -} - -} // namespace ceph