Skip to content

Commit d5792f0

Browse files
authored
Merge pull request ceph#50821 from cbodley/wip-cmake-uring
cmake: fix WITH_SYSTEM_LIBURING and make uring available outside of src/blk Reviewed-by: Ilya Dryomov <[email protected]>
2 parents 10bfd7d + fea2618 commit d5792f0

38 files changed

+115
-59
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,8 @@ if(WITH_LIBURING)
263263
include(Builduring)
264264
build_uring()
265265
endif()
266+
# enable uring in boost::asio
267+
add_compile_definitions("BOOST_ASIO_HAS_IO_URING")
266268
endif()
267269

268270
CMAKE_DEPENDENT_OPTION(WITH_BLUESTORE_PMEM "Enable PMDK libraries" OFF

cmake/modules/Finduring.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# uring_FOUND - True if uring found.
66

77
find_path(URING_INCLUDE_DIR liburing.h)
8-
find_library(URING_LIBRARIES liburing.a liburing)
8+
find_library(URING_LIBRARIES uring)
99

1010
include(FindPackageHandleStandardArgs)
1111
find_package_handle_standard_args(uring DEFAULT_MSG URING_LIBRARIES URING_INCLUDE_DIR)

src/common/Graylog.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
#ifndef __CEPH_LOG_GRAYLOG_H
55
#define __CEPH_LOG_GRAYLOG_H
66

7-
#include <boost/asio.hpp>
7+
#include <boost/asio/io_context.hpp>
8+
#include <boost/asio/ip/udp.hpp>
89
#include <boost/iostreams/filtering_stream.hpp>
910
#include <boost/iostreams/filter/zlib.hpp>
1011

@@ -66,7 +67,7 @@ class Graylog
6667
std::string m_logger;
6768

6869
boost::asio::ip::udp::endpoint m_endpoint;
69-
boost::asio::io_service m_io_service;
70+
boost::asio::io_context m_io_service;
7071

7172
std::unique_ptr<Formatter> m_formatter;
7273
std::unique_ptr<Formatter> m_formatter_section;

src/common/async/bind_handler.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
#define CEPH_ASYNC_BIND_HANDLER_H
1717

1818
#include <tuple>
19-
#include <boost/asio.hpp>
19+
#include <boost/asio/associated_allocator.hpp>
20+
#include <boost/asio/associated_executor.hpp>
2021

2122
namespace ceph::async {
2223

src/common/async/completion.h

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

1818
#include <memory>
1919

20+
#include <boost/asio/executor_work_guard.hpp>
21+
2022
#include "bind_handler.h"
2123
#include "forward_handler.h"
2224

src/common/async/forward_handler.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
#ifndef CEPH_ASYNC_FORWARD_HANDLER_H
1616
#define CEPH_ASYNC_FORWARD_HANDLER_H
1717

18-
#include <boost/asio.hpp>
18+
#include <boost/asio/associated_allocator.hpp>
19+
#include <boost/asio/associated_executor.hpp>
1920

2021
namespace ceph::async {
2122

src/common/error_code.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include <exception>
1717

18+
#include <boost/asio/error.hpp>
1819
#include "common/error_code.h"
1920

2021
#pragma GCC diagnostic push

src/common/error_code.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818

1919
#include <netdb.h>
2020

21-
#include <boost/system/error_code.hpp>
22-
#include <boost/asio.hpp>
21+
#include <boost/system.hpp>
2322

2423
#pragma GCC diagnostic push
2524
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"

src/common/pick_address.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
#include <bitset>
1818
#include <netdb.h>
1919
#include <netinet/in.h>
20+
#ifdef _WIN32
21+
#include <ws2ipdef.h>
22+
#else
23+
#include <arpa/inet.h> // inet_pton()
24+
#include <net/if.h> // IFF_UP
25+
#endif
2026
#include <string>
2127
#include <string.h>
2228
#include <vector>

src/exporter/DaemonMetricCollector.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "DaemonMetricCollector.h"
22

3+
#include <boost/asio/io_context.hpp>
34
#include <boost/json/src.hpp>
45
#include <chrono>
56
#include <filesystem>
@@ -43,7 +44,7 @@ void DaemonMetricCollector::request_loop(boost::asio::steady_timer &timer) {
4344
void DaemonMetricCollector::main() {
4445
// time to wait before sending requests again
4546

46-
boost::asio::io_service io;
47+
boost::asio::io_context io;
4748
boost::asio::steady_timer timer{io, std::chrono::seconds(0)};
4849
request_loop(timer);
4950
io.run();

0 commit comments

Comments
 (0)