Skip to content

Commit afcfc4a

Browse files
authored
Merge pull request ceph#61001 from MaxKellermann/common_includes
common: add missing includes Reviewed-by: Adam Emerson <[email protected]>
2 parents 1725f59 + 19ce2c6 commit afcfc4a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+192
-32
lines changed

src/common/EventTrace.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#include "common/TracepointProvider.h"
2020
#include "messages/MOSDOpReply.h"
2121

22+
#include <sstream>
23+
2224
#ifdef WITH_LTTNG
2325
#define TRACEPOINT_DEFINE
2426
#define TRACEPOINT_PROBE_DYNAMIC_LINKAGE

src/common/Finisher.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33

44
#include "Finisher.h"
55
#include "common/perf_counters.h"
6+
#include "include/types.h" // for operator<<(std::vector)
7+
8+
#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
9+
#include "crimson/common/perf_counters_collection.h"
10+
#else
11+
#include "common/perf_counters_collection.h"
12+
#endif
613

714
#include <fmt/core.h>
815

src/common/Finisher.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "common/Thread.h"
2121
#include "common/ceph_mutex.h"
2222
#include "common/Cond.h"
23+
#include "common/perf_counters.h" // for class PerfCounters
2324

2425
/// Finisher queue length performance counter ID.
2526
enum {

src/common/Graylog.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
#include "include/ceph_assert.h" // boost clobbers this
1313

14+
#include <sstream>
15+
1416
struct uuid_d;
1517
class LogEntry;
1618

src/common/LogClient.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include "mon/MonMap.h"
2121
#include "common/Graylog.h"
2222

23+
#include <sstream>
24+
2325
#define dout_subsys ceph_subsys_monc
2426

2527
using std::map;

src/common/LogClient.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
#define CEPH_LOGCLIENT_H
1717

1818
#include <atomic>
19+
#include <deque>
20+
#include <map>
21+
#include <string>
22+
1923
#include "common/LogEntry.h"
2024
#include "common/ceph_mutex.h"
2125
#include "common/ostream_temp.h"

src/common/LogEntry.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
#include <fmt/format.h>
1919

20+
#include "include/types.h" // for version_t
21+
#include "include/unordered_set.h"
2022
#include "include/utime.h"
2123
#include "include/utime_fmt.h"
2224
#include "msg/msg_fmt.h"
@@ -25,6 +27,12 @@
2527
#include "ostream_temp.h"
2628
#include "LRUSet.h"
2729

30+
#include <cstdint>
31+
#include <iostream>
32+
#include <list>
33+
#include <map>
34+
#include <string>
35+
2836
namespace ceph {
2937
class Formatter;
3038
}

src/common/OutputDataSocket.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
*
1313
*/
1414

15+
#include "common/OutputDataSocket.h"
16+
1517
#include <poll.h>
1618
#include <sys/un.h>
1719
#include <unistd.h>
1820

19-
#include "common/OutputDataSocket.h"
2021
#include "common/errno.h"
2122
#include "common/debug.h"
2223
#include "common/safe_io.h"
@@ -26,6 +27,8 @@
2627
// re-include our assert to clobber the system one; fix dout:
2728
#include "include/ceph_assert.h"
2829

30+
#include <sstream>
31+
2932
#define dout_subsys ceph_subsys_asok
3033
#undef dout_prefix
3134
#define dout_prefix *_dout << "asok(" << (void*)m_cct << ") "

src/common/OutputDataSocket.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include "include/common_fwd.h"
2121
#include "include/buffer.h"
2222

23+
#include <string>
24+
#include <vector>
2325

2426
class OutputDataSocket : public Thread
2527
{

src/common/Throttle.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
22
// vim: ts=8 sw=2 smarttab
33

4+
#include "common/Throttle.h"
5+
46
#include "include/scope_guard.h"
57

6-
#include "common/Throttle.h"
78
#include "common/ceph_time.h"
89
#include "common/perf_counters.h"
910

src/common/Throttle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include <atomic>
88
#include <chrono>
9+
#include <condition_variable>
910
#include <iosfwd>
1011
#include <list>
1112
#include <map>
@@ -14,7 +15,6 @@
1415
#include "include/Context.h"
1516
#include "common/ThrottleInterface.h"
1617
#include "common/Timer.h"
17-
#include "common/convenience.h"
1818
#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
1919
#include "crimson/common/perf_counters_collection.h"
2020
#else

src/common/TrackedOp.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
#include "TrackedOp.h"
1414

15+
#include <shared_mutex> // for std::shared_lock
16+
#include <sstream>
17+
1518
#define dout_context cct
1619
#define dout_subsys ceph_subsys_optracker
1720
#undef dout_prefix

src/common/TrackedOp.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,18 @@
1818
#include "common/StackStringStream.h"
1919
#include "common/ceph_mutex.h"
2020
#include "common/histogram.h"
21+
#include "common/perf_counters.h" // for class PerfCountersBuilder
2122
#include "common/Thread.h"
2223
#include "common/Clock.h"
2324
#include "include/spinlock.h"
2425
#include "msg/Message.h"
2526

27+
#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
28+
#include "crimson/common/perf_counters_collection.h"
29+
#else
30+
#include "common/perf_counters_collection.h"
31+
#endif
32+
2633
#define OPTRACKER_PREALLOC_EVENTS 20
2734

2835
class TrackedOp;

src/common/WorkQueue.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include "include/compat.h"
1717
#include "common/errno.h"
1818

19+
#include <sstream>
20+
1921
#define dout_subsys ceph_subsys_tp
2022
#undef dout_prefix
2123
#define dout_prefix *_dout << name << " "

src/common/admin_finisher.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
#include <functional>
1717
#include <string_view>
1818

19-
#include "include/buffer.h"
19+
#include "include/buffer_fwd.h"
2020

2121
typedef std::function<void(int,std::string_view,ceph::buffer::list&)> asok_finisher;

src/common/admin_socket.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
* Foundation. See file COPYING.
1212
*
1313
*/
14+
15+
#include "common/admin_socket.h"
16+
1417
#include <poll.h>
1518
#include <signal.h>
1619
#include <sys/un.h>
@@ -19,11 +22,11 @@
1922
#include <sys/wait.h>
2023
#endif
2124

25+
#include <iomanip>
2226
#include <optional>
2327

2428
#include <stdlib.h>
2529

26-
#include "common/admin_socket.h"
2730
#include "common/admin_socket_client.h"
2831
#include "common/dout.h"
2932
#include "common/errno.h"
@@ -47,6 +50,10 @@
4750
#include "include/sock_compat.h"
4851
#include "fmt/format.h"
4952

53+
#ifdef _WIN32
54+
#include "include/util.h" // for get_windows_version()
55+
#endif
56+
5057
#define dout_subsys ceph_subsys_asok
5158
#undef dout_prefix
5259
#define dout_prefix *_dout << "asok(" << (void*)m_cct << ") "

src/common/admin_socket.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
#else
2121

2222
#include <condition_variable>
23+
#include <list>
2324
#include <mutex>
25+
#include <sstream>
2426
#include <string>
2527
#include <string_view>
2628
#include <thread>
@@ -31,6 +33,10 @@
3133
#include "common/ref.h"
3234
#include "common/cmdparse.h"
3335

36+
#ifdef WIN32
37+
#include "include/win32/fs_compat.h" // for uid_t, gid_t
38+
#endif
39+
3440
class MCommand;
3541
class MMonCommand;
3642

src/common/admin_socket_client.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
*
1313
*/
1414

15+
#include "common/admin_socket_client.h"
16+
1517
#include <arpa/inet.h>
1618
#include <fcntl.h>
1719
#include <sys/socket.h>
@@ -21,11 +23,12 @@
2123
#include "common/admin_socket.h"
2224
#include "common/errno.h"
2325
#include "common/safe_io.h"
24-
#include "common/admin_socket_client.h"
2526

2627
#include "include/compat.h"
2728
#include "include/sock_compat.h"
2829

30+
#include <sstream>
31+
2932
using std::ostringstream;
3033

3134
const char* get_rand_socket_path()

src/common/assert.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,17 @@
1212
*
1313
*/
1414

15+
#include "include/ceph_assert.h"
16+
17+
#include <sstream>
18+
1519
#include "include/compat.h"
20+
#include "common/BackTrace.h"
21+
#include "common/Clock.h" // for ceph_clock_now()
1622
#include "common/debug.h"
23+
#include "log/Log.h"
24+
25+
#include <stdarg.h>
1726

1827
using std::ostringstream;
1928

src/common/bit_str.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#include "common/Formatter.h"
1616
#include "include/ceph_assert.h"
1717

18+
#include <iostream>
19+
1820
static void _dump_bit_str(
1921
uint64_t bits,
2022
std::ostream *out,

src/common/buffer.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919

2020
#include <sys/uio.h>
2121

22+
#include <iomanip> // for std::setw()
2223
#include <iostream>
24+
#include <sstream>
2325

2426
#include "include/ceph_assert.h"
2527
#include "include/types.h"

src/common/ceph_argparse.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,18 @@
1111
* Foundation. See file COPYING.
1212
*
1313
*/
14+
#include "common/ceph_argparse.h"
15+
1416
#include <stdarg.h>
1517

1618
#include "auth/Auth.h"
17-
#include "common/ceph_argparse.h"
1819
#include "common/config.h"
1920
#include "common/strtol.h" // for strict_strtof()
2021
#include "common/version.h"
2122
#include "include/str_list.h"
2223

24+
#include <sstream>
25+
2326
/*
2427
* Ceph argument parsing library
2528
*

src/common/ceph_argparse.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@
2323
* stuff to live.
2424
*/
2525

26+
#include <iosfwd>
2627
#include <string>
2728
#include <vector>
2829

2930
#include "common/entity_name.h"
3031
#include "include/encoding.h"
32+
#include "msg/msg_types.h" // for struct entity_addr_t
3133

3234
class entity_addrvec_t;
3335

src/common/ceph_json.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
#ifndef CEPH_JSON_H
22
#define CEPH_JSON_H
33

4+
#include <deque>
5+
#include <map>
6+
#include <set>
47
#include <stdexcept>
8+
#include <string>
59
#include <typeindex>
610
#include <include/types.h>
711
#include <boost/container/flat_map.hpp>
812
#include <boost/container/flat_set.hpp>
13+
#include <boost/optional.hpp>
914
#include <include/ceph_fs.h>
1015
#include "common/ceph_time.h"
1116

src/common/ceph_time.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
#include "config.h"
2323
#include "strtol.h"
2424

25+
#include <iomanip> // for std::setw()
26+
#include <sstream>
27+
2528
#if defined(__APPLE__)
2629
#include <mach/mach.h>
2730
#include <mach/mach_time.h>

src/common/common_init.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
*
1313
*/
1414

15-
#include "include/compat.h"
1615
#include "common/common_init.h"
1716
#include "common/admin_socket.h"
1817
#include "common/ceph_argparse.h"
@@ -23,6 +22,8 @@
2322
#include "common/strtol.h"
2423
#include "common/valgrind.h"
2524
#include "common/zipkin_trace.h"
25+
#include "include/compat.h"
26+
#include "log/Log.h"
2627

2728
#define dout_subsys ceph_subsys_
2829

src/common/common_init.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
#ifndef CEPH_COMMON_INIT_H
1616
#define CEPH_COMMON_INIT_H
1717

18-
#include <deque>
19-
2018
#include "include/common_fwd.h"
2119
#include "common/code_environment.h"
2220

21+
#include <string>
22+
2323
enum common_init_flags_t {
2424
// Set up defaults that make sense for an unprivileged daemon
2525
CINIT_FLAG_UNPRIVILEGED_DAEMON_DEFAULTS = 0x1,

0 commit comments

Comments
 (0)