diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2021-04-20 13:44:21 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2021-04-20 13:44:21 +0300 |
commit | 565f27555d13ce2a37346d838f32e03e1972aac1 (patch) | |
tree | 791789e4ee01aafa8d468f7315b35c88eb1f9cf2 | |
parent | 6735fabda8723111d687cc6bab54e73fad666131 (diff) |
Remove all remaining mentions of async_file_handle (issue #78).
-rw-r--r-- | example/use_cases.cpp | 25 | ||||
-rw-r--r-- | include/llfio/v2.0/file_handle.hpp | 8 | ||||
-rw-r--r-- | include/llfio/v2.0/io_handle.hpp | 4 | ||||
-rw-r--r-- | include/llfio/v2.0/lockable_io_handle.hpp | 5 | ||||
-rw-r--r-- | include/llfio/v2.0/mapped_file_handle.hpp | 3 | ||||
-rw-r--r-- | release_notes.md | 3 |
6 files changed, 4 insertions, 44 deletions
diff --git a/example/use_cases.cpp b/example/use_cases.cpp index 3fb5cc1e..334e1cc6 100644 --- a/example/use_cases.cpp +++ b/example/use_cases.cpp @@ -307,31 +307,6 @@ void sparse_array() } #endif -#if LLFIO_HAVE_COROUTINES -std::future<void> coroutine_write() -{ - //! [coroutine_write] - namespace llfio = LLFIO_V2_NAMESPACE; - - // Create an asynchronous file handle - llfio::io_service service; - llfio::async_file_handle fh = - llfio::async_file(service, {}, "testfile.txt", - llfio::async_file_handle::mode::write, - llfio::async_file_handle::creation::if_needed).value(); - - // Resize it to 1024 bytes - truncate(fh, 1024).value(); - - // Begin to asynchronously write "hello world" into the file at offset 0, - // suspending execution of this coroutine until completion and then resuming - // execution. Requires the Coroutines TS. - alignas(4096) char buffer[] = "hello world"; - co_await co_write(fh, 0, { { reinterpret_cast<llfio::byte *>(buffer), sizeof(buffer) } }).value(); - //! [coroutine_write] -} -#endif - int main() { return 0; diff --git a/include/llfio/v2.0/file_handle.hpp b/include/llfio/v2.0/file_handle.hpp index c012a1c5..995a65dc 100644 --- a/include/llfio/v2.0/file_handle.hpp +++ b/include/llfio/v2.0/file_handle.hpp @@ -39,14 +39,12 @@ Distributed under the Boost Software License, Version 1.0. LLFIO_V2_NAMESPACE_EXPORT_BEGIN /*! \class file_handle -\brief A handle to a regular file or device, kept data layout compatible with -async_file_handle. +\brief A handle to a regular file or device. <table> <tr><th></th><th>Cost of opening</th><th>Cost of i/o</th><th>Concurrency and Atomicity</th><th>Other remarks</th></tr> <tr><td>`file_handle`</td><td>Least</td><td>Syscall</td><td>POSIX guarantees (usually)</td><td>Least gotcha</td></tr> -<tr><td>`async_file_handle`</td><td>More</td><td>Most (syscall + malloc/free + reactor)</td><td>POSIX guarantees (usually)</td><td>Makes no sense to use with -cached i/o as it's a very expensive way to call `memcpy()`</td></tr> <tr><td>`mapped_file_handle`</td><td>Most</td><td>Least</td><td>None</td><td>Cannot be used +<tr><td>`mapped_file_handle`</td><td>Most</td><td>Least</td><td>None</td><td>Cannot be used with uncached i/o</td></tr> </table> @@ -379,7 +377,6 @@ public: handle configuration (e.g. writing to regular files on POSIX or writing to a non-overlapped HANDLE on Windows). \mallocs The default synchronous implementation in file_handle performs no memory allocation. - The asynchronous implementation in async_file_handle may perform one calloc and one free. */ LLFIO_MAKE_FREE_FUNCTION LLFIO_HEADERS_ONLY_VIRTUAL_SPEC result<extent_type> zero(extent_pair extent, deadline d = deadline()) noexcept; @@ -529,7 +526,6 @@ Note function may return significantly after this deadline if the i/o takes long returned if deadline i/o is not possible with this particular handle configuration (e.g. writing to regular files on POSIX or writing to a non-overlapped HANDLE on Windows). \mallocs The default synchronous implementation in file_handle performs no memory allocation. -The asynchronous implementation in async_file_handle may perform one calloc and one free. */ inline result<file_handle::extent_type> zero(file_handle &self, file_handle::extent_type offset, file_handle::extent_type bytes, deadline d = deadline()) noexcept diff --git a/include/llfio/v2.0/io_handle.hpp b/include/llfio/v2.0/io_handle.hpp index edddd2f8..bd333681 100644 --- a/include/llfio/v2.0/io_handle.hpp +++ b/include/llfio/v2.0/io_handle.hpp @@ -278,7 +278,6 @@ public: returned if deadline i/o is not possible with this particular handle configuration (e.g. reading from regular files on POSIX or reading from a non-overlapped HANDLE on Windows). \mallocs The default synchronous implementation in file_handle performs no memory allocation. - The asynchronous implementation in async_file_handle performs one calloc and one free. */ LLFIO_MAKE_FREE_FUNCTION io_result<buffers_type> read(io_request<buffers_type> reqs, deadline d = deadline()) noexcept { return (_ctx == nullptr) ? _do_read(reqs, d) : _do_multiplexer_read({}, reqs, d); } @@ -321,7 +320,6 @@ public: returned if deadline i/o is not possible with this particular handle configuration (e.g. writing to regular files on POSIX or writing to a non-overlapped HANDLE on Windows). \mallocs The default synchronous implementation in file_handle performs no memory allocation. - The asynchronous implementation in async_file_handle performs one calloc and one free. */ LLFIO_MAKE_FREE_FUNCTION io_result<const_buffers_type> write(io_request<const_buffers_type> reqs, deadline d = deadline()) noexcept { return (_ctx == nullptr) ? _do_write(reqs, d) : _do_multiplexer_write({}, std::move(reqs), d); } @@ -569,7 +567,6 @@ Note function may return significantly after this deadline if the i/o takes long returned if deadline i/o is not possible with this particular handle configuration (e.g. reading from regular files on POSIX or reading from a non-overlapped HANDLE on Windows). \mallocs The default synchronous implementation in file_handle performs no memory allocation. -The asynchronous implementation in async_file_handle performs one calloc and one free. */ inline io_handle::io_result<io_handle::buffers_type> read(io_handle &self, io_handle::io_request<io_handle::buffers_type> reqs, deadline d = deadline()) noexcept { @@ -595,7 +592,6 @@ Note function may return significantly after this deadline if the i/o takes long returned if deadline i/o is not possible with this particular handle configuration (e.g. writing to regular files on POSIX or writing to a non-overlapped HANDLE on Windows). \mallocs The default synchronous implementation in file_handle performs no memory allocation. -The asynchronous implementation in async_file_handle performs one calloc and one free. */ inline io_handle::io_result<io_handle::const_buffers_type> write(io_handle &self, io_handle::io_request<io_handle::const_buffers_type> reqs, deadline d = deadline()) noexcept { diff --git a/include/llfio/v2.0/lockable_io_handle.hpp b/include/llfio/v2.0/lockable_io_handle.hpp index 9248a48e..ae46c671 100644 --- a/include/llfio/v2.0/lockable_io_handle.hpp +++ b/include/llfio/v2.0/lockable_io_handle.hpp @@ -105,7 +105,6 @@ public: for a RAII locker. \errors Any of the values POSIX `flock()` can return. \mallocs The default synchronous implementation in `file_handle` performs no memory allocation. - The asynchronous implementation in `async_file_handle` performs one calloc and one free. */ LLFIO_HEADERS_ONLY_VIRTUAL_SPEC result<void> lock_file() noexcept; /*! \brief Tries to lock the inode referred to by the open handle for exclusive access, @@ -115,7 +114,6 @@ public: for a RAII locker. \errors Any of the values POSIX `flock()` can return. \mallocs The default synchronous implementation in `file_handle` performs no memory allocation. - The asynchronous implementation in `async_file_handle` performs one calloc and one free. */ LLFIO_HEADERS_ONLY_VIRTUAL_SPEC bool try_lock_file() noexcept; /*! \brief Unlocks a previously acquired exclusive lock. @@ -128,7 +126,6 @@ public: for a RAII locker. \errors Any of the values POSIX `flock()` can return. \mallocs The default synchronous implementation in `file_handle` performs no memory allocation. - The asynchronous implementation in `async_file_handle` performs one calloc and one free. */ LLFIO_HEADERS_ONLY_VIRTUAL_SPEC result<void> lock_file_shared() noexcept; /*! \brief Tries to lock the inode referred to by the open handle for shared access, @@ -138,7 +135,6 @@ public: for a RAII locker. \errors Any of the values POSIX `flock()` can return. \mallocs The default synchronous implementation in `file_handle` performs no memory allocation. - The asynchronous implementation in `async_file_handle` performs one calloc and one free. */ LLFIO_HEADERS_ONLY_VIRTUAL_SPEC bool try_lock_file_shared() noexcept; /*! \brief Unlocks a previously acquired shared lock. @@ -268,7 +264,6 @@ public: returned if deadline i/o is not possible with this particular handle configuration (e.g. non-overlapped HANDLE on Windows). \mallocs The default synchronous implementation in file_handle performs no memory allocation. - The asynchronous implementation in async_file_handle performs one calloc and one free. */ LLFIO_HEADERS_ONLY_VIRTUAL_SPEC result<extent_guard> lock_file_range(extent_type offset, extent_type bytes, lock_kind kind, deadline d = deadline()) noexcept; //! \overload EXTENSION: Locks for shared access diff --git a/include/llfio/v2.0/mapped_file_handle.hpp b/include/llfio/v2.0/mapped_file_handle.hpp index 14c228c9..17b7a40f 100644 --- a/include/llfio/v2.0/mapped_file_handle.hpp +++ b/include/llfio/v2.0/mapped_file_handle.hpp @@ -37,8 +37,7 @@ LLFIO_V2_NAMESPACE_EXPORT_BEGIN <table> <tr><th></th><th>Cost of opening</th><th>Cost of i/o</th><th>Concurrency and Atomicity</th><th>Other remarks</th></tr> <tr><td>`file_handle`</td><td>Least</td><td>Syscall</td><td>POSIX guarantees (usually)</td><td>Least gotcha</td></tr> -<tr><td>`async_file_handle`</td><td>More</td><td>Most (syscall + malloc/free + reactor)</td><td>POSIX guarantees (usually)</td><td>Makes no sense to use with -cached i/o as it's a very expensive way to call `memcpy()`</td></tr> <tr><td>`mapped_file_handle`</td><td>Most</td><td>Least</td><td>None</td><td>Cannot be used +<tr><td>`mapped_file_handle`</td><td>Most</td><td>Least</td><td>None</td><td>Cannot be used with uncached i/o</td></tr> </table> diff --git a/release_notes.md b/release_notes.md index 436b4d03..a01c6cd1 100644 --- a/release_notes.md +++ b/release_notes.md @@ -68,7 +68,7 @@ Todo list for already implemented parts: https://ned14.github.io/llfio/todo.html | ✔ | ✔ | Universal native handle/fd abstraction instead of `void *`. | ✔ | ✔ | Perfectly/Ideally low memory (de)allocation per op (usually none). | ✔ | ✔ | noexcept API throughout returning error_code for failure instead of throwing exceptions. -| ✔ | ✔ | LLFIO v1 handle type split into hierarchy of types:<ol><li>handle - provides open, close, get path, clone, set/unset append only, change caching, characteristics<li>fs_handle - handles with an inode number<li>path_handle - a race free anchor to a subset of the filesystem<li>directory_handle - enumerates the filesystem<li>io_handle - adds synchronous scatter-gather i/o, byte range locking<li>file_handle - adds open/create file, get and set maximum extent<li>async_file_handle - adds asynchronous scatter-gather i/o<li>mapped_file_handle - adds low latency memory mapped scatter-gather i/o</ol> +| ✔ | ✔ | LLFIO v1 handle type split into hierarchy of types:<ol><li>handle - provides open, close, get path, clone, set/unset append only, change caching, characteristics<li>fs_handle - handles with an inode number<li>path_handle - a race free anchor to a subset of the filesystem<li>directory_handle - enumerates the filesystem<li>io_handle - adds synchronous scatter-gather i/o, byte range locking<li>file_handle - adds open/create file, get and set maximum extent<li>mapped_file_handle - adds low latency memory mapped scatter-gather i/o</ol> | ✔ | ✔ | Cancelable i/o (made possible thanks to dropping XP support). | ✔ | ✔ | All shared_ptr usage removed as all use of multiple threads removed. | ✔ | ✔ | Use of std::vector to transport scatter-gather sequences replaced with C++ 20 `span<>` borrowed views. @@ -125,7 +125,6 @@ Todo: | | ✔ | ✔ | Directory handles and very fast directory enumeration ported over from LLFIO v1. | ✔ | ✔ | ✔ | `shared_fs_mutex` shared/exclusive entities locking based on safe byte ranges | | ✔ | ✔ | Set random or sequential i/o (prefetch). -| ✔ | ✔ | ✔ | i/o on `async_file_handle` is coroutines awaitable. | ✔ | ✔ | ✔ | `llfio::algorithm::trivial_vector<T>` with constant time reallocation if `T` is trivially copyable. | | ✔ | ✔ | `symlink_handle`. | ✔ | ✔ | ✔ | Large, huge and massive page size support for memory allocation and (POSIX only) file maps. |