mirror of
https://github.com/matrix-construct/construct
synced 2024-12-27 07:54:05 +01:00
ircd::fs: Use posix iov in AIO interface arguments.
This commit is contained in:
parent
77a84b18d3
commit
c3cf4c02dd
3 changed files with 9 additions and 8 deletions
|
@ -98,12 +98,12 @@ ircd::fs::aio::request::read::read(const int &fd,
|
|||
|
||||
size_t
|
||||
ircd::fs::aio::read(const fd &fd,
|
||||
const mutable_buffers &bufs,
|
||||
const const_iovec_view &bufs,
|
||||
const read_opts &opts)
|
||||
{
|
||||
aio::request::read request
|
||||
{
|
||||
fd, make_iov(bufs), opts
|
||||
fd, bufs, opts
|
||||
};
|
||||
|
||||
stats.cur_reads++;
|
||||
|
@ -143,12 +143,12 @@ ircd::fs::aio::request::write::write(const int &fd,
|
|||
|
||||
size_t
|
||||
ircd::fs::aio::write(const fd &fd,
|
||||
const const_buffers &bufs,
|
||||
const const_iovec_view &bufs,
|
||||
const write_opts &opts)
|
||||
{
|
||||
aio::request::write request
|
||||
{
|
||||
fd, make_iov(bufs), opts
|
||||
fd, bufs, opts
|
||||
};
|
||||
|
||||
#ifndef _NDEBUG
|
||||
|
|
|
@ -17,8 +17,8 @@ namespace ircd::fs::aio
|
|||
struct request;
|
||||
|
||||
void prefetch(const fd &, const size_t &, const read_opts &);
|
||||
size_t write(const fd &, const const_buffers &, const write_opts &);
|
||||
size_t read(const fd &, const mutable_buffers &, const read_opts &);
|
||||
size_t write(const fd &, const const_iovec_view &, const write_opts &);
|
||||
size_t read(const fd &, const const_iovec_view &, const read_opts &);
|
||||
void fdsync(const fd &, const sync_opts &);
|
||||
void fsync(const fd &, const sync_opts &);
|
||||
}
|
||||
|
|
|
@ -881,12 +881,13 @@ ircd::fs::write(const fd &fd,
|
|||
const const_buffers &bufs,
|
||||
const write_opts &opts)
|
||||
{
|
||||
const auto iov(make_iov(bufs));
|
||||
|
||||
#ifdef IRCD_USE_AIO
|
||||
if(likely(aio::context) && opts.aio)
|
||||
return aio::write(fd, bufs, opts);
|
||||
return aio::write(fd, iov, opts);
|
||||
#endif
|
||||
|
||||
const auto iov(make_iov(bufs));
|
||||
return size_t(syscall(::pwritev, fd, iov.data(), iov.size(), opts.offset));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue