diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
commit | e6918187568dbd01842d8d1d2c808ce16a894239 (patch) | |
tree | 64f88b554b444a49f656b6c656111a145cbbaa28 /src/blk/kernel/io_uring.h | |
parent | Initial commit. (diff) | |
download | ceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip |
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/blk/kernel/io_uring.h')
-rw-r--r-- | src/blk/kernel/io_uring.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/blk/kernel/io_uring.h b/src/blk/kernel/io_uring.h new file mode 100644 index 000000000..e7d0acde0 --- /dev/null +++ b/src/blk/kernel/io_uring.h @@ -0,0 +1,33 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + +#pragma once + +#include "acconfig.h" + +#include "include/types.h" +#include "aio/aio.h" + +struct ioring_data; + +struct ioring_queue_t final : public io_queue_t { + std::unique_ptr<ioring_data> d; + unsigned iodepth = 0; + bool hipri = false; + bool sq_thread = false; + + typedef std::list<aio_t>::iterator aio_iter; + + // Returns true if arch is x86-64 and kernel supports io_uring + static bool supported(); + + ioring_queue_t(unsigned iodepth_, bool hipri_, bool sq_thread_); + ~ioring_queue_t() final; + + int init(std::vector<int> &fds) final; + void shutdown() final; + + int submit_batch(aio_iter begin, aio_iter end, uint16_t aios_size, + void *priv, int *retries) final; + int get_next_completed(int timeout_ms, aio_t **paio, int max) final; +}; |