]> git.proxmox.com Git - ceph.git/blame - ceph/src/blk/kernel/io_uring.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / blk / kernel / io_uring.h
CommitLineData
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"
f67539c2 9#include "aio/aio.h"
9f95a23c
TL
10
11struct ioring_data;
12
13struct ioring_queue_t final : public io_queue_t {
14 std::unique_ptr<ioring_data> d;
15 unsigned iodepth = 0;
f67539c2
TL
16 bool hipri = false;
17 bool sq_thread = false;
9f95a23c
TL
18
19 typedef std::list<aio_t>::iterator aio_iter;
20
21 // Returns true if arch is x86-64 and kernel supports io_uring
22 static bool supported();
23
f67539c2 24 ioring_queue_t(unsigned iodepth_, bool hipri_, bool sq_thread_);
9f95a23c
TL
25 ~ioring_queue_t() final;
26
27 int init(std::vector<int> &fds) final;
28 void shutdown() final;
29
30 int submit_batch(aio_iter begin, aio_iter end, uint16_t aios_size,
31 void *priv, int *retries) final;
32 int get_next_completed(int timeout_ms, aio_t **paio, int max) final;
33};