mirror of
https://github.com/matrix-construct/construct
synced 2024-11-17 15:30:52 +01:00
ircd::fs: Use better typedefs for vector_view of buffers.
This commit is contained in:
parent
322e25e725
commit
c9b10bd841
3 changed files with 9 additions and 6 deletions
|
@ -18,6 +18,9 @@ extern "C"
|
|||
|
||||
namespace ircd::fs
|
||||
{
|
||||
using const_buffers = vector_view<const const_buffer>;
|
||||
using mutable_buffers = vector_view<const mutable_buffer>;
|
||||
|
||||
// utility; count the total bytes of an iov.
|
||||
size_t bytes(const vector_view<const struct ::iovec> &);
|
||||
|
||||
|
@ -26,6 +29,6 @@ namespace ircd::fs
|
|||
// array. We get away with using a single buffer because the synchronous
|
||||
// readv()/writev() calls block the thread and for AIO the iov is copied out
|
||||
// of userspace on io_submit().
|
||||
vector_view<const struct ::iovec> make_iov(const vector_view<const const_buffer> &);
|
||||
vector_view<const struct ::iovec> make_iov(const vector_view<const mutable_buffer> &);
|
||||
vector_view<const struct ::iovec> make_iov(const const_buffers &);
|
||||
vector_view<const struct ::iovec> make_iov(const mutable_buffers &);
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ ircd::fs::aio::request::read::read(const int &fd,
|
|||
|
||||
size_t
|
||||
ircd::fs::aio::read(const fd &fd,
|
||||
const vector_view<const mutable_buffer> &bufs,
|
||||
const mutable_buffers &bufs,
|
||||
const read_opts &opts)
|
||||
{
|
||||
aio::request::read request
|
||||
|
@ -135,7 +135,7 @@ ircd::fs::aio::request::write::write(const int &fd,
|
|||
|
||||
size_t
|
||||
ircd::fs::aio::write(const fd &fd,
|
||||
const vector_view<const const_buffer> &bufs,
|
||||
const const_buffers &bufs,
|
||||
const write_opts &opts)
|
||||
{
|
||||
aio::request::write request
|
||||
|
|
|
@ -1028,7 +1028,7 @@ namespace ircd::fs
|
|||
}
|
||||
|
||||
ircd::vector_view<const struct ::iovec>
|
||||
ircd::fs::make_iov(const vector_view<const mutable_buffer> &bufs)
|
||||
ircd::fs::make_iov(const mutable_buffers &bufs)
|
||||
{
|
||||
size_t i(0);
|
||||
for(; i < bufs.size(); ++i)
|
||||
|
@ -1044,7 +1044,7 @@ ircd::fs::make_iov(const vector_view<const mutable_buffer> &bufs)
|
|||
}
|
||||
|
||||
ircd::vector_view<const struct ::iovec>
|
||||
ircd::fs::make_iov(const vector_view<const const_buffer> &bufs)
|
||||
ircd::fs::make_iov(const const_buffers &bufs)
|
||||
{
|
||||
size_t i(0);
|
||||
for(; i < bufs.size(); ++i)
|
||||
|
|
Loading…
Reference in a new issue