From 152060da365d9212ec8069c25d78c11ecc9ad815 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 21 Dec 2018 10:28:51 -0800 Subject: [PATCH] ircd::fs: Create iov on the stack rather than with tls. --- ircd/fs.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ircd/fs.cc b/ircd/fs.cc index aa2d2ef87..1c3346b88 100644 --- a/ircd/fs.cc +++ b/ircd/fs.cc @@ -685,13 +685,14 @@ ircd::fs::read(const fd &fd, const read_opts &opts_) { size_t ret(0); - read_opts opts(opts_); do + read_opts opts(opts_); + struct ::iovec iovbuf[bufs.size()]; do { assert(opts.offset >= opts_.offset); const size_t off(opts.offset - opts_.offset); assert(off <= buffers::size(bufs)); assert(ret <= buffers::size(bufs)); - const auto iov(make_iov(bufs, ret)); + const auto iov(make_iov({iovbuf, bufs.size()}, bufs, ret)); ret += read(fd, iov, opts); if(!opts_.all) break; @@ -939,9 +940,10 @@ ircd::fs::write(const fd &fd, const write_opts &opts_) { write_opts opts(opts_); - size_t off(opts.offset - opts_.offset); do + size_t off(opts.offset - opts_.offset); + struct ::iovec iovbuf[bufs.size()]; do { - const auto iov(make_iov(bufs, off)); + const auto iov(make_iov({iovbuf, bufs.size()}, bufs, off)); opts.offset += write(fd, iov, opts); assert(opts.offset >= opts_.offset); off = opts.offset - opts_.offset;