diff options
Diffstat (limited to 'src/common')
77 files changed, 265 insertions, 291 deletions
diff --git a/src/common/BackTrace.cc b/src/common/BackTrace.cc index ebbb33c0145..fcbc0fe1153 100644 --- a/src/common/BackTrace.cc +++ b/src/common/BackTrace.cc @@ -1,13 +1,13 @@ +#include "acconfig.h" #include <ostream> #include <cxxabi.h> #include <stdlib.h> #include <string.h> -#include "BackTrace.h" - #include "common/version.h" -#include "acconfig.h" + +#include "BackTrace.h" #define _STR(x) #x #define STRINGIFY(x) _STR(x) diff --git a/src/common/Clock.cc b/src/common/Clock.cc index 9b6554a8e9d..a6e23d509fa 100644 --- a/src/common/Clock.cc +++ b/src/common/Clock.cc @@ -12,13 +12,10 @@ * */ - -#include "common/Clock.h" #include "common/ceph_context.h" #include "common/config.h" -#include "include/utime.h" -#include <time.h> +#include "Clock.h" utime_t ceph_clock_now(CephContext *cct) { diff --git a/src/common/Clock.h b/src/common/Clock.h index bdcb0d15530..42e36eca57c 100644 --- a/src/common/Clock.h +++ b/src/common/Clock.h @@ -15,10 +15,10 @@ #ifndef CEPH_CLOCK_H #define CEPH_CLOCK_H -#include "include/utime.h" - #include <time.h> +#include "include/utime.h" + class CephContext; extern utime_t ceph_clock_now(CephContext *cct); diff --git a/src/common/Cond.h b/src/common/Cond.h index ee95a65b5b6..360a2722862 100644 --- a/src/common/Cond.h +++ b/src/common/Cond.h @@ -16,14 +16,12 @@ #ifndef CEPH_COND_H #define CEPH_COND_H +#include <pthread.h> #include <time.h> -#include "Mutex.h" -#include "Clock.h" - #include "include/Context.h" - -#include <pthread.h> +#include "common/Mutex.h" +#include "common/Clock.h" class Cond { // my bits diff --git a/src/common/ConfUtils.cc b/src/common/ConfUtils.cc index 147cdc2fb60..397c850c756 100644 --- a/src/common/ConfUtils.cc +++ b/src/common/ConfUtils.cc @@ -15,7 +15,6 @@ #include <algorithm> #include <errno.h> #include <list> -#include <map> #include <sstream> #include <stdio.h> #include <stdlib.h> @@ -25,10 +24,10 @@ #include <sys/types.h> #include <unistd.h> -#include "include/buffer.h" #include "common/errno.h" #include "common/utf8.h" -#include "common/ConfUtils.h" + +#include "ConfUtils.h" using std::cerr; using std::ostringstream; diff --git a/src/common/DecayCounter.h b/src/common/DecayCounter.h index fa6f85f49b0..80664627ad0 100644 --- a/src/common/DecayCounter.h +++ b/src/common/DecayCounter.h @@ -15,10 +15,10 @@ #ifndef CEPH_DECAYCOUNTER_H #define CEPH_DECAYCOUNTER_H -#include "include/utime.h" - #include <math.h> +#include "include/utime.h" + /** * * TODO: normalize value based on some fucntion of half_life, diff --git a/src/common/Finisher.cc b/src/common/Finisher.cc index c2029f2d668..7a7223e2cfb 100644 --- a/src/common/Finisher.cc +++ b/src/common/Finisher.cc @@ -2,9 +2,10 @@ // vim: ts=8 sw=2 smarttab #include "common/config.h" +#include "common/debug.h" + #include "Finisher.h" -#include "common/debug.h" #define dout_subsys ceph_subsys_finisher #undef dout_prefix #define dout_prefix *_dout << "finisher(" << this << ") " diff --git a/src/common/Formatter.cc b/src/common/Formatter.cc index 305aa3bc466..1f882682050 100644 --- a/src/common/Formatter.cc +++ b/src/common/Formatter.cc @@ -14,18 +14,15 @@ #define LARGE_SIZE 1024 -#include "assert.h" -#include "Formatter.h" -#include "common/escape.h" - -#include <inttypes.h> -#include <iostream> -#include <sstream> -#include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <vector> +#include "include/assert.h" +#include "common/escape.h" + +#include "Formatter.h" + // ----------------------- namespace ceph { diff --git a/src/common/Formatter.h b/src/common/Formatter.h index 5c6bb573d23..b2567c20f4d 100644 --- a/src/common/Formatter.h +++ b/src/common/Formatter.h @@ -1,8 +1,8 @@ #ifndef CEPH_FORMATTER_H #define CEPH_FORMATTER_H -#include <deque> #include <inttypes.h> +#include <deque> #include <iostream> #include <list> #include <ostream> diff --git a/src/common/HeartbeatMap.cc b/src/common/HeartbeatMap.cc index 48e6e021fc9..55107dd8af7 100644 --- a/src/common/HeartbeatMap.cc +++ b/src/common/HeartbeatMap.cc @@ -18,11 +18,12 @@ #include <fcntl.h> #include <errno.h> -#include "HeartbeatMap.h" -#include "ceph_context.h" +#include "common/ceph_context.h" #include "common/errno.h" +#include "common/debug.h" + +#include "HeartbeatMap.h" -#include "debug.h" #define dout_subsys ceph_subsys_heartbeatmap #undef dout_prefix #define dout_prefix *_dout << "heartbeat_map " diff --git a/src/common/HeartbeatMap.h b/src/common/HeartbeatMap.h index e6d736f61a1..ce82923b649 100644 --- a/src/common/HeartbeatMap.h +++ b/src/common/HeartbeatMap.h @@ -16,13 +16,12 @@ #define CEPH_HEARTBEATMAP_H #include <pthread.h> - #include <string> #include <list> #include "include/atomic.h" -#include "RWLock.h" +#include "common/RWLock.h" class CephContext; diff --git a/src/common/LogClient.cc b/src/common/LogClient.cc index 0dce8bd69a0..b8ddcb98388 100644 --- a/src/common/LogClient.cc +++ b/src/common/LogClient.cc @@ -12,17 +12,8 @@ * */ - - #include "include/types.h" -#include "msg/Messenger.h" -#include "msg/Message.h" - -#include "messages/MLog.h" -#include "messages/MLogAck.h" -#include "mon/MonMap.h" - #include <iostream> #include <errno.h> #include <sys/stat.h> @@ -33,9 +24,14 @@ #include <sys/mount.h> #endif // DARWIN -#include "common/LogClient.h" - #include "common/config.h" +#include "msg/Messenger.h" +#include "mon/MonMap.h" + +#include "messages/MLog.h" +#include "messages/MLogAck.h" + +#include "LogClient.h" #define dout_subsys ceph_subsys_monc diff --git a/src/common/LogClient.h b/src/common/LogClient.h index 8fa7bd14ce6..b254961f222 100644 --- a/src/common/LogClient.h +++ b/src/common/LogClient.h @@ -15,12 +15,12 @@ #ifndef CEPH_LOGCLIENT_H #define CEPH_LOGCLIENT_H -#include "common/LogEntry.h" -#include "common/Mutex.h" - #include <iosfwd> #include <sstream> +#include "common/LogEntry.h" +#include "common/Mutex.h" + class LogClient; class MLog; class MLogAck; diff --git a/src/common/LogEntry.cc b/src/common/LogEntry.cc index 80801bcf3a3..7aa50786c72 100644 --- a/src/common/LogEntry.cc +++ b/src/common/LogEntry.cc @@ -1,9 +1,9 @@ #include <syslog.h> -#include "LogEntry.h" -#include "Formatter.h" +#include "common/Formatter.h" +#include "LogEntry.h" int clog_type_to_syslog_prio(clog_type t) { diff --git a/src/common/LogEntry.h b/src/common/LogEntry.h index cea68013016..1c17b50e9a4 100644 --- a/src/common/LogEntry.h +++ b/src/common/LogEntry.h @@ -16,9 +16,10 @@ #define CEPH_LOGENTRY_H #include "include/types.h" +#include "msg/msg_types.h" // for entity_inst_t + #include "include/utime.h" #include "include/encoding.h" -#include "msg/msg_types.h" // for entity_inst_t namespace ceph { class Formatter; diff --git a/src/common/MemoryModel.cc b/src/common/MemoryModel.cc index b21ed6133bc..8b2e36721b6 100644 --- a/src/common/MemoryModel.cc +++ b/src/common/MemoryModel.cc @@ -1,11 +1,12 @@ - #include "include/types.h" -#include "MemoryModel.h" -#include "common/config.h" -#include "debug.h" #include <fstream> +#include "common/config.h" +#include "common/debug.h" + +#include "MemoryModel.h" + #define dout_subsys ceph_subsys_ MemoryModel::MemoryModel(CephContext *cct_) diff --git a/src/common/Mutex.cc b/src/common/Mutex.cc index 235086470a7..faffbc346e6 100644 --- a/src/common/Mutex.cc +++ b/src/common/Mutex.cc @@ -11,16 +11,17 @@ * Foundation. See file COPYING. * */ -using namespace std; #include <string> -#include "common/Mutex.h" +#include "include/utime.h" #include "common/perf_counters.h" -#include "common/ceph_context.h" #include "common/config.h" -#include "include/utime.h" #include "common/Clock.h" +#include "Mutex.h" + +using namespace std; + Mutex::Mutex(const char *n, bool r, bool ld, bool bt, CephContext *cct) : diff --git a/src/common/Mutex.h b/src/common/Mutex.h index 06e435d49df..cf81dfd514e 100644 --- a/src/common/Mutex.h +++ b/src/common/Mutex.h @@ -15,12 +15,12 @@ #ifndef CEPH_MUTEX_H #define CEPH_MUTEX_H +#include <pthread.h> + #include "include/assert.h" -#include "lockdep.h" +#include "common/lockdep.h" #include "common/ceph_context.h" -#include <pthread.h> - using namespace ceph; class PerfCounters; diff --git a/src/common/OutputDataSocket.cc b/src/common/OutputDataSocket.cc index 353596fe830..3832d23d784 100644 --- a/src/common/OutputDataSocket.cc +++ b/src/common/OutputDataSocket.cc @@ -11,34 +11,30 @@ * Foundation. See file COPYING. * */ - -#include "common/Thread.h" -#include "common/OutputDataSocket.h" -#include "common/config.h" -#include "common/debug.h" -#include "common/errno.h" -#include "common/perf_counters.h" -#include "common/pipe.h" -#include "common/safe_io.h" -#include "common/version.h" -#include "common/Formatter.h" - +#include <inttypes.h> #include <errno.h> #include <fcntl.h> -#include <inttypes.h> -#include <map> #include <poll.h> #include <set> #include <sstream> #include <stdint.h> #include <string.h> -#include <string> #include <sys/socket.h> #include <sys/types.h> #include <sys/un.h> #include <unistd.h> #include "include/compat.h" +#include "common/config.h" +#include "common/debug.h" +#include "common/errno.h" +#include "common/perf_counters.h" +#include "common/pipe.h" +#include "common/safe_io.h" +#include "common/version.h" +#include "common/Formatter.h" + +#include "OutputDataSocket.h" #define dout_subsys ceph_subsys_asok #undef dout_prefix diff --git a/src/common/OutputDataSocket.h b/src/common/OutputDataSocket.h index f581a56bf03..03f99766303 100644 --- a/src/common/OutputDataSocket.h +++ b/src/common/OutputDataSocket.h @@ -15,14 +15,14 @@ #ifndef CEPH_COMMON_OUTPUTDATASOCKET_H #define CEPH_COMMON_OUTPUTDATASOCKET_H -#include "common/Thread.h" -#include "common/Mutex.h" -#include "common/Cond.h" - #include <string> #include <map> #include <list> + #include "include/buffer.h" +#include "common/Thread.h" +#include "common/Mutex.h" +#include "common/Cond.h" class CephContext; diff --git a/src/common/PrebufferedStreambuf.cc b/src/common/PrebufferedStreambuf.cc index d6db8bbe0af..4b8a9288395 100644 --- a/src/common/PrebufferedStreambuf.cc +++ b/src/common/PrebufferedStreambuf.cc @@ -1,5 +1,5 @@ -#include "common/PrebufferedStreambuf.h" +#include "PrebufferedStreambuf.h" PrebufferedStreambuf::PrebufferedStreambuf(char *buf, size_t len) : m_buf(buf), m_buf_len(len) diff --git a/src/common/RWLock.h b/src/common/RWLock.h index f8915ed288e..847f62b5af4 100644 --- a/src/common/RWLock.h +++ b/src/common/RWLock.h @@ -18,7 +18,8 @@ #define CEPH_RWLock_Posix__H #include <pthread.h> -#include "lockdep.h" + +#include "common/lockdep.h" class RWLock { diff --git a/src/common/RefCountedObj.cc b/src/common/RefCountedObj.cc index 236a2b11ffd..9c8b8418b6b 100644 --- a/src/common/RefCountedObj.cc +++ b/src/common/RefCountedObj.cc @@ -12,7 +12,7 @@ * */ -#include "common/RefCountedObj.h" +#include "RefCountedObj.h" void intrusive_ptr_add_ref(RefCountedObject *p) { p->get(); diff --git a/src/common/RefCountedObj.h b/src/common/RefCountedObj.h index 4bbbc8dfa61..0cd6b8f969c 100644 --- a/src/common/RefCountedObj.h +++ b/src/common/RefCountedObj.h @@ -15,10 +15,9 @@ #ifndef CEPH_REFCOUNTEDOBJ_H #define CEPH_REFCOUNTEDOBJ_H +#include "include/atomic.h" #include "common/Mutex.h" #include "common/Cond.h" -#include "include/atomic.h" - struct RefCountedObject { atomic_t nref; diff --git a/src/common/TextTable.h b/src/common/TextTable.h index 44d0aa4cd46..f1e6235d39b 100644 --- a/src/common/TextTable.h +++ b/src/common/TextTable.h @@ -15,6 +15,7 @@ #include <sstream> #include <iomanip> #include <string> + #include "include/assert.h" /** diff --git a/src/common/Thread.cc b/src/common/Thread.cc index 0f4e322b27a..4d18e7cc069 100644 --- a/src/common/Thread.cc +++ b/src/common/Thread.cc @@ -12,21 +12,20 @@ * */ -#include "common/Thread.h" -#include "common/code_environment.h" -#include "common/debug.h" -#include "common/signal.h" - #include <dirent.h> #include <errno.h> #include <iostream> -#include <pthread.h> #include <signal.h> #include <sstream> #include <stdlib.h> #include <string.h> #include <sys/types.h> +#include "common/code_environment.h" +#include "common/debug.h" +#include "common/signal.h" + +#include "Thread.h" Thread::Thread() : thread_id(0) diff --git a/src/common/Throttle.cc b/src/common/Throttle.cc index 796f0c5c4fc..758178d835c 100644 --- a/src/common/Throttle.cc +++ b/src/common/Throttle.cc @@ -1,9 +1,9 @@ - -#include "common/Throttle.h" #include "common/debug.h" #include "common/ceph_context.h" #include "common/perf_counters.h" +#include "Throttle.h" + #define dout_subsys ceph_subsys_throttle #undef dout_prefix diff --git a/src/common/Throttle.h b/src/common/Throttle.h index e1fbcb494c7..8ff2c13b6a7 100644 --- a/src/common/Throttle.h +++ b/src/common/Throttle.h @@ -1,10 +1,11 @@ #ifndef CEPH_THROTTLE_H #define CEPH_THROTTLE_H -#include "Mutex.h" -#include "Cond.h" #include <list> + #include "include/atomic.h" +#include "common/Mutex.h" +#include "common/Cond.h" class CephContext; class PerfCounters; diff --git a/src/common/Timer.cc b/src/common/Timer.cc index ac0550c768f..1b560c3033e 100644 --- a/src/common/Timer.cc +++ b/src/common/Timer.cc @@ -12,24 +12,21 @@ * */ -#include "Cond.h" -#include "Mutex.h" -#include "Thread.h" -#include "Timer.h" +#include <sstream> +#include <signal.h> +#include <sys/time.h> +#include <math.h> -#include "common/config.h" #include "include/Context.h" +#include "common/config.h" +#include "common/Thread.h" + +#include "Timer.h" #define dout_subsys ceph_subsys_timer #undef dout_prefix #define dout_prefix *_dout << "timer(" << this << ")." -#include <sstream> -#include <signal.h> -#include <sys/time.h> -#include <math.h> - - class SafeTimerThread : public Thread { SafeTimer *parent; public: diff --git a/src/common/Timer.h b/src/common/Timer.h index 40d5015e18b..de89de60e80 100644 --- a/src/common/Timer.h +++ b/src/common/Timer.h @@ -15,11 +15,11 @@ #ifndef CEPH_TIMER_H #define CEPH_TIMER_H -#include "Cond.h" -#include "Mutex.h" - #include <map> +#include "common/Cond.h" +#include "common/Mutex.h" + class CephContext; class Context; class SafeTimerThread; diff --git a/src/common/WorkQueue.cc b/src/common/WorkQueue.cc index f2fc1747a9b..5d169b57108 100644 --- a/src/common/WorkQueue.cc +++ b/src/common/WorkQueue.cc @@ -11,16 +11,16 @@ * Foundation. See file COPYING. * */ +#include "include/types.h" #include <sstream> -#include "include/types.h" #include "include/utime.h" -#include "WorkQueue.h" - #include "common/config.h" #include "common/HeartbeatMap.h" +#include "WorkQueue.h" + #define dout_subsys ceph_subsys_tp #undef dout_prefix #define dout_prefix *_dout << name << " " diff --git a/src/common/WorkQueue.h b/src/common/WorkQueue.h index 2475b45d1ac..1b0ceac3c16 100644 --- a/src/common/WorkQueue.h +++ b/src/common/WorkQueue.h @@ -15,9 +15,9 @@ #ifndef CEPH_WORKQUEUE_H #define CEPH_WORKQUEUE_H -#include "Mutex.h" -#include "Cond.h" -#include "Thread.h" +#include "common/Mutex.h" +#include "common/Cond.h" +#include "common/Thread.h" #include "common/config_obs.h" class CephContext; diff --git a/src/common/admin_socket.cc b/src/common/admin_socket.cc index 428f863fa9f..06e62d7f0e1 100644 --- a/src/common/admin_socket.cc +++ b/src/common/admin_socket.cc @@ -12,33 +12,31 @@ * */ -#include "common/Thread.h" -#include "common/admin_socket.h" -#include "common/config.h" -#include "common/debug.h" -#include "common/errno.h" -#include "common/perf_counters.h" -#include "common/pipe.h" -#include "common/safe_io.h" -#include "common/version.h" -#include "common/Formatter.h" - #include <errno.h> #include <fcntl.h> #include <inttypes.h> -#include <map> #include <poll.h> #include <set> #include <sstream> #include <stdint.h> #include <string.h> -#include <string> #include <sys/socket.h> #include <sys/types.h> #include <sys/un.h> #include <unistd.h> #include "include/compat.h" +#include "common/Thread.h" +#include "common/config.h" +#include "common/debug.h" +#include "common/errno.h" +#include "common/perf_counters.h" +#include "common/pipe.h" +#include "common/safe_io.h" +#include "common/version.h" +#include "common/Formatter.h" + +#include "admin_socket.h" #define dout_subsys ceph_subsys_asok #undef dout_prefix diff --git a/src/common/admin_socket.h b/src/common/admin_socket.h index 6154f50cabe..e0e06f0b6a6 100644 --- a/src/common/admin_socket.h +++ b/src/common/admin_socket.h @@ -15,12 +15,12 @@ #ifndef CEPH_COMMON_ADMIN_SOCKET_H #define CEPH_COMMON_ADMIN_SOCKET_H -#include "common/Thread.h" -#include "common/Mutex.h" - #include <string> #include <map> + #include "include/buffer.h" +#include "common/Thread.h" +#include "common/Mutex.h" class AdminSocket; class CephContext; diff --git a/src/common/admin_socket_client.cc b/src/common/admin_socket_client.cc index 782e808ad86..ec66161f0a1 100644 --- a/src/common/admin_socket_client.cc +++ b/src/common/admin_socket_client.cc @@ -12,12 +12,6 @@ * */ -#include "common/admin_socket.h" -#include "common/ceph_context.h" -#include "common/errno.h" -#include "common/safe_io.h" -#include "common/admin_socket_client.h" - #include <arpa/inet.h> #include <errno.h> #include <fcntl.h> @@ -25,11 +19,9 @@ #include <map> #include <poll.h> #include <sstream> -#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <string> #include <sys/socket.h> #include <sys/types.h> #include <sys/un.h> @@ -37,6 +29,13 @@ #include <unistd.h> #include <vector> +#include "common/admin_socket.h" +#include "common/ceph_context.h" +#include "common/errno.h" +#include "common/safe_io.h" + +#include "common/admin_socket_client.h" + using std::ostringstream; const char* get_rand_socket_path() diff --git a/src/common/assert.cc b/src/common/assert.cc index 7889ad043a6..6b4958d4990 100644 --- a/src/common/assert.cc +++ b/src/common/assert.cc @@ -11,20 +11,19 @@ * Foundation. See file COPYING. * */ - -#include "BackTrace.h" -#include "common/ceph_context.h" -#include "common/config.h" -#include "common/debug.h" -#include "common/Clock.h" -#include "include/assert.h" - #include <errno.h> #include <iostream> #include <pthread.h> #include <sstream> #include <time.h> +#include "include/assert.h" +#include "common/ceph_context.h" +#include "common/config.h" +#include "common/debug.h" +#include "common/Clock.h" +#include "common/BackTrace.h" + namespace ceph { static CephContext *g_assert_context = NULL; diff --git a/src/common/blkdev.cc b/src/common/blkdev.cc index 22b0aa67b3e..bc2307baacd 100644 --- a/src/common/blkdev.cc +++ b/src/common/blkdev.cc @@ -1,20 +1,20 @@ +#include "acconfig.h" + #include <inttypes.h> #include <fcntl.h> #include <sys/ioctl.h> #include <errno.h> - #include <sys/types.h> #include <sys/stat.h> #include <sys/mount.h> #include <iostream> -#include "acconfig.h" -#include "include/compat.h" - #if defined(__FreeBSD__) #include <sys/disk.h> #endif +#include "include/compat.h" + int get_block_device_size(int fd, int64_t *psize) { int ret = 0; diff --git a/src/common/buffer.cc b/src/common/buffer.cc index b2d3ec6ed8c..9caba6aead2 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -11,16 +11,7 @@ * Foundation. See file COPYING. * */ - - -#include "armor.h" -#include "common/environment.h" -#include "common/errno.h" -#include "common/safe_io.h" -#include "common/simple_spin.h" -#include "include/atomic.h" #include "include/types.h" -#include "include/compat.h" #include <errno.h> #include <fstream> @@ -28,6 +19,14 @@ #include <sys/uio.h> #include <limits.h> +#include "include/atomic.h" +#include "include/compat.h" +#include "common/environment.h" +#include "common/errno.h" +#include "common/safe_io.h" +#include "common/simple_spin.h" +#include "common/armor.h" + namespace ceph { #ifdef BUFFER_DEBUG diff --git a/src/common/ceph_argparse.cc b/src/common/ceph_argparse.cc index 646931acdc9..5b318103664 100644 --- a/src/common/ceph_argparse.cc +++ b/src/common/ceph_argparse.cc @@ -11,16 +11,6 @@ * Foundation. See file COPYING. * */ - -#include "auth/Auth.h" -#include "common/ConfUtils.h" -#include "common/ceph_argparse.h" -#include "common/common_init.h" -#include "common/config.h" -#include "common/strtol.h" -#include "common/version.h" -#include "include/intarith.h" -#include "include/str_list.h" #include "msg/msg_types.h" #include <errno.h> @@ -31,6 +21,17 @@ #include <sstream> #include <vector> +#include "include/intarith.h" +#include "include/str_list.h" +#include "common/ConfUtils.h" +#include "common/common_init.h" +#include "common/config.h" +#include "common/strtol.h" +#include "common/version.h" +#include "auth/Auth.h" + +#include "ceph_argparse.h" + /* * Ceph argument parsing library * diff --git a/src/common/ceph_argparse.h b/src/common/ceph_argparse.h index fd9439c5627..9cf7dc58beb 100644 --- a/src/common/ceph_argparse.h +++ b/src/common/ceph_argparse.h @@ -22,6 +22,7 @@ * Until we do that, though, this file is the place for argv parsing * stuff to live. */ +#include "msg/msg_types.h" #include <deque> #include <stdint.h> @@ -29,7 +30,6 @@ #include <vector> #include "common/entity_name.h" -#include "msg/msg_types.h" /////////////////////// Types /////////////////////// class CephInitParameters diff --git a/src/common/ceph_context.cc b/src/common/ceph_context.cc index decf86db70a..f40623ef664 100644 --- a/src/common/ceph_context.cc +++ b/src/common/ceph_context.cc @@ -13,23 +13,22 @@ */ #include <time.h> +#include <pthread.h> +#include <semaphore.h> #include "common/admin_socket.h" #include "common/perf_counters.h" #include "common/Thread.h" -#include "common/ceph_context.h" #include "common/config.h" #include "common/debug.h" #include "common/HeartbeatMap.h" #include "common/errno.h" #include "common/lockdep.h" #include "common/Formatter.h" -#include "log/Log.h" #include "auth/Crypto.h" +#include "log/Log.h" -#include <iostream> -#include <pthread.h> -#include <semaphore.h> +#include "ceph_context.h" using ceph::HeartbeatMap; diff --git a/src/common/ceph_crypto.cc b/src/common/ceph_crypto.cc index 3f04349c20b..9d866ac728f 100644 --- a/src/common/ceph_crypto.cc +++ b/src/common/ceph_crypto.cc @@ -12,13 +12,14 @@ * */ +#include <pthread.h> +#include <stdlib.h> + #include "common/config.h" #include "common/ceph_context.h" -#include "ceph_crypto.h" #include "auth/Crypto.h" -#include <pthread.h> -#include <stdlib.h> +#include "ceph_crypto.h" void ceph::crypto::shutdown(); diff --git a/src/common/ceph_crypto.h b/src/common/ceph_crypto.h index c55359431d4..33349c9af9c 100644 --- a/src/common/ceph_crypto.h +++ b/src/common/ceph_crypto.h @@ -10,7 +10,7 @@ #ifdef USE_CRYPTOPP # define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 -#include <string.h> +# include <string.h> # include <cryptopp/md5.h> # include <cryptopp/sha.h> # include <cryptopp/hmac.h> diff --git a/src/common/ceph_crypto_cms.cc b/src/common/ceph_crypto_cms.cc index 4d7a4ef598b..675a9c3a7a7 100644 --- a/src/common/ceph_crypto_cms.cc +++ b/src/common/ceph_crypto_cms.cc @@ -34,31 +34,23 @@ * * ***** END LICENSE BLOCK ***** */ - -#include "common/config.h" +#include <string.h> +#include <errno.h> #ifdef USE_NSS - #include <nspr.h> #include <cert.h> #include <nss.h> #include <smime.h> - #endif -#include <string.h> -#include <errno.h> - - -#include "include/buffer.h" - +#include "common/config.h" #include "common/debug.h" #include "ceph_crypto_cms.h" #define dout_subsys ceph_subsys_crypto - #ifndef USE_NSS int ceph_decode_cms(CephContext *cct, bufferlist& cms_bl, bufferlist& decoded_bl) diff --git a/src/common/code_environment.cc b/src/common/code_environment.cc index 58b27f86049..cf5db9b5481 100644 --- a/src/common/code_environment.cc +++ b/src/common/code_environment.cc @@ -12,17 +12,18 @@ * */ -#include "common/code_environment.h" - #include <errno.h> #include <iostream> #include <stdlib.h> #include <string.h> #include <string> + #if defined(__linux__) #include <sys/prctl.h> #endif +#include "code_environment.h" + code_environment_t g_code_env = CODE_ENVIRONMENT_UTILITY; extern "C" const char *code_environment_to_str(enum code_environment_t e) diff --git a/src/common/common_init.cc b/src/common/common_init.cc index defde28b22e..54ad4e293ff 100644 --- a/src/common/common_init.cc +++ b/src/common/common_init.cc @@ -11,21 +11,19 @@ * Foundation. See file COPYING. * */ +#include <errno.h> +#include "include/color.h" #include "common/ceph_argparse.h" #include "common/ceph_context.h" #include "common/ceph_crypto.h" -#include "common/code_environment.h" -#include "common/common_init.h" #include "common/config.h" #include "common/debug.h" #include "common/errno.h" #include "common/safe_io.h" #include "common/version.h" -#include "include/color.h" -#include <errno.h> -#include <deque> +#include "common_init.h" #define dout_subsys ceph_subsys_ diff --git a/src/common/config.cc b/src/common/config.cc index 0e86b792ae9..aa0f0adb15a 100644 --- a/src/common/config.cc +++ b/src/common/config.cc @@ -11,29 +11,28 @@ * Foundation. See file COPYING. * */ +#include "include/types.h" -#include "auth/Auth.h" -#include "common/ConfUtils.h" +#include <errno.h> +#include <sstream> +#include <stdlib.h> +#include <string.h> +#include <sys/stat.h> +#include <sys/types.h> + +#include "include/str_list.h" +#include "include/stringify.h" +#include "include/assert.h" #include "common/ceph_argparse.h" #include "common/common_init.h" -#include "common/config.h" #include "common/static_assert.h" #include "common/strtol.h" #include "common/version.h" -#include "include/str_list.h" -#include "include/types.h" -#include "include/stringify.h" +#include "auth/Auth.h" #include "msg/msg_types.h" #include "osd/osd_types.h" -#include "include/assert.h" - -#include <errno.h> -#include <sstream> -#include <stdlib.h> -#include <string.h> -#include <sys/stat.h> -#include <sys/types.h> +#include "config.h" /* Don't use standard Ceph logging in this file. * We can't use logging until it's initialized, and a lot of the necessary diff --git a/src/common/config.h b/src/common/config.h index 86d240f4ce6..e735e030ccf 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -17,6 +17,8 @@ extern struct ceph_file_layout g_default_file_layout; +#include "msg/msg_types.h" + #include <iosfwd> #include <vector> #include <map> @@ -25,9 +27,8 @@ extern struct ceph_file_layout g_default_file_layout; #include "common/ConfUtils.h" #include "common/entity_name.h" #include "common/Mutex.h" -#include "log/SubsystemMap.h" #include "common/config_obs.h" -#include "msg/msg_types.h" +#include "log/SubsystemMap.h" #define OSD_REP_PRIMARY 0 #define OSD_REP_SPLAY 1 diff --git a/src/common/debug.cc b/src/common/debug.cc index 4bbbfc8fc23..afa2192e8c1 100644 --- a/src/common/debug.cc +++ b/src/common/debug.cc @@ -1,4 +1,3 @@ - #include <iostream> void dout_emergency(const char * const str) diff --git a/src/common/debug.h b/src/common/debug.h index bf59ec0d21c..0960b760e95 100644 --- a/src/common/debug.h +++ b/src/common/debug.h @@ -16,17 +16,17 @@ #ifndef CEPH_DOUT_H #define CEPH_DOUT_H -#include "common/config.h" -#include "common/likely.h" -#include "common/Clock.h" -#include "log/Log.h" -#include "include/assert.h" - #include <iostream> #include <pthread.h> #include <streambuf> #include <sstream> +#include "include/assert.h" +#include "common/config.h" +#include "common/likely.h" +#include "common/Clock.h" +#include "log/Log.h" + extern void dout_emergency(const char * const str); extern void dout_emergency(const std::string &str); diff --git a/src/common/entity_name.cc b/src/common/entity_name.cc index 2e0b0cb1d9e..a551f33e4c0 100644 --- a/src/common/entity_name.cc +++ b/src/common/entity_name.cc @@ -11,13 +11,14 @@ * Foundation. See file COPYING. * */ - -#include "common/entity_name.h" -#include "include/msgr.h" +#include "include/types.h" #include <errno.h> #include <sstream> -#include <string> + +#include "include/msgr.h" + +#include "entity_name.h" using std::string; diff --git a/src/common/entity_name.h b/src/common/entity_name.h index 550bf1dedc6..f58d02ff84e 100644 --- a/src/common/entity_name.h +++ b/src/common/entity_name.h @@ -15,13 +15,14 @@ #ifndef CEPH_COMMON_ENTITY_NAME_H #define CEPH_COMMON_ENTITY_NAME_H +#include "msg/msg_types.h" + #include <iosfwd> #include <stdint.h> #include <string> #include "include/encoding.h" #include "include/buffer.h" -#include "msg/msg_types.h" /* Represents a Ceph entity name. * diff --git a/src/common/environment.cc b/src/common/environment.cc index a71bb34665f..5e6c28c8636 100644 --- a/src/common/environment.cc +++ b/src/common/environment.cc @@ -12,11 +12,11 @@ * */ -#include "common/environment.h" - #include <stdlib.h> #include <strings.h> +#include "environment.h" + bool get_env_bool(const char *key) { const char *val = getenv(key); diff --git a/src/common/errno.cc b/src/common/errno.cc index a981ab7119a..86dec1c1adf 100644 --- a/src/common/errno.cc +++ b/src/common/errno.cc @@ -1,9 +1,8 @@ -#include "common/errno.h" - #include <sstream> -#include <string> #include <string.h> +#include "errno.h" + std::string cpp_strerror(int err) { char buf[128]; diff --git a/src/common/escape.c b/src/common/escape.c index 585961e02a1..30e202c1968 100644 --- a/src/common/escape.c +++ b/src/common/escape.c @@ -12,11 +12,11 @@ * */ -#include "common/escape.h" - #include <stdio.h> #include <string.h> +#include "escape.h" + /* * Some functions for escaping RGW responses */ diff --git a/src/common/fd.cc b/src/common/fd.cc index 547e0f8e27b..35ae5f89f66 100644 --- a/src/common/fd.cc +++ b/src/common/fd.cc @@ -12,15 +12,15 @@ * */ -#include "fd.h" - #include <sys/types.h> #include <unistd.h> #include <dirent.h> #include <errno.h> -#include "debug.h" -#include "errno.h" +#include "common/debug.h" +#include "common/errno.h" + +#include "fd.h" void dump_open_fds(CephContext *cct) { diff --git a/src/common/fiemap.cc b/src/common/fiemap.cc index 0df12d6e8fd..46d45286737 100644 --- a/src/common/fiemap.cc +++ b/src/common/fiemap.cc @@ -34,6 +34,7 @@ #if defined(__linux__) #include <linux/fs.h> #endif + #include "include/inttypes.h" #include "include/fiemap.h" diff --git a/src/common/hex.cc b/src/common/hex.cc index 24ba6724e87..3b6544c5053 100644 --- a/src/common/hex.cc +++ b/src/common/hex.cc @@ -12,11 +12,11 @@ * */ +#include <stdio.h> + #include "common/debug.h" -#include "common/hex.h" -#include <stdio.h> -#include <string> +#include "hex.h" void hex2str(const char *s, int len, char *buf, int dest_len) { diff --git a/src/common/ipaddr.cc b/src/common/ipaddr.cc index 253a7c67de7..b9cc8c8e60d 100644 --- a/src/common/ipaddr.cc +++ b/src/common/ipaddr.cc @@ -1,9 +1,9 @@ -#include "include/ipaddr.h" #include <arpa/inet.h> #include <stdlib.h> #include <string.h> +#include "include/ipaddr.h" static void netmask_ipv4(const struct in_addr *addr, unsigned int prefix_len, diff --git a/src/common/lockdep.cc b/src/common/lockdep.cc index 44303709a9e..91d3963894e 100644 --- a/src/common/lockdep.cc +++ b/src/common/lockdep.cc @@ -11,14 +11,17 @@ * Foundation. See file COPYING. * */ -#include "BackTrace.h" -#include "Clock.h" +#include "include/types.h" + +#include <ext/hash_map> + +#include "common/BackTrace.h" +#include "common/Clock.h" #include "common/debug.h" #include "common/environment.h" -#include "include/types.h" + #include "lockdep.h" -#include <ext/hash_map> #if defined(__FreeBSD__) && defined(__LP64__) // On FreeBSD pthread_t is a pointer. namespace __gnu_cxx { diff --git a/src/common/mime.c b/src/common/mime.c index 90c19a7684e..3453a0ab8d6 100644 --- a/src/common/mime.c +++ b/src/common/mime.c @@ -11,12 +11,12 @@ * Foundation. See file COPYING. * */ -#include "common/utf8.h" - #include <errno.h> #include <stdio.h> #include <string.h> +#include "common/utf8.h" + int mime_encode_as_qp(const char *input, char *output, int outlen) { int ret = 1; diff --git a/src/common/obj_bencher.cc b/src/common/obj_bencher.cc index aa7dcfcbbe5..f8fc0a992eb 100644 --- a/src/common/obj_bencher.cc +++ b/src/common/obj_bencher.cc @@ -14,19 +14,16 @@ * try and bench on a pool you don't have permission to access * it will just loop forever. */ -#include "common/Cond.h" -#include "global/global_context.h" -#include "obj_bencher.h" - #include <iostream> #include <fstream> - #include <cerrno> - #include <stdlib.h> #include <time.h> #include <sstream> +#include "global/global_context.h" + +#include "obj_bencher.h" const std::string BENCH_LASTRUN_METADATA = "benchmark_last_metadata"; const std::string BENCH_PREFIX = "benchmark_data"; diff --git a/src/common/perf_counters.cc b/src/common/perf_counters.cc index 306ccf430c1..7b580580a64 100644 --- a/src/common/perf_counters.cc +++ b/src/common/perf_counters.cc @@ -11,18 +11,16 @@ * Foundation. See file COPYING. * */ - -#include "common/perf_counters.h" -#include "common/debug.h" -#include "common/errno.h" - -#include <errno.h> #include <inttypes.h> +#include <errno.h> #include <map> #include <sstream> -#include <stdint.h> #include <string.h> -#include <string> + +#include "common/debug.h" +#include "common/errno.h" + +#include "perf_counters.h" using std::ostringstream; diff --git a/src/common/perf_counters.h b/src/common/perf_counters.h index 269a32f2c46..88e8ef45974 100644 --- a/src/common/perf_counters.h +++ b/src/common/perf_counters.h @@ -16,15 +16,15 @@ #ifndef CEPH_COMMON_PERF_COUNTERS_H #define CEPH_COMMON_PERF_COUNTERS_H -#include "common/config_obs.h" -#include "common/Mutex.h" -#include "include/buffer.h" -#include "include/utime.h" - #include <stdint.h> #include <string> #include <vector> +#include "include/buffer.h" +#include "include/utime.h" +#include "common/config_obs.h" +#include "common/Mutex.h" + class CephContext; class PerfCountersBuilder; class PerfCountersCollectionTest; diff --git a/src/common/pick_address.cc b/src/common/pick_address.cc index 38a5751c042..de436517696 100644 --- a/src/common/pick_address.cc +++ b/src/common/pick_address.cc @@ -12,8 +12,6 @@ * */ -#include "common/pick_address.h" - #include <netdb.h> #include <errno.h> @@ -22,6 +20,8 @@ #include "common/debug.h" #include "common/errno.h" +#include "pick_address.h" + #define dout_subsys ceph_subsys_ static const struct sockaddr *find_ip_in_subnet_list(CephContext *cct, diff --git a/src/common/pipe.c b/src/common/pipe.c index 9c01b322f89..7ee7c213679 100644 --- a/src/common/pipe.c +++ b/src/common/pipe.c @@ -12,12 +12,12 @@ * */ -#include "common/pipe.h" - #include <errno.h> #include <fcntl.h> #include <unistd.h> +#include "pipe.h" + int pipe_cloexec(int pipefd[2]) { #if defined(O_CLOEXEC) && !defined(__FreeBSD__) diff --git a/src/common/run_cmd.cc b/src/common/run_cmd.cc index 5f5cc3cca32..ab30bbeb8d1 100644 --- a/src/common/run_cmd.cc +++ b/src/common/run_cmd.cc @@ -12,8 +12,6 @@ * */ -#include "common/errno.h" - #include <errno.h> #include <sstream> #include <stdarg.h> @@ -23,6 +21,8 @@ #include <unistd.h> #include <vector> +#include "common/errno.h" + using std::ostringstream; std::string run_cmd(const char *cmd, ...) diff --git a/src/common/safe_io.c b/src/common/safe_io.c index a7be648ebf4..c896a3274f6 100644 --- a/src/common/safe_io.c +++ b/src/common/safe_io.c @@ -17,7 +17,7 @@ #include <unistd.h> #include <errno.h> -#include "common/safe_io.h" +#include "safe_io.h" ssize_t safe_read(int fd, void *buf, size_t count) { diff --git a/src/common/shared_cache.hpp b/src/common/shared_cache.hpp index 9f912df61f0..7ee80df891e 100644 --- a/src/common/shared_cache.hpp +++ b/src/common/shared_cache.hpp @@ -19,6 +19,7 @@ #include <list> #include <memory> #include <utility> + #include "common/Mutex.h" #include "common/Cond.h" diff --git a/src/common/sharedptr_registry.hpp b/src/common/sharedptr_registry.hpp index bd0c656024d..ee7cdad2785 100644 --- a/src/common/sharedptr_registry.hpp +++ b/src/common/sharedptr_registry.hpp @@ -17,6 +17,7 @@ #include <map> #include <memory> + #include "common/Mutex.h" #include "common/Cond.h" diff --git a/src/common/signal.cc b/src/common/signal.cc index 406ff463567..9d062636904 100644 --- a/src/common/signal.cc +++ b/src/common/signal.cc @@ -12,18 +12,18 @@ * */ +#include <sstream> +#include <stdlib.h> +#include <sys/stat.h> +#include <sys/types.h> + #include "common/BackTrace.h" #include "common/perf_counters.h" -#include "global/pidfile.h" #include "common/debug.h" -#include "common/signal.h" #include "common/config.h" +#include "global/pidfile.h" -#include <signal.h> -#include <sstream> -#include <stdlib.h> -#include <sys/stat.h> -#include <sys/types.h> +#include "signal.h" std::string signal_mask_to_str() { diff --git a/src/common/simple_cache.hpp b/src/common/simple_cache.hpp index 60919fd9731..b1e2a9e33d7 100644 --- a/src/common/simple_cache.hpp +++ b/src/common/simple_cache.hpp @@ -18,6 +18,7 @@ #include <map> #include <list> #include <memory> + #include "common/Mutex.h" #include "common/Cond.h" diff --git a/src/common/simple_spin.cc b/src/common/simple_spin.cc index fc4ac633dea..579a0a14b7b 100644 --- a/src/common/simple_spin.cc +++ b/src/common/simple_spin.cc @@ -12,12 +12,11 @@ * */ -#include "common/simple_spin.h" - #include <stdio.h> -#include <stdint.h> #include <pthread.h> +#include "simple_spin.h" + static uint32_t bar = 13; static uint32_t *foo = &bar; diff --git a/src/common/snap_types.cc b/src/common/snap_types.cc index 6b65d7cbea2..da5bae7df0f 100644 --- a/src/common/snap_types.cc +++ b/src/common/snap_types.cc @@ -1,6 +1,6 @@ +#include "common/Formatter.h" #include "snap_types.h" -#include "common/Formatter.h" void SnapRealmInfo::encode(bufferlist& bl) const { diff --git a/src/common/utf8.c b/src/common/utf8.c index d8e08539198..ab6d700f5fd 100644 --- a/src/common/utf8.c +++ b/src/common/utf8.c @@ -11,11 +11,11 @@ * Foundation. See file COPYING. * */ -#include "common/utf8.h" - #include <stdio.h> #include <string.h> +#include "utf8.h" + #define MAX_UTF8_SZ 6 #define INVALID_UTF8_CHAR 0xfffffffful diff --git a/src/common/version.cc b/src/common/version.cc index 0ca569e9c56..19bb046d25e 100644 --- a/src/common/version.cc +++ b/src/common/version.cc @@ -13,11 +13,12 @@ */ #include "acconfig.h" -#include "ceph_ver.h" -#include "common/version.h" #include <sstream> -#include <string> + +#include "ceph_ver.h" + +#include "version.h" #define _STR(x) #x #define STRINGIFY(x) _STR(x) diff --git a/src/common/xattr.c b/src/common/xattr.c index 239ee02db42..44f84543eae 100644 --- a/src/common/xattr.c +++ b/src/common/xattr.c @@ -25,7 +25,7 @@ #error "Your system is not supported!" #endif -#include "common/xattr.h" +#include "xattr.h" /* * Sets extended attribute on a file. |