mirror of
https://github.com/matrix-construct/construct
synced 2024-11-04 21:08:57 +01:00
ircd::fs::aio: Add iovec bytes counter.
This commit is contained in:
parent
062906143f
commit
0451dfd925
1 changed files with 11 additions and 0 deletions
11
ircd/aio.cc
11
ircd/aio.cc
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue