Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'include/llfio/v2.0')
-rw-r--r--include/llfio/v2.0/algorithm/shared_fs_mutex/atomic_append.hpp2
-rw-r--r--include/llfio/v2.0/algorithm/shared_fs_mutex/lock_files.hpp2
-rw-r--r--include/llfio/v2.0/algorithm/shared_fs_mutex/memory_map.hpp4
-rw-r--r--include/llfio/v2.0/async_file_handle.hpp21
-rw-r--r--include/llfio/v2.0/detail/impl/posix/async_file_handle.ipp18
-rw-r--r--include/llfio/v2.0/detail/impl/posix/directory_handle.ipp2
-rw-r--r--include/llfio/v2.0/detail/impl/posix/file_handle.ipp2
-rw-r--r--include/llfio/v2.0/detail/impl/posix/symlink_handle.ipp8
-rw-r--r--include/llfio/v2.0/detail/impl/windows/async_file_handle.ipp12
-rw-r--r--include/llfio/v2.0/detail/impl/windows/fs_handle.ipp2
-rw-r--r--include/llfio/v2.0/directory_handle.hpp2
-rw-r--r--include/llfio/v2.0/file_handle.hpp6
-rw-r--r--include/llfio/v2.0/io_handle.hpp13
-rw-r--r--include/llfio/v2.0/map_handle.hpp7
-rw-r--r--include/llfio/v2.0/mapped_file_handle.hpp6
-rw-r--r--include/llfio/v2.0/symlink_handle.hpp2
16 files changed, 57 insertions, 52 deletions
diff --git a/include/llfio/v2.0/algorithm/shared_fs_mutex/atomic_append.hpp b/include/llfio/v2.0/algorithm/shared_fs_mutex/atomic_append.hpp
index 9870b5cd..5e1b9807 100644
--- a/include/llfio/v2.0/algorithm/shared_fs_mutex/atomic_append.hpp
+++ b/include/llfio/v2.0/algorithm/shared_fs_mutex/atomic_append.hpp
@@ -205,7 +205,7 @@ namespace algorithm
{
if(lockresult.error() != errc::timed_out)
{
- return lockresult.error();
+ return std::move(lockresult).error();
}
// Somebody else is also using this file
}
diff --git a/include/llfio/v2.0/algorithm/shared_fs_mutex/lock_files.hpp b/include/llfio/v2.0/algorithm/shared_fs_mutex/lock_files.hpp
index ff33520b..6534767b 100644
--- a/include/llfio/v2.0/algorithm/shared_fs_mutex/lock_files.hpp
+++ b/include/llfio/v2.0/algorithm/shared_fs_mutex/lock_files.hpp
@@ -174,7 +174,7 @@ namespace algorithm
const auto &ec = ret.error();
if(ec != errc::resource_unavailable_try_again && ec != errc::file_exists)
{
- return ret.error();
+ return std::move(ret).error();
}
// Collided with another locker
was_contended = n;
diff --git a/include/llfio/v2.0/algorithm/shared_fs_mutex/memory_map.hpp b/include/llfio/v2.0/algorithm/shared_fs_mutex/memory_map.hpp
index 724e0773..7f8ff236 100644
--- a/include/llfio/v2.0/algorithm/shared_fs_mutex/memory_map.hpp
+++ b/include/llfio/v2.0/algorithm/shared_fs_mutex/memory_map.hpp
@@ -223,13 +223,13 @@ namespace algorithm
{
if(lockinuse.error() != errc::timed_out)
{
- return lockinuse.error();
+ return std::move(lockinuse).error();
}
// Somebody else is also using this file, so try to read the hash index file I ought to use
lockinuse = ret.lock(_lockinuseoffset, 1, false); // inuse shared access, blocking
if(!lockinuse)
{
- return lockinuse.error();
+ return std::move(lockinuse).error();
}
byte buffer[65536];
memset(buffer, 0, sizeof(buffer));
diff --git a/include/llfio/v2.0/async_file_handle.hpp b/include/llfio/v2.0/async_file_handle.hpp
index bdca7b1e..9022707f 100644
--- a/include/llfio/v2.0/async_file_handle.hpp
+++ b/include/llfio/v2.0/async_file_handle.hpp
@@ -225,7 +225,7 @@ public:
ret._service = &service;
return std::move(ret);
}
- LLFIO_HEADERS_ONLY_VIRTUAL_SPEC result<file_handle> clone(mode mode_ = mode::unchanged, caching caching_ = caching::unchanged, deadline d = std::chrono::seconds(30)) const noexcept override
+ LLFIO_HEADERS_ONLY_VIRTUAL_SPEC result<file_handle> clone(mode mode_ = mode::unchanged, caching caching_ = caching::unchanged, deadline d = std::chrono::seconds(30)) const noexcept
{
OUTCOME_TRY(v, file_handle::clone(mode_, caching_, d));
async_file_handle ret(std::move(v));
@@ -265,6 +265,7 @@ protected:
: read(buffers_type())
{
}
+ ~result_storage() { /* needed as io_result is move-only when configured with status code */}
} result;
constexpr _erased_io_state_type(async_file_handle *_parent, operation_t _operation, bool _must_deallocate_self, size_t _items)
: parent(_parent)
@@ -376,7 +377,7 @@ public:
erased completion handler of unknown type and state per buffers input.
*/
LLFIO_MAKE_FREE_FUNCTION
- template <class CompletionRoutine> //
+ template <class CompletionRoutine> //
LLFIO_REQUIRES(detail::is_invocable_r<void, CompletionRoutine, async_file_handle *, io_result<const_buffers_type> &>::value) //
result<io_state_ptr> async_barrier(io_request<const_buffers_type> reqs, CompletionRoutine &&completion, bool wait_for_device = false, bool and_metadata = false, span<char> mem = {}) noexcept
{
@@ -394,7 +395,7 @@ public:
auto *dest = reinterpret_cast<void *>(_dest);
new(dest) completion_handler(std::move(*this));
}
- void operator()(_erased_io_state_type *state) final { completion(state->parent, state->result.write); }
+ void operator()(_erased_io_state_type *state) final { completion(state->parent, std::move(state->result.write)); }
void *address() noexcept final { return &completion; }
} ch{std::forward<CompletionRoutine>(completion)};
operation_t operation = operation_t::fsync_sync;
@@ -423,7 +424,7 @@ public:
\return Either an io_state_ptr to the i/o in progress, or an error code.
\param reqs A scatter-gather and offset request.
- \param completion A callable to call upon i/o completion. Spec is `void(async_file_handle *, io_result<buffers_type> &)`.
+ \param completion A callable to call upon i/o completion. Spec is `void(async_file_handle *, io_result<buffers_type> &&)`.
Note that buffers returned may not be buffers input, see documentation for `read()`.
\param mem Optional span of memory to use to avoid using `calloc()`. Note span MUST be all bits zero on entry.
\errors As for `read()`, plus `ENOMEM`.
@@ -431,7 +432,7 @@ public:
erased completion handler of unknown type and state per buffers input.
*/
LLFIO_MAKE_FREE_FUNCTION
- template <class CompletionRoutine> //
+ template <class CompletionRoutine> //
LLFIO_REQUIRES(detail::is_invocable_r<void, CompletionRoutine, async_file_handle *, io_result<buffers_type> &>::value) //
result<io_state_ptr> async_read(io_request<buffers_type> reqs, CompletionRoutine &&completion, span<char> mem = {}) noexcept
{
@@ -449,7 +450,7 @@ public:
auto *dest = reinterpret_cast<void *>(_dest);
new(dest) completion_handler(std::move(*this));
}
- void operator()(_erased_io_state_type *state) final { completion(state->parent, state->result.read); }
+ void operator()(_erased_io_state_type *state) final { completion(state->parent, std::move(state->result.read)); }
void *address() noexcept final { return &completion; }
} ch{std::forward<CompletionRoutine>(completion)};
return _begin_io(mem, operation_t::read, io_request<const_buffers_type>({reinterpret_cast<const_buffer_type *>(reqs.buffers.data()), reqs.buffers.size()}, reqs.offset), std::move(ch));
@@ -466,7 +467,7 @@ public:
\return Either an io_state_ptr to the i/o in progress, or an error code.
\param reqs A scatter-gather and offset request.
- \param completion A callable to call upon i/o completion. Spec is `void(async_file_handle *, io_result<const_buffers_type> &)`.
+ \param completion A callable to call upon i/o completion. Spec is `void(async_file_handle *, io_result<const_buffers_type> &&)`.
Note that buffers returned may not be buffers input, see documentation for `write()`.
\param mem Optional span of memory to use to avoid using `calloc()`. Note span MUST be all bits zero on entry.
\errors As for `write()`, plus `ENOMEM`.
@@ -474,7 +475,7 @@ public:
erased completion handler of unknown type and state per buffers input.
*/
LLFIO_MAKE_FREE_FUNCTION
- template <class CompletionRoutine> //
+ template <class CompletionRoutine> //
LLFIO_REQUIRES(detail::is_invocable_r<void, CompletionRoutine, async_file_handle *, io_result<const_buffers_type> &>::value) //
result<io_state_ptr> async_write(io_request<const_buffers_type> reqs, CompletionRoutine &&completion, span<char> mem = {}) noexcept
{
@@ -492,7 +493,7 @@ public:
auto *dest = reinterpret_cast<void *>(_dest);
new(dest) completion_handler(std::move(*this));
}
- void operator()(_erased_io_state_type *state) final { completion(state->parent, state->result.write); }
+ void operator()(_erased_io_state_type *state) final { completion(state->parent, std::move(state->result.write)); }
void *address() noexcept final { return &completion; }
} ch{std::forward<CompletionRoutine>(completion)};
return _begin_io(mem, operation_t::write, reqs, std::move(ch));
@@ -512,7 +513,7 @@ private:
optional<io_result<BuffersType>> _result;
// Called on completion of the i/o
- void operator()(async_file_handle * /*unused*/, io_result<BuffersType> &result)
+ void operator()(async_file_handle * /*unused*/, io_result<BuffersType> &&result)
{
// store the result and resume the coroutine
_result = std::move(result);
diff --git a/include/llfio/v2.0/detail/impl/posix/async_file_handle.ipp b/include/llfio/v2.0/detail/impl/posix/async_file_handle.ipp
index 4a3a8652..58b55479 100644
--- a/include/llfio/v2.0/detail/impl/posix/async_file_handle.ipp
+++ b/include/llfio/v2.0/detail/impl/posix/async_file_handle.ipp
@@ -36,7 +36,7 @@ async_file_handle::io_result<async_file_handle::const_buffers_type> async_file_h
{
LLFIO_LOG_FUNCTION_CALL(this);
optional<io_result<const_buffers_type>> ret;
- OUTCOME_TRY(io_state, async_barrier(reqs, [&ret](async_file_handle *, io_result<const_buffers_type> &result) { ret = result; }, wait_for_device, and_metadata));
+ OUTCOME_TRY(io_state, async_barrier(reqs, [&ret](async_file_handle *, io_result<const_buffers_type> &&result) { ret = std::move(result); }, wait_for_device, and_metadata));
(void) io_state;
// While i/o is not done pump i/o completion
@@ -46,7 +46,7 @@ async_file_handle::io_result<async_file_handle::const_buffers_type> async_file_h
// If i/o service pump failed or timed out, cancel outstanding i/o and return
if(!t)
{
- return t.error();
+ return std::move(t).error();
}
#ifndef NDEBUG
if(!ret && t && !t.value())
@@ -56,7 +56,7 @@ async_file_handle::io_result<async_file_handle::const_buffers_type> async_file_h
}
#endif
}
- return *ret;
+ return std::move(*ret);
}
template <class BuffersType, class IORoutine> result<async_file_handle::io_state_ptr> async_file_handle::_begin_io(span<char> mem, async_file_handle::operation_t operation, async_file_handle::io_request<BuffersType> reqs, async_file_handle::_erased_completion_handler &&completion, IORoutine && /*unused*/) noexcept
@@ -328,7 +328,7 @@ async_file_handle::io_result<async_file_handle::buffers_type> async_file_handle:
{
LLFIO_LOG_FUNCTION_CALL(this);
optional<io_result<buffers_type>> ret;
- OUTCOME_TRY(io_state, async_read(reqs, [&ret](async_file_handle *, io_result<buffers_type> &result) { ret = result; }));
+ OUTCOME_TRY(io_state, async_read(reqs, [&ret](async_file_handle *, io_result<buffers_type> &&result) { ret = std::move(result); }));
(void) io_state;
// While i/o is not done pump i/o completion
@@ -338,7 +338,7 @@ async_file_handle::io_result<async_file_handle::buffers_type> async_file_handle:
// If i/o service pump failed or timed out, cancel outstanding i/o and return
if(!t)
{
- return t.error();
+ return std::move(t).error();
}
#ifndef NDEBUG
if(!ret && t && !t.value())
@@ -348,14 +348,14 @@ async_file_handle::io_result<async_file_handle::buffers_type> async_file_handle:
}
#endif
}
- return *ret;
+ return std::move(*ret);
}
async_file_handle::io_result<async_file_handle::const_buffers_type> async_file_handle::write(async_file_handle::io_request<async_file_handle::const_buffers_type> reqs, deadline d) noexcept
{
LLFIO_LOG_FUNCTION_CALL(this);
optional<io_result<const_buffers_type>> ret;
- OUTCOME_TRY(io_state, async_write(reqs, [&ret](async_file_handle *, io_result<const_buffers_type> &result) { ret = result; }));
+ OUTCOME_TRY(io_state, async_write(reqs, [&ret](async_file_handle *, io_result<const_buffers_type> &&result) { ret = std::move(result); }));
(void) io_state;
// While i/o is not done pump i/o completion
@@ -365,7 +365,7 @@ async_file_handle::io_result<async_file_handle::const_buffers_type> async_file_h
// If i/o service pump failed or timed out, cancel outstanding i/o and return
if(!t)
{
- return t.error();
+ return std::move(t).error();
}
#ifndef NDEBUG
if(!ret && t && !t.value())
@@ -375,7 +375,7 @@ async_file_handle::io_result<async_file_handle::const_buffers_type> async_file_h
}
#endif
}
- return *ret;
+ return std::move(*ret);
}
LLFIO_V2_NAMESPACE_END
diff --git a/include/llfio/v2.0/detail/impl/posix/directory_handle.ipp b/include/llfio/v2.0/detail/impl/posix/directory_handle.ipp
index 69bf45cf..fb312c81 100644
--- a/include/llfio/v2.0/detail/impl/posix/directory_handle.ipp
+++ b/include/llfio/v2.0/detail/impl/posix/directory_handle.ipp
@@ -172,7 +172,7 @@ result<directory_handle> directory_handle::clone(mode mode_, caching caching_, d
{
if(fh.error() != errc::no_such_file_or_directory)
{
- return fh.error();
+ return std::move(fh).error();
}
}
// Check timeout
diff --git a/include/llfio/v2.0/detail/impl/posix/file_handle.ipp b/include/llfio/v2.0/detail/impl/posix/file_handle.ipp
index 7e67f193..b77a4717 100644
--- a/include/llfio/v2.0/detail/impl/posix/file_handle.ipp
+++ b/include/llfio/v2.0/detail/impl/posix/file_handle.ipp
@@ -308,7 +308,7 @@ result<file_handle> file_handle::clone(mode mode_, caching caching_, deadline d)
{
if(fh.error() != errc::no_such_file_or_directory)
{
- return fh.error();
+ return std::move(fh).error();
}
}
// Check timeout
diff --git a/include/llfio/v2.0/detail/impl/posix/symlink_handle.ipp b/include/llfio/v2.0/detail/impl/posix/symlink_handle.ipp
index fba2832e..2f870922 100644
--- a/include/llfio/v2.0/detail/impl/posix/symlink_handle.ipp
+++ b/include/llfio/v2.0/detail/impl/posix/symlink_handle.ipp
@@ -185,7 +185,7 @@ result<symlink_handle> symlink_handle::clone(mode mode_, deadline d) const noexc
{
if(fh.error() != errc::no_such_file_or_directory)
{
- return fh.error();
+ return std::move(fh).error();
}
}
// Check timeout
@@ -357,7 +357,9 @@ LLFIO_HEADERS_ONLY_MEMFUNC_SPEC result<symlink_handle> symlink_handle::symlink(c
if(!r)
{
if(_creation == creation::only_if_not_exist || r.error() != errc::file_exists)
- return r.error();
+ {
+ return std::move(r).error();
+ }
}
break;
}
@@ -456,7 +458,7 @@ result<symlink_handle::const_buffers_type> symlink_handle::write(symlink_handle:
// If reopen failed, report that now
if(!newthis)
{
- return newthis.error();
+ return std::move(newthis).error();
}
// Swap myself with the new this
swap(newthis.value());
diff --git a/include/llfio/v2.0/detail/impl/windows/async_file_handle.ipp b/include/llfio/v2.0/detail/impl/windows/async_file_handle.ipp
index 4efb577b..b0563f08 100644
--- a/include/llfio/v2.0/detail/impl/windows/async_file_handle.ipp
+++ b/include/llfio/v2.0/detail/impl/windows/async_file_handle.ipp
@@ -223,7 +223,7 @@ async_file_handle::io_result<async_file_handle::buffers_type> async_file_handle:
{
LLFIO_LOG_FUNCTION_CALL(this);
optional<io_result<buffers_type>> ret;
- OUTCOME_TRY(io_state, async_read(reqs, [&ret](async_file_handle *, io_result<buffers_type> &result) { ret = result; }));
+ OUTCOME_TRY(io_state, async_read(reqs, [&ret](async_file_handle *, io_result<buffers_type> &&result) { ret = std::move(result); }));
(void) io_state; // holds i/o open until it completes
// While i/o is not done pump i/o completion
@@ -233,7 +233,7 @@ async_file_handle::io_result<async_file_handle::buffers_type> async_file_handle:
// If i/o service pump failed or timed out, cancel outstanding i/o and return
if(!t)
{
- return t.error();
+ return std::move(t).error();
}
#ifndef NDEBUG
if(!ret && t && !t.value())
@@ -243,14 +243,14 @@ async_file_handle::io_result<async_file_handle::buffers_type> async_file_handle:
}
#endif
}
- return *ret;
+ return std::move(*ret);
}
async_file_handle::io_result<async_file_handle::const_buffers_type> async_file_handle::write(async_file_handle::io_request<async_file_handle::const_buffers_type> reqs, deadline d) noexcept
{
LLFIO_LOG_FUNCTION_CALL(this);
optional<io_result<const_buffers_type>> ret;
- OUTCOME_TRY(io_state, async_write(reqs, [&ret](async_file_handle *, io_result<const_buffers_type> &result) { ret = result; }));
+ OUTCOME_TRY(io_state, async_write(reqs, [&ret](async_file_handle *, io_result<const_buffers_type> &&result) { ret = std::move(result); }));
(void) io_state; // holds i/o open until it completes
// While i/o is not done pump i/o completion
@@ -260,7 +260,7 @@ async_file_handle::io_result<async_file_handle::const_buffers_type> async_file_h
// If i/o service pump failed or timed out, cancel outstanding i/o and return
if(!t)
{
- return t.error();
+ return std::move(t).error();
}
#ifndef NDEBUG
if(!ret && t && !t.value())
@@ -270,7 +270,7 @@ async_file_handle::io_result<async_file_handle::const_buffers_type> async_file_h
}
#endif
}
- return *ret;
+ return std::move(*ret);
}
diff --git a/include/llfio/v2.0/detail/impl/windows/fs_handle.ipp b/include/llfio/v2.0/detail/impl/windows/fs_handle.ipp
index e42283e3..d15dddb1 100644
--- a/include/llfio/v2.0/detail/impl/windows/fs_handle.ipp
+++ b/include/llfio/v2.0/detail/impl/windows/fs_handle.ipp
@@ -251,7 +251,7 @@ result<void> fs_handle::unlink(deadline d) noexcept
}
else
{
- return out.error();
+ return std::move(out).error();
}
}
}
diff --git a/include/llfio/v2.0/directory_handle.hpp b/include/llfio/v2.0/directory_handle.hpp
index 3385e041..b201c94c 100644
--- a/include/llfio/v2.0/directory_handle.hpp
+++ b/include/llfio/v2.0/directory_handle.hpp
@@ -261,7 +261,7 @@ public:
// File may have already been deleted, if so ignore
if(ret.error() != errc::no_such_file_or_directory)
{
- return ret.error();
+ return std::move(ret).error();
}
}
}
diff --git a/include/llfio/v2.0/file_handle.hpp b/include/llfio/v2.0/file_handle.hpp
index 87853483..b3e2afcc 100644
--- a/include/llfio/v2.0/file_handle.hpp
+++ b/include/llfio/v2.0/file_handle.hpp
@@ -204,7 +204,7 @@ public:
// File may have already been deleted, if so ignore
if(ret.error() != errc::no_such_file_or_directory)
{
- return ret.error();
+ return std::move(ret).error();
}
}
}
@@ -232,7 +232,7 @@ public:
\mallocs On POSIX if changing the mode, we must loop calling `current_path()` and
trying to open the path returned. Thus many allocations may occur.
*/
- LLFIO_HEADERS_ONLY_VIRTUAL_SPEC result<file_handle> clone(mode mode_ = mode::unchanged, caching caching_ = caching::unchanged, deadline d = std::chrono::seconds(30)) const noexcept;
+ result<file_handle> clone(mode mode_ = mode::unchanged, caching caching_ = caching::unchanged, deadline d = std::chrono::seconds(30)) const noexcept;
//! The i/o service this handle is attached to, if any
io_service *service() const noexcept { return _service; }
@@ -250,7 +250,7 @@ public:
{
return ret.bytes_transferred();
}
- return ret.error();
+ return std::move(ret).error();
}
/*! Return the current maximum permitted extent of the file.
diff --git a/include/llfio/v2.0/io_handle.hpp b/include/llfio/v2.0/io_handle.hpp
index bd9d857a..87bdd0ee 100644
--- a/include/llfio/v2.0/io_handle.hpp
+++ b/include/llfio/v2.0/io_handle.hpp
@@ -216,10 +216,15 @@ public:
io_result() = default;
#endif
~io_result() = default;
+ io_result &operator=(io_result &&) = default; // NOLINT
+#if LLFIO_EXPERIMENTAL_STATUS_CODE
+ io_result(const io_result &) = delete;
+ io_result &operator=(const io_result &) = delete;
+#else
io_result(const io_result &) = default;
- io_result(io_result &&) = default; // NOLINT
io_result &operator=(const io_result &) = default;
- io_result &operator=(io_result &&) = default; // NOLINT
+#endif
+ io_result(io_result &&) = default; // NOLINT
//! Returns bytes transferred
size_type bytes_transferred() noexcept
{
@@ -234,7 +239,7 @@ public:
return _bytes_transferred;
}
};
-#ifndef NDEBUG
+#if !defined(NDEBUG) && !LLFIO_EXPERIMENTAL_STATUS_CODE
// Is trivial in all ways, except default constructibility
static_assert(std::is_trivially_copyable<io_result<buffers_type>>::value, "io_result<buffers_type> is not trivially copyable!");
// static_assert(std::is_trivially_assignable<io_result<buffers_type>, io_result<buffers_type>>::value, "io_result<buffers_type> is not trivially assignable!");
@@ -341,7 +346,7 @@ public:
{
return ret.bytes_transferred();
}
- return ret.error();
+ return std::move(ret).error();
}
/*! \brief Issue a write reordering barrier such that writes preceding the barrier will reach storage
diff --git a/include/llfio/v2.0/map_handle.hpp b/include/llfio/v2.0/map_handle.hpp
index 56c5c74e..41b70ead 100644
--- a/include/llfio/v2.0/map_handle.hpp
+++ b/include/llfio/v2.0/map_handle.hpp
@@ -553,11 +553,14 @@ public:
//! Ask the system to make the memory represented by the buffer unavailable and to decommit the system resources representing them. addr and length should be page aligned (see `page_size()`), if not the returned buffer is the region actually decommitted.
LLFIO_HEADERS_ONLY_MEMFUNC_SPEC result<buffer_type> decommit(buffer_type region) noexcept;
- /*! Zero the memory represented by the buffer. Differs from zero() because it acts on mapped memory, but may call zero() internally.
+ /*! Zero the memory represented by the buffer. Differs from zero() because it acts on mapped memory, not on allocated file extents.
- On Linux, Windows and FreeBSD any full 4Kb pages will be deallocated from the
+ On Linux, Mac OS and FreeBSD any full 4Kb pages will be deallocated from the
system entirely, including the extents for them in any backing storage. On newer Linux kernels the kernel can additionally swap whole 4Kb pages for
freshly zeroed ones making this a very efficient way of zeroing large ranges of memory.
+
+ On Windows, this call currently only works for non-backed memory due to lacking kernel support.
+
\errors Any of the errors returnable by madvise() or DiscardVirtualMemory or the zero() function.
*/
LLFIO_HEADERS_ONLY_MEMFUNC_SPEC result<void> zero_memory(buffer_type region) noexcept;
diff --git a/include/llfio/v2.0/mapped_file_handle.hpp b/include/llfio/v2.0/mapped_file_handle.hpp
index ef8fab67..07012c80 100644
--- a/include/llfio/v2.0/mapped_file_handle.hpp
+++ b/include/llfio/v2.0/mapped_file_handle.hpp
@@ -327,12 +327,6 @@ public:
LLFIO_HEADERS_ONLY_VIRTUAL_SPEC result<void> close() noexcept override;
LLFIO_HEADERS_ONLY_VIRTUAL_SPEC native_handle_type release() noexcept override;
LLFIO_HEADERS_ONLY_VIRTUAL_SPEC io_result<const_buffers_type> barrier(io_request<const_buffers_type> reqs = io_request<const_buffers_type>(), bool wait_for_device = false, bool and_metadata = false, deadline d = deadline()) noexcept override { return _mh.barrier(reqs, wait_for_device, and_metadata, d); }
- LLFIO_HEADERS_ONLY_VIRTUAL_SPEC result<file_handle> clone(mode mode_ = mode::unchanged, caching caching_ = caching::unchanged, deadline d = std::chrono::seconds(30)) const noexcept override
- {
- OUTCOME_TRY(fh, file_handle::clone(mode_, caching_, d));
- mapped_file_handle ret(std::move(fh), _reservation);
- return static_cast<file_handle &&>(ret);
- }
result<mapped_file_handle> clone(size_type reservation, mode mode_ = mode::unchanged, caching caching_ = caching::unchanged, deadline d = std::chrono::seconds(30)) const noexcept
{
OUTCOME_TRY(fh, file_handle::clone(mode_, caching_, d));
diff --git a/include/llfio/v2.0/symlink_handle.hpp b/include/llfio/v2.0/symlink_handle.hpp
index 54543d89..8be1ad3d 100644
--- a/include/llfio/v2.0/symlink_handle.hpp
+++ b/include/llfio/v2.0/symlink_handle.hpp
@@ -348,7 +348,7 @@ public:
// File may have already been deleted, if so ignore
if(ret.error() != errc::no_such_file_or_directory)
{
- return ret.error();
+ return std::move(ret).error();
}
}
}