]>
Commit | Line | Data |
---|---|---|
9f95a23c TL |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab | |
3 | ||
4 | #pragma once | |
5 | ||
6 | #include "acconfig.h" | |
7 | ||
8 | #include "include/types.h" | |
9 | #include "ceph_aio.h" | |
10 | ||
11 | struct ioring_data; | |
12 | ||
13 | struct ioring_queue_t final : public io_queue_t { | |
14 | std::unique_ptr<ioring_data> d; | |
15 | unsigned iodepth = 0; | |
16 | ||
17 | typedef std::list<aio_t>::iterator aio_iter; | |
18 | ||
19 | // Returns true if arch is x86-64 and kernel supports io_uring | |
20 | static bool supported(); | |
21 | ||
22 | ioring_queue_t(unsigned iodepth_); | |
23 | ~ioring_queue_t() final; | |
24 | ||
25 | int init(std::vector<int> &fds) final; | |
26 | void shutdown() final; | |
27 | ||
28 | int submit_batch(aio_iter begin, aio_iter end, uint16_t aios_size, | |
29 | void *priv, int *retries) final; | |
30 | int get_next_completed(int timeout_ms, aio_t **paio, int max) final; | |
31 | }; |