mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 07:23:53 +01:00
ircd::fs: Remove the thread_local convenience for make_iov().
This commit is contained in:
parent
2f36fec41a
commit
c3d95aa8de
2 changed files with 0 additions and 45 deletions
|
@ -31,12 +31,4 @@ namespace ircd::fs
|
|||
// useful for progressive readv()'s filling the buffers.
|
||||
const_iovec_view make_iov(const iovec_view &, const const_buffers &, const size_t &off = 0);
|
||||
const_iovec_view make_iov(const iovec_view &, const mutable_buffers &, const size_t &off = 0);
|
||||
|
||||
// Transforms our buffers to struct iovec ones. This is done using an
|
||||
// internal thread_local array of IOV_MAX. The returned view is of that
|
||||
// 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().
|
||||
const_iovec_view make_iov(const const_buffers &, const size_t &off = 0);
|
||||
const_iovec_view make_iov(const mutable_buffers &, const size_t &off = 0);
|
||||
}
|
||||
|
|
37
ircd/fs.cc
37
ircd/fs.cc
|
@ -1245,43 +1245,6 @@ noexcept(false)
|
|||
// fs/iov.h
|
||||
//
|
||||
|
||||
namespace ircd::fs
|
||||
{
|
||||
thread_local std::array<struct ::iovec, IOV_MAX> _iov_;
|
||||
}
|
||||
|
||||
ircd::fs::const_iovec_view
|
||||
ircd::fs::make_iov(const mutable_buffers &bufs,
|
||||
const size_t &offset)
|
||||
{
|
||||
if(unlikely(bufs.size() > _iov_.size()))
|
||||
throw error
|
||||
{
|
||||
make_error_code(std::errc::invalid_argument),
|
||||
"Buffer count of %zu exceeds IOV_MAX of %zu",
|
||||
bufs.size(),
|
||||
_iov_.size()
|
||||
};
|
||||
|
||||
return make_iov(iovec_view(_iov_.data(), _iov_.size()), bufs, offset);
|
||||
}
|
||||
|
||||
ircd::fs::const_iovec_view
|
||||
ircd::fs::make_iov(const const_buffers &bufs,
|
||||
const size_t &offset)
|
||||
{
|
||||
if(unlikely(bufs.size() > _iov_.size()))
|
||||
throw error
|
||||
{
|
||||
make_error_code(std::errc::invalid_argument),
|
||||
"Buffer count of %zu exceeds IOV_MAX of %zu",
|
||||
bufs.size(),
|
||||
_iov_.size()
|
||||
};
|
||||
|
||||
return make_iov(iovec_view(_iov_.data(), _iov_.size()), bufs, offset);
|
||||
}
|
||||
|
||||
ircd::fs::const_iovec_view
|
||||
ircd::fs::make_iov(const iovec_view &iov,
|
||||
const mutable_buffers &bufs,
|
||||
|
|
Loading…
Reference in a new issue