diff options
author | Kefu Chai <kchai@redhat.com> | 2017-06-01 14:20:53 +0200 |
---|---|---|
committer | Kefu Chai <kchai@redhat.com> | 2017-06-02 20:19:50 +0200 |
commit | 1d19254ba20ec4e2d5577fc2be8e965779973d16 (patch) | |
tree | 18b690ce54b00741c5f6b13147ce56df9bce1ee3 /src | |
parent | Merge pull request #14351 from yehudasa/wip-rgw-mdsearch (diff) | |
download | ceph-1d19254ba20ec4e2d5577fc2be8e965779973d16.tar.xz ceph-1d19254ba20ec4e2d5577fc2be8e965779973d16.zip |
rgw: drop asio/{yield,coroutine}.hpp replacements
as we requires boost 1.61+ now, which offers them. see
http://www.boost.org/doc/libs/1_61_0/boost/asio/.
Signed-off-by: Kefu Chai <kchai@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/include/config-h.in.cmake | 3 | ||||
-rw-r--r-- | src/rgw/rgw_boost_asio_coroutine.h | 67 | ||||
-rw-r--r-- | src/rgw/rgw_boost_asio_yield.h | 78 | ||||
-rw-r--r-- | src/rgw/rgw_coroutine.cc | 4 | ||||
-rw-r--r-- | src/rgw/rgw_coroutine.h | 2 | ||||
-rw-r--r-- | src/rgw/rgw_cr_rados.cc | 3 | ||||
-rw-r--r-- | src/rgw/rgw_data_sync.cc | 3 | ||||
-rw-r--r-- | src/rgw/rgw_metadata.cc | 2 | ||||
-rw-r--r-- | src/rgw/rgw_period_pusher.cc | 3 | ||||
-rw-r--r-- | src/rgw/rgw_rados.cc | 1 | ||||
-rw-r--r-- | src/rgw/rgw_sync.cc | 3 | ||||
-rw-r--r-- | src/rgw/rgw_sync_module.cc | 3 | ||||
-rw-r--r-- | src/rgw/rgw_sync_module_es.cc | 3 | ||||
-rw-r--r-- | src/rgw/rgw_sync_module_log.cc | 1 |
14 files changed, 15 insertions, 161 deletions
diff --git a/src/include/config-h.in.cmake b/src/include/config-h.in.cmake index c12244b16b5..abb735f3696 100644 --- a/src/include/config-h.in.cmake +++ b/src/include/config-h.in.cmake @@ -202,9 +202,6 @@ /* LTTng is disabled, so define this macro to be nothing. */ #cmakedefine tracepoint -/* have boost::asio::coroutine */ -#cmakedefine HAVE_BOOST_ASIO_COROUTINE - /* Define to 1 if you have fdatasync. */ #cmakedefine HAVE_FDATASYNC 1 diff --git a/src/rgw/rgw_boost_asio_coroutine.h b/src/rgw/rgw_boost_asio_coroutine.h deleted file mode 100644 index 2dd911e489c..00000000000 --- a/src/rgw/rgw_boost_asio_coroutine.h +++ /dev/null @@ -1,67 +0,0 @@ -// -// copy of needed class and macors from coroutine.hpp -// -// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef RGW_BOOST_ASIO_COROUTINE_H -#define RGW_BOOST_ASIO_COROUTINE_H - -#ifndef HAVE_BOOST_ASIO_COROUTINE - -namespace boost { -namespace asio { -namespace detail { - -class coroutine_ref; - -} // namespace detail - -class coroutine -{ -public: - /// Constructs a coroutine in its initial state. - coroutine() : value_(0) {} - - /// Returns true if the coroutine is the child of a fork. - bool is_child() const { return value_ < 0; } - - /// Returns true if the coroutine is the parent of a fork. - bool is_parent() const { return !is_child(); } - - /// Returns true if the coroutine has reached its terminal state. - bool is_complete() const { return value_ == -1; } - -private: - friend class detail::coroutine_ref; - int value_; -}; - - -namespace detail { - -class coroutine_ref -{ -public: - coroutine_ref(coroutine& c) : value_(c.value_), modified_(false) {} - coroutine_ref(coroutine* c) : value_(c->value_), modified_(false) {} - ~coroutine_ref() { if (!modified_) value_ = -1; } - operator int() const { return value_; } - int& operator=(int v) { modified_ = true; return value_ = v; } -private: - void operator=(const coroutine_ref&); - int& value_; - bool modified_; -}; - -} // namespace detail -} // namespace asio -} // namespace boost - -#endif // HAVE_BOOST_ASIO_COROUTINE - -#endif // RGW_BOOST_ASIO_COROUTINE_H - diff --git a/src/rgw/rgw_boost_asio_yield.h b/src/rgw/rgw_boost_asio_yield.h deleted file mode 100644 index aeb93215c10..00000000000 --- a/src/rgw/rgw_boost_asio_yield.h +++ /dev/null @@ -1,78 +0,0 @@ -// -// copy of needed macors from yield.hpp -// -// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef RGW_BOOST_ASIO_YIELD_H -#define RGW_BOOST_ASIO_YIELD_H - -#ifdef HAVE_BOOST_ASIO_COROUTINE -#include <boost/asio/yield.hpp> -#else -#define BOOST_ASIO_CORO_REENTER(c) \ - switch (::boost::asio::detail::coroutine_ref _coro_value = c) \ - case -1: if (_coro_value) \ - { \ - goto terminate_coroutine; \ - terminate_coroutine: \ - _coro_value = -1; \ - goto bail_out_of_coroutine; \ - bail_out_of_coroutine: \ - break; \ - } \ - else case 0: - -#define BOOST_ASIO_CORO_YIELD_IMPL(n) \ - for (_coro_value = (n);;) \ - if (_coro_value == 0) \ - { \ - case (n): ; \ - break; \ - } \ - else \ - switch (_coro_value ? 0 : 1) \ - for (;;) \ - case -1: if (_coro_value) \ - goto terminate_coroutine; \ - else for (;;) \ - case 1: if (_coro_value) \ - goto bail_out_of_coroutine; \ - else case 0: - -#define BOOST_ASIO_CORO_FORK_IMPL(n) \ - for (_coro_value = -(n);; _coro_value = (n)) \ - if (_coro_value == (n)) \ - { \ - case -(n): ; \ - break; \ - } \ - else - -#if defined(_MSC_VER) -# define BOOST_ASIO_CORO_YIELD BOOST_ASIO_CORO_YIELD_IMPL(__COUNTER__ + 1) -# define BOOST_ASIO_CORO_FORK BOOST_ASIO_CORO_FORK_IMPL(__COUNTER__ + 1) -#else // defined(_MSC_VER) -# define BOOST_ASIO_CORO_YIELD BOOST_ASIO_CORO_YIELD_IMPL(__LINE__) -# define BOOST_ASIO_CORO_FORK BOOST_ASIO_CORO_FORK_IMPL(__LINE__) -#endif // defined(_MSC_VER) - -#ifndef reenter -# define reenter(c) BOOST_ASIO_CORO_REENTER(c) -#endif - -#ifndef yield -# define yield BOOST_ASIO_CORO_YIELD -#endif - -#ifndef fork -# define fork BOOST_ASIO_CORO_FORK -#endif - -#endif // HAVE_BOOST_ASIO_COROUTINE - -#endif // RGW_BOOST_ASIO_YIELD_H - diff --git a/src/rgw/rgw_coroutine.cc b/src/rgw/rgw_coroutine.cc index 4bb48da49dc..7c103bfa643 100644 --- a/src/rgw/rgw_coroutine.cc +++ b/src/rgw/rgw_coroutine.cc @@ -1,12 +1,12 @@ #include "common/ceph_json.h" - #include "rgw_coroutine.h" -#include "rgw_boost_asio_yield.h" // re-include our assert to clobber the system one; fix dout: #include "include/assert.h" +#include <boost/asio/yield.hpp> + #define dout_subsys ceph_subsys_rgw diff --git a/src/rgw/rgw_coroutine.h b/src/rgw/rgw_coroutine.h index 66afa74b375..f8423287561 100644 --- a/src/rgw/rgw_coroutine.h +++ b/src/rgw/rgw_coroutine.h @@ -20,7 +20,7 @@ #include "common/admin_socket.h" #include "rgw_common.h" -#include "rgw_boost_asio_coroutine.h" +#include <boost/asio/coroutine.hpp> #include <atomic> diff --git a/src/rgw/rgw_cr_rados.cc b/src/rgw/rgw_cr_rados.cc index 1dce7ed211a..21f4a00f47a 100644 --- a/src/rgw/rgw_cr_rados.cc +++ b/src/rgw/rgw_cr_rados.cc @@ -1,10 +1,11 @@ #include "rgw_rados.h" #include "rgw_coroutine.h" -#include "rgw_boost_asio_yield.h" #include "rgw_cr_rados.h" #include "cls/lock/cls_lock_client.h" +#include <boost/asio/yield.hpp> + #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index 9b2aefe70e4..7769c8dc9de 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -17,13 +17,14 @@ #include "rgw_http_client.h" #include "rgw_bucket.h" #include "rgw_metadata.h" -#include "rgw_boost_asio_yield.h" #include "rgw_sync_module.h" #include "cls/lock/cls_lock_client.h" #include "auth/Crypto.h" +#include <boost/asio/yield.hpp> + #define dout_subsys ceph_subsys_rgw #undef dout_prefix diff --git a/src/rgw/rgw_metadata.cc b/src/rgw/rgw_metadata.cc index 0a0f3dec324..92e8e381c5c 100644 --- a/src/rgw/rgw_metadata.cc +++ b/src/rgw/rgw_metadata.cc @@ -12,9 +12,9 @@ #include "rgw_tools.h" #include "rgw_cr_rados.h" -#include "rgw_boost_asio_yield.h" #include "include/assert.h" +#include <boost/asio/yield.hpp> #define dout_subsys ceph_subsys_rgw diff --git a/src/rgw/rgw_period_pusher.cc b/src/rgw/rgw_period_pusher.cc index 75b454cf1c6..e068da4376b 100644 --- a/src/rgw/rgw_period_pusher.cc +++ b/src/rgw/rgw_period_pusher.cc @@ -7,8 +7,7 @@ #include "rgw_period_pusher.h" #include "rgw_cr_rest.h" #include "common/errno.h" - -#include "rgw_boost_asio_yield.h" +#include <boost/asio/yield.hpp> #define dout_subsys ceph_subsys_rgw diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 07e5fdb7603..fb2fc918455 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -44,7 +44,6 @@ #include "rgw_coroutine.h" #include "rgw_compression.h" -#include "rgw_boost_asio_yield.h" #undef fork // fails to compile RGWPeriod::fork() below #include "common/Clock.h" diff --git a/src/rgw/rgw_sync.cc b/src/rgw/rgw_sync.cc index a9ef1ac784f..7a8a8bec2f1 100644 --- a/src/rgw/rgw_sync.cc +++ b/src/rgw/rgw_sync.cc @@ -20,10 +20,11 @@ #include "rgw_cr_rados.h" #include "rgw_cr_rest.h" #include "rgw_http_client.h" -#include "rgw_boost_asio_yield.h" #include "cls/lock/cls_lock_client.h" +#include <boost/asio/yield.hpp> + #define dout_subsys ceph_subsys_rgw #undef dout_prefix diff --git a/src/rgw/rgw_sync_module.cc b/src/rgw/rgw_sync_module.cc index 29c5a9ff926..215dcf2fee0 100644 --- a/src/rgw/rgw_sync_module.cc +++ b/src/rgw/rgw_sync_module.cc @@ -3,11 +3,12 @@ #include "rgw_cr_rados.h" #include "rgw_sync_module.h" #include "rgw_data_sync.h" -#include "rgw_boost_asio_yield.h" #include "rgw_sync_module_log.h" #include "rgw_sync_module_es.h" +#include <boost/asio/yield.hpp> + #define dout_subsys ceph_subsys_rgw RGWStatRemoteObjCBCR::RGWStatRemoteObjCBCR(RGWDataSyncEnv *_sync_env, diff --git a/src/rgw/rgw_sync_module_es.cc b/src/rgw/rgw_sync_module_es.cc index 443057f8115..484352dc835 100644 --- a/src/rgw/rgw_sync_module_es.cc +++ b/src/rgw/rgw_sync_module_es.cc @@ -2,7 +2,6 @@ #include "rgw_coroutine.h" #include "rgw_sync_module.h" #include "rgw_data_sync.h" -#include "rgw_boost_asio_yield.h" #include "rgw_sync_module_es.h" #include "rgw_sync_module_es_rest.h" #include "rgw_rest_conn.h" @@ -12,6 +11,8 @@ #include "include/str_list.h" +#include <boost/asio/yield.hpp> + #define dout_subsys ceph_subsys_rgw diff --git a/src/rgw/rgw_sync_module_log.cc b/src/rgw/rgw_sync_module_log.cc index 67212ec593a..93a853f5600 100644 --- a/src/rgw/rgw_sync_module_log.cc +++ b/src/rgw/rgw_sync_module_log.cc @@ -3,7 +3,6 @@ #include "rgw_cr_rados.h" #include "rgw_sync_module.h" #include "rgw_data_sync.h" -#include "rgw_boost_asio_yield.h" #include "rgw_sync_module_log.h" #define dout_subsys ceph_subsys_rgw |