From e66a774d599804a31ebbb701874ca2dde5e36e10 Mon Sep 17 00:00:00 2001 From: "Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com)" Date: Mon, 18 Nov 2019 11:14:56 +0000 Subject: As per WG21 guidance, moved byte range locking API out of io_handle, and into an extension to file_handle. This makes space to make a future lockable_io_handle to model SharedMutex, which locks an inode like a std::shared_mutex. Note that the new .lock_range() API no longer does special semantics if you pass in zero length to lock the whole file. --- include/llfio/revision.hpp | 6 +- .../v2.0/algorithm/handle_adapter/combining.hpp | 73 ++++----- .../algorithm/shared_fs_mutex/atomic_append.hpp | 10 +- .../v2.0/algorithm/shared_fs_mutex/byte_ranges.hpp | 8 +- .../v2.0/algorithm/shared_fs_mutex/memory_map.hpp | 8 +- .../llfio/v2.0/detail/impl/posix/file_handle.ipp | 124 +++++++++++++++ include/llfio/v2.0/detail/impl/posix/io_handle.ipp | 121 --------------- .../llfio/v2.0/detail/impl/safe_byte_ranges.ipp | 12 +- .../llfio/v2.0/detail/impl/windows/file_handle.ipp | 84 +++++++++++ .../llfio/v2.0/detail/impl/windows/io_handle.ipp | 84 ----------- include/llfio/v2.0/fast_random_file_handle.hpp | 6 +- include/llfio/v2.0/file_handle.hpp | 166 +++++++++++++++++++++ include/llfio/v2.0/handle.hpp | 2 +- include/llfio/v2.0/io_handle.hpp | 161 -------------------- test/tests/file_handle_lock_unlock.cpp | 12 +- 15 files changed, 443 insertions(+), 434 deletions(-) diff --git a/include/llfio/revision.hpp b/include/llfio/revision.hpp index e13e53cd..f21c9150 100644 --- a/include/llfio/revision.hpp +++ b/include/llfio/revision.hpp @@ -1,4 +1,4 @@ // Note the second line of this file must ALWAYS be the git SHA, third line ALWAYS the git SHA update time -#define LLFIO_PREVIOUS_COMMIT_REF 1ebceb7e076b3d6d0f51f185f94d65493e26f192 -#define LLFIO_PREVIOUS_COMMIT_DATE "2019-10-19 18:01:38 +00:00" -#define LLFIO_PREVIOUS_COMMIT_UNIQUE 1ebceb7e +#define LLFIO_PREVIOUS_COMMIT_REF b6c21fdf2dcf0f7c72e117cfc8396fdbb9d5973c +#define LLFIO_PREVIOUS_COMMIT_DATE "2019-11-15 17:29:01 +00:00" +#define LLFIO_PREVIOUS_COMMIT_UNIQUE b6c21fdf diff --git a/include/llfio/v2.0/algorithm/handle_adapter/combining.hpp b/include/llfio/v2.0/algorithm/handle_adapter/combining.hpp index 5c794503..bf2661eb 100644 --- a/include/llfio/v2.0/algorithm/handle_adapter/combining.hpp +++ b/include/llfio/v2.0/algorithm/handle_adapter/combining.hpp @@ -305,37 +305,63 @@ namespace algorithm } return std::move(reqs.buffers); } + }; + template