diff options
-rw-r--r-- | netfs/fuse/fuseFiles.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/netfs/fuse/fuseFiles.cpp b/netfs/fuse/fuseFiles.cpp index b8eb014..bbb7548 100644 --- a/netfs/fuse/fuseFiles.cpp +++ b/netfs/fuse/fuseFiles.cpp @@ -130,13 +130,13 @@ FuseApp::waitOnWriteRangeAndThen(size_t s, off_t o, const OpenFilePtr & of, cons return f(key); } else { - // Wait for them whilst unlocked - _l.release()->unlock(); std::vector<std::shared_ptr<OpenFile::WriteState>> overlap; overlap.reserve(std::distance(R.first, R.second)); for (auto i = R.first; i != R.second; i++) { overlap.push_back(i->second); } + // Wait for them whilst unlocked + _l.release()->unlock(); for (const auto & r : overlap) { r->future.wait(); } @@ -178,7 +178,7 @@ FuseApp::write(const char *, const char * buf, size_t s, off_t o, struct fuse_fi auto of = getProxy<OpenFilePtr>(fi->fh); auto remote = of->remote; if (fcr->Async) { - waitOnWriteRangeAndThen<void>(s, o, of, [o, s, buf, &of, &remote](const auto & key){ + waitOnWriteRangeAndThen<void>(s, o, of, [o, s, buf, &of, remote](const auto & key){ auto p = std::make_shared<OpenFile::WriteState>(); remote->writeAsync(o, s, Buffer(buf, buf + s), [p,of,key]() { p->promise.set_value(); |