0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

ircd::fs::aio: Add iovec bytes counter.

This commit is contained in:
Jason Volk 2018-11-27 19:53:05 -08:00
parent 062906143f
commit 0451dfd925

View file

@ -16,6 +16,7 @@
namespace ircd::fs::aio
{
static int reqprio(int);
static size_t bytes(const vector_view<const struct ::iovec> &);
}
///////////////////////////////////////////////////////////////////////////////
@ -191,6 +192,16 @@ ircd::fs::aio::prefetch(const fd &fd,
// internal util
//
size_t
ircd::fs::aio::bytes(const vector_view<const struct ::iovec> &iov)
{
return std::accumulate(begin(iov), end(iov), size_t(0), []
(auto ret, const auto &iov)
{
return ret += iov.iov_len;
});
}
int
ircd::fs::aio::reqprio(int input)
{