0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 16:22:35 +01:00

ircd::aio: Add a reference to the fs opts structure for the request.

This commit is contained in:
Jason Volk 2018-12-26 15:40:22 -08:00
parent 528dff78ff
commit 7a9d70f15d
2 changed files with 14 additions and 1 deletions

View file

@ -94,6 +94,8 @@ ircd::fs::aio::request::fsync::fsync(const int &fd,
const sync_opts &opts)
:request{fd}
{
sopts = &opts;
aio_reqprio = reqprio(opts.priority);
aio_lio_opcode = IOCB_CMD_FSYNC;
@ -122,6 +124,8 @@ ircd::fs::aio::request::fdsync::fdsync(const int &fd,
const sync_opts &opts)
:request{fd}
{
sopts = &opts;
aio_reqprio = reqprio(opts.priority);
aio_lio_opcode = IOCB_CMD_FDSYNC;
@ -151,6 +155,8 @@ ircd::fs::aio::request::read::read(const int &fd,
const read_opts &opts)
:request{fd}
{
ropts = &opts;
aio_reqprio = reqprio(opts.priority);
aio_lio_opcode = IOCB_CMD_PREADV;
@ -196,6 +202,8 @@ ircd::fs::aio::request::write::write(const int &fd,
const write_opts &opts)
:request{fd}
{
wopts = &opts;
aio_reqprio = reqprio(opts.priority);
aio_lio_opcode = IOCB_CMD_PWRITEV;

View file

@ -71,7 +71,12 @@ struct ircd::fs::aio::request
ctx::ctx *waiter {ctx::current};
ssize_t retval {std::numeric_limits<ssize_t>::min()};
ssize_t errcode {0};
ssize_t errcode {0}; union
{
const read_opts *ropts {nullptr};
const write_opts *wopts;
const sync_opts *sopts;
};
public:
const_iovec_view iovec() const;