blob: e7d0acde0134723691c6c28e613660e2ea15a5f6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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;
};
|