diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-05-18 16:58:59 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-05-18 16:58:59 +0100 |
commit | cdc78c9043e858c58488cff363875d9aff1c27b0 (patch) | |
tree | 5d3e4257397de697f23fd1fbd8f363aa5731bf21 | |
parent | Fix and test performing large reads (diff) | |
download | netfs-cdc78c9043e858c58488cff363875d9aff1c27b0.tar.bz2 netfs-cdc78c9043e858c58488cff363875d9aff1c27b0.tar.xz netfs-cdc78c9043e858c58488cff363875d9aff1c27b0.zip |
waitOnWriteRangeAndThen can have auto return type
-rw-r--r-- | netfs/fuse/fuseApp.h | 4 | ||||
-rw-r--r-- | netfs/fuse/fuseFiles.cpp | 9 |
2 files changed, 6 insertions, 7 deletions
diff --git a/netfs/fuse/fuseApp.h b/netfs/fuse/fuseApp.h index b0b0e5a..790f88a 100644 --- a/netfs/fuse/fuseApp.h +++ b/netfs/fuse/fuseApp.h @@ -94,8 +94,8 @@ namespace NetFS { template<typename Handle> void clearProxy(FuseHandleTypeId localID); template<typename Handle> std::map<FuseHandleTypeId, Handle> & getMap(); - template<typename Rtn, typename F> - static inline Rtn waitOnWriteRangeAndThen(size_t s, off_t o, const OpenFilePtr & of, const F & f); + template<typename F> + static inline auto waitOnWriteRangeAndThen(size_t s, off_t o, const OpenFilePtr & of, const F & f); ReqEnv reqEnv(); diff --git a/netfs/fuse/fuseFiles.cpp b/netfs/fuse/fuseFiles.cpp index c50dcf1..eeb5423 100644 --- a/netfs/fuse/fuseFiles.cpp +++ b/netfs/fuse/fuseFiles.cpp @@ -115,8 +115,8 @@ namespace NetFS { } } - template<typename Rtn, typename F> - inline Rtn + template<typename F> + inline auto FuseApp::waitOnWriteRangeAndThen(size_t s, off_t o, const OpenFilePtr & of, const F & f) { const auto key = OpenFile::range(o, s); @@ -186,7 +186,7 @@ namespace NetFS { blockSizeIterate( blockSizes, [&ops, &o, &of, &remote, blockOffset = 0U](safe<size_t> blockSize) mutable { ops.emplace_back(blockOffset, - waitOnWriteRangeAndThen<std::future<Buffer>>( + waitOnWriteRangeAndThen( blockSize, o, of, [o, blockSize, &remote](const auto &) { return remote->readAsync(o, blockSize); })); @@ -226,8 +226,7 @@ namespace NetFS { auto bytes = reinterpret_cast<const ::Ice::Byte *>(buf); if (fcr->Async) { blockSizeIterate(of->blockSizes(s), [&bytes, &o, &remote, &of](safe<size_t> blockSize) { - waitOnWriteRangeAndThen<void>( - blockSize, o, of, [o, blockSize, bytes, &of, remote](const auto & key) { + waitOnWriteRangeAndThen(blockSize, o, of, [o, blockSize, bytes, &of, remote](const auto & key) { auto p = std::make_shared<OpenFile::WriteState>(); of->bg.insert({key, p}); remote->writeAsync( |