From 09d3f546b32cdf126a1246899a0b0a3eb25282d8 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 28 Aug 2018 20:08:33 +0800 Subject: [PATCH] mon,auth,common: include necessary headers we cannot assume the included header alway indirectly include the use types in this case, CephContext is defined by ceph_context.h, and g_ceph_context is declared by global_context.h. so we need to included them respectively. and remove unused headers. Signed-off-by: Kefu Chai --- src/auth/Crypto.cc | 1 + src/auth/KeyRing.cc | 1 + src/auth/cephx/CephxClientHandler.cc | 1 + src/auth/cephx/CephxProtocol.cc | 1 + src/common/Cond.h | 1 + src/common/ConfUtils.cc | 1 - src/common/SloppyCRCMap.cc | 3 ++- src/common/SloppyCRCMap.h | 7 +++++-- src/include/str_list.h | 3 +-- src/mon/Session.h | 1 + 10 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/auth/Crypto.cc b/src/auth/Crypto.cc index 1b3cca83e9cb0..b94b7949f44a3 100644 --- a/src/auth/Crypto.cc +++ b/src/auth/Crypto.cc @@ -23,6 +23,7 @@ #include "include/assert.h" #include "common/Clock.h" #include "common/armor.h" +#include "common/ceph_context.h" #include "common/ceph_crypto.h" #include "common/hex.h" #include "common/safe_io.h" diff --git a/src/auth/KeyRing.cc b/src/auth/KeyRing.cc index 01bb9c761a29b..387738c87583a 100644 --- a/src/auth/KeyRing.cc +++ b/src/auth/KeyRing.cc @@ -18,6 +18,7 @@ #include #include #include "auth/KeyRing.h" +#include "common/ceph_context.h" #include "common/config.h" #include "common/debug.h" #include "common/errno.h" diff --git a/src/auth/cephx/CephxClientHandler.cc b/src/auth/cephx/CephxClientHandler.cc index 1748fa27e543f..73e4c7e16d9fa 100644 --- a/src/auth/cephx/CephxClientHandler.cc +++ b/src/auth/cephx/CephxClientHandler.cc @@ -20,6 +20,7 @@ #include "auth/KeyRing.h" #include "include/random.h" +#include "common/ceph_context.h" #include "common/config.h" #include "common/dout.h" diff --git a/src/auth/cephx/CephxProtocol.cc b/src/auth/cephx/CephxProtocol.cc index 58cc26f3d73ef..d57c6e768eedd 100644 --- a/src/auth/cephx/CephxProtocol.cc +++ b/src/auth/cephx/CephxProtocol.cc @@ -14,6 +14,7 @@ #include "CephxProtocol.h" #include "common/Clock.h" +#include "common/ceph_context.h" #include "common/config.h" #include "common/debug.h" #include "include/buffer.h" diff --git a/src/common/Cond.h b/src/common/Cond.h index 061370f1cf410..c74fcfd37872e 100644 --- a/src/common/Cond.h +++ b/src/common/Cond.h @@ -16,6 +16,7 @@ #ifndef CEPH_COND_H #define CEPH_COND_H +#include "common/Clock.h" #include "include/Context.h" class Cond { diff --git a/src/common/ConfUtils.cc b/src/common/ConfUtils.cc index 7c8f1cc78b7f0..ee008a39ce671 100644 --- a/src/common/ConfUtils.cc +++ b/src/common/ConfUtils.cc @@ -14,7 +14,6 @@ #include #include -#include #include #include diff --git a/src/common/SloppyCRCMap.cc b/src/common/SloppyCRCMap.cc index 58dd7800cbea2..102a6399765d1 100644 --- a/src/common/SloppyCRCMap.cc +++ b/src/common/SloppyCRCMap.cc @@ -2,6 +2,7 @@ // vim: ts=8 sw=2 smarttab #include "common/SloppyCRCMap.h" +#include "common/Formatter.h" using namespace std; @@ -156,7 +157,7 @@ void SloppyCRCMap::decode(bufferlist::const_iterator& bl) DECODE_FINISH(bl); } -void SloppyCRCMap::dump(Formatter *f) const +void SloppyCRCMap::dump(ceph::Formatter *f) const { f->dump_unsigned("block_size", block_size); f->open_array_section("crc_map"); diff --git a/src/common/SloppyCRCMap.h b/src/common/SloppyCRCMap.h index 7802b6347dd85..0c2d646fa8c57 100644 --- a/src/common/SloppyCRCMap.h +++ b/src/common/SloppyCRCMap.h @@ -5,7 +5,10 @@ #define CEPH_COMMON_SLOPPYCRCMAP_H #include "include/encoding.h" -#include "common/Formatter.h" + +namespace ceph { +class Formatter; +} /** * SloppyCRCMap @@ -65,7 +68,7 @@ public: void encode(bufferlist& bl) const; void decode(bufferlist::const_iterator& bl); - void dump(Formatter *f) const; + void dump(ceph::Formatter *f) const; static void generate_test_instances(std::list& ls); }; WRITE_CLASS_ENCODER(SloppyCRCMap) diff --git a/src/include/str_list.h b/src/include/str_list.h index c8fa914832ce7..e4cd7bbbd31b4 100644 --- a/src/include/str_list.h +++ b/src/include/str_list.h @@ -4,9 +4,8 @@ #include #include #include +#include #include -#include - namespace ceph { diff --git a/src/mon/Session.h b/src/mon/Session.h index 8bb4a1ce7927b..efa227b2f83a1 100644 --- a/src/mon/Session.h +++ b/src/mon/Session.h @@ -15,6 +15,7 @@ #ifndef CEPH_MON_SESSION_H #define CEPH_MON_SESSION_H +#include "global/global_context.h" #include "include/xlist.h" #include "msg/msg_types.h" #include "mon/mon_types.h" -- 2.39.5