From 2c118094e59429161aada57c70f69f72eb158e0a Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 10 Mar 2021 19:18:38 +0800 Subject: [PATCH] rgw: do not include RWLock.h unless RWLock is used Signed-off-by: Kefu Chai --- src/rgw/rgw_coroutine.h | 1 - src/rgw/rgw_data_sync.cc | 1 - src/rgw/rgw_data_sync.h | 1 - src/rgw/rgw_frontend.h | 2 ++ src/rgw/rgw_http_client.cc | 2 +- src/rgw/rgw_http_client.h | 1 - src/rgw/rgw_mdlog.h | 2 ++ src/rgw/rgw_rados.h | 1 - src/rgw/rgw_sync.cc | 1 - src/rgw/rgw_sync.h | 1 - src/rgw/rgw_user.cc | 1 - src/rgw/services/svc_rados.h | 1 - src/rgw/services/svc_sys_obj_cache.h | 1 + 13 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/rgw/rgw_coroutine.h b/src/rgw/rgw_coroutine.h index 0d0b48bddc8..da5681d68ce 100644 --- a/src/rgw/rgw_coroutine.h +++ b/src/rgw/rgw_coroutine.h @@ -21,7 +21,6 @@ #include "common/debug.h" #include "common/Timer.h" #include "common/admin_socket.h" -#include "common/RWLock.h" #include "rgw_common.h" #include "rgw_http_client_types.h" diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index e6436043b9d..0412a6b9a3f 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -2,7 +2,6 @@ // vim: ts=8 sw=2 smarttab ft=cpp #include "common/ceph_json.h" -#include "common/RWLock.h" #include "common/RefCountedObj.h" #include "common/WorkQueue.h" #include "common/Throttle.h" diff --git a/src/rgw/rgw_data_sync.h b/src/rgw/rgw_data_sync.h index 25db8da2fc8..7ecac3f5694 100644 --- a/src/rgw/rgw_data_sync.h +++ b/src/rgw/rgw_data_sync.h @@ -6,7 +6,6 @@ #include "include/encoding.h" -#include "common/RWLock.h" #include "common/ceph_json.h" #include "rgw_coroutine.h" diff --git a/src/rgw/rgw_frontend.h b/src/rgw/rgw_frontend.h index 50519b21dea..546cfef0e4e 100644 --- a/src/rgw/rgw_frontend.h +++ b/src/rgw/rgw_frontend.h @@ -7,6 +7,8 @@ #include #include +#include "common/RWLock.h" + #include "rgw_request.h" #include "rgw_process.h" #include "rgw_realm_reloader.h" diff --git a/src/rgw/rgw_http_client.cc b/src/rgw/rgw_http_client.cc index 06559a4790f..761f6f24c5a 100644 --- a/src/rgw/rgw_http_client.cc +++ b/src/rgw/rgw_http_client.cc @@ -661,7 +661,7 @@ static int clear_signal(int fd) // since we're in non-blocking mode, we can try to read a lot more than // one signal from signal_thread() to avoid later wakeups. non-blocking reads // are also required to support the curl_multi_wait bug workaround - std::array buf; + std::array buf{}; int ret = ::read(fd, (void *)buf.data(), buf.size()); if (ret < 0) { ret = -errno; diff --git a/src/rgw/rgw_http_client.h b/src/rgw/rgw_http_client.h index 840ff88fe97..010537ac656 100644 --- a/src/rgw/rgw_http_client.h +++ b/src/rgw/rgw_http_client.h @@ -5,7 +5,6 @@ #define CEPH_RGW_HTTP_CLIENT_H #include "common/async/yield_context.h" -#include "common/RWLock.h" #include "common/Cond.h" #include "rgw_common.h" #include "rgw_string.h" diff --git a/src/rgw/rgw_mdlog.h b/src/rgw/rgw_mdlog.h index 9064f8c0417..53f5df762b9 100644 --- a/src/rgw/rgw_mdlog.h +++ b/src/rgw/rgw_mdlog.h @@ -16,6 +16,8 @@ #pragma once +#include "common/RWLock.h" + #include "rgw_metadata.h" #include "rgw_mdlog_types.h" diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index f4564104c4b..e45125984db 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -10,7 +10,6 @@ #include "include/rados/librados.hpp" #include "include/Context.h" #include "common/RefCountedObj.h" -#include "common/RWLock.h" #include "common/ceph_time.h" #include "rgw_common.h" #include "cls/rgw/cls_rgw_types.h" diff --git a/src/rgw/rgw_sync.cc b/src/rgw/rgw_sync.cc index 078786d6983..5b9b9e94a38 100644 --- a/src/rgw/rgw_sync.cc +++ b/src/rgw/rgw_sync.cc @@ -4,7 +4,6 @@ #include #include "common/ceph_json.h" -#include "common/RWLock.h" #include "common/RefCountedObj.h" #include "common/WorkQueue.h" #include "common/Throttle.h" diff --git a/src/rgw/rgw_sync.h b/src/rgw/rgw_sync.h index 4d0d72c9839..5938de233fc 100644 --- a/src/rgw/rgw_sync.h +++ b/src/rgw/rgw_sync.h @@ -7,7 +7,6 @@ #include #include "include/stringify.h" -#include "common/RWLock.h" #include "rgw_coroutine.h" #include "rgw_http_client.h" diff --git a/src/rgw/rgw_user.cc b/src/rgw/rgw_user.cc index 07822c48189..4ab78e25a5a 100644 --- a/src/rgw/rgw_user.cc +++ b/src/rgw/rgw_user.cc @@ -10,7 +10,6 @@ #include "common/errno.h" #include "common/Formatter.h" #include "common/ceph_json.h" -#include "common/RWLock.h" #include "rgw_sal_rados.h" #include "rgw_zone.h" #include "rgw_acl.h" diff --git a/src/rgw/services/svc_rados.h b/src/rgw/services/svc_rados.h index 57b4cd54209..c167019e241 100644 --- a/src/rgw/services/svc_rados.h +++ b/src/rgw/services/svc_rados.h @@ -7,7 +7,6 @@ #include "include/rados/librados.hpp" #include "common/async/yield_context.h" -#include "common/RWLock.h" class RGWAsyncRadosProcessor; diff --git a/src/rgw/services/svc_sys_obj_cache.h b/src/rgw/services/svc_sys_obj_cache.h index a0184e89df2..c4ca6b21be6 100644 --- a/src/rgw/services/svc_sys_obj_cache.h +++ b/src/rgw/services/svc_sys_obj_cache.h @@ -3,6 +3,7 @@ #pragma once +#include "common/RWLock.h" #include "rgw/rgw_service.h" #include "rgw/rgw_cache.h" -- 2.39.5