0
0
Fork 0
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:
Jason Volk 2018-11-28 17:10:17 -08:00
parent 322e25e725
commit c9b10bd841
3 changed files with 9 additions and 6 deletions

View file

@ -18,6 +18,9 @@ extern "C"
namespace ircd::fs 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. // utility; count the total bytes of an iov.
size_t bytes(const vector_view<const struct ::iovec> &); 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 // 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 // readv()/writev() calls block the thread and for AIO the iov is copied out
// of userspace on io_submit(). // 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 const_buffers &);
vector_view<const struct ::iovec> make_iov(const vector_view<const mutable_buffer> &); vector_view<const struct ::iovec> make_iov(const mutable_buffers &);
} }

View file

@ -98,7 +98,7 @@ ircd::fs::aio::request::read::read(const int &fd,
size_t size_t
ircd::fs::aio::read(const fd &fd, ircd::fs::aio::read(const fd &fd,
const vector_view<const mutable_buffer> &bufs, const mutable_buffers &bufs,
const read_opts &opts) const read_opts &opts)
{ {
aio::request::read request aio::request::read request
@ -135,7 +135,7 @@ ircd::fs::aio::request::write::write(const int &fd,
size_t size_t
ircd::fs::aio::write(const fd &fd, ircd::fs::aio::write(const fd &fd,
const vector_view<const const_buffer> &bufs, const const_buffers &bufs,
const write_opts &opts) const write_opts &opts)
{ {
aio::request::write request aio::request::write request

View file

@ -1028,7 +1028,7 @@ namespace ircd::fs
} }
ircd::vector_view<const struct ::iovec> 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); size_t i(0);
for(; i < bufs.size(); ++i) 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::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); size_t i(0);
for(; i < bufs.size(); ++i) for(; i < bufs.size(); ++i)