mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 16:22:35 +01:00
ircd::fs::aio: Move ring struct into system::.
This commit is contained in:
parent
55241c5309
commit
1e900217ee
2 changed files with 21 additions and 19 deletions
|
@ -413,12 +413,12 @@ try
|
|||
{
|
||||
syscall<SYS_io_setup>(this->max_events(), &idp);
|
||||
|
||||
const aio_ring *const ring
|
||||
const system::ring *const ring
|
||||
{
|
||||
reinterpret_cast<const aio_ring *>(idp)
|
||||
reinterpret_cast<const system::ring *>(idp)
|
||||
};
|
||||
|
||||
assert(ring->magic == aio_ring::MAGIC);
|
||||
assert(ring->magic == ring::MAGIC);
|
||||
|
||||
log::debug
|
||||
{
|
||||
|
|
|
@ -23,26 +23,12 @@ namespace ircd::fs::aio
|
|||
void fsync(const fd &, const sync_opts &);
|
||||
}
|
||||
|
||||
struct aio_ring
|
||||
{
|
||||
static constexpr uint MAGIC {0xa10a10a1};
|
||||
|
||||
uint id; // kernel internal index number
|
||||
uint nr; // number of io_events
|
||||
uint head;
|
||||
uint tail;
|
||||
uint magic;
|
||||
uint compat_features;
|
||||
uint incompat_features;
|
||||
uint header_length; // size of aio_ring
|
||||
struct io_event io_events[0];
|
||||
};
|
||||
// 128 bytes + ring size
|
||||
|
||||
/// AIO context instance from the system. Right now this is a singleton with
|
||||
/// an extern instance pointer at fs::aio::context maintained by fs::aio::init.
|
||||
struct ircd::fs::aio::system
|
||||
{
|
||||
struct ring;
|
||||
|
||||
static const int eventfd_flags;
|
||||
|
||||
/// io_getevents vector (in)
|
||||
|
@ -98,6 +84,22 @@ struct ircd::fs::aio::system
|
|||
~system() noexcept;
|
||||
};
|
||||
|
||||
struct ircd::fs::aio::system::ring
|
||||
{
|
||||
static constexpr uint MAGIC {0xA10A10A1};
|
||||
|
||||
uint id; // kernel internal index number
|
||||
uint nr; // number of io_events
|
||||
uint head;
|
||||
uint tail;
|
||||
uint magic;
|
||||
uint compat_features;
|
||||
uint incompat_features;
|
||||
uint header_length; // size of aio_ring
|
||||
struct io_event io_events[0];
|
||||
};
|
||||
// 128 bytes + ring size
|
||||
|
||||
/// Generic request control block.
|
||||
struct ircd::fs::aio::request
|
||||
:iocb
|
||||
|
|
Loading…
Reference in a new issue