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:
authorNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2018-07-06 21:07:06 +0300
committerNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2018-07-06 21:07:06 +0300
commit302db08dd88a5e77fb40103ed632be1e72066bf1 (patch)
treef59f570917859f7f02c354c86667abf2721d9a85
parent6efe2493a65540d3f484a8b7f27d5298d49c9da4 (diff)
More afio => llfio
-rw-r--r--.ci.cmake78
-rw-r--r--.docs.cmake4
-rw-r--r--.gitmodules6
-rw-r--r--.travis.yml16
-rw-r--r--CTestConfig.cmake2
-rw-r--r--appveyor.yml6
-rw-r--r--attic/doc/doxy/doxygen_input/pages/doxygen_mainpage.hpp2
-rw-r--r--attic/example/adopt_example.cpp34
-rw-r--r--attic/example/barrier_example.cpp18
-rw-r--r--attic/example/benchmark_asio.cpp6
-rw-r--r--attic/example/benchmark_atomic_log.cpp2
-rw-r--r--attic/example/benchmark_chained1.cpp6
-rw-r--r--attic/example/benchmark_chained2.cpp4
-rw-r--r--attic/example/benchmark_latency.cpp12
-rw-r--r--attic/example/benchmark_unchained1.cpp6
-rw-r--r--attic/example/benchmark_unchained2.cpp4
-rw-r--r--attic/example/call_example.cpp6
-rw-r--r--attic/example/closure_execution_afio_io_example.cpp18
-rw-r--r--attic/example/closure_execution_traditional_io_example.cpp2
-rw-r--r--attic/example/completion_example1.cpp24
-rw-r--r--attic/example/completion_example2.cpp32
-rw-r--r--attic/example/determine_legal_filenames.cpp8
-rw-r--r--attic/example/enumerate_example.cpp16
-rw-r--r--attic/example/filecopy_example.cpp24
-rw-r--r--attic/example/filedir_example.cpp32
-rw-r--r--attic/example/filter_example.cpp6
-rw-r--r--attic/example/find_in_files_afio.cpp20
-rw-r--r--attic/example/find_in_files_iostreams.cpp4
-rw-r--r--attic/example/readallof_example.cpp4
-rw-r--r--attic/example/readwrite_example.cpp24
-rw-r--r--attic/example/readwrite_example_traditional.cpp4
-rw-r--r--attic/example/statfs_example.cpp10
-rw-r--r--attic/example/workshop_atomic_updates_afio.cpp4
-rw-r--r--attic/example/workshop_atomic_updates_afio.ipp82
-rw-r--r--attic/example/workshop_benchmark.cpp14
-rw-r--r--attic/example/workshop_final_afio.cpp4
-rw-r--r--attic/example/workshop_final_afio.ipp130
-rw-r--r--attic/example/workshop_naive.cpp2
-rw-r--r--attic/example/workshop_naive_afio.cpp4
-rw-r--r--attic/example/workshop_naive_afio.ipp56
-rw-r--r--attic/example/workshop_naive_async_afio.cpp4
-rw-r--r--attic/example/workshop_naive_async_afio.ipp66
-rw-r--r--attic/include/boost/afio/v2/afio.hpp36
-rw-r--r--attic/include/boost/afio/v2/config.hpp6
-rw-r--r--attic/include/boost/afio/v2/detail/Utility.hpp8
-rw-r--r--attic/include/boost/afio/v2/detail/impl/ErrorHandling.ipp10
-rw-r--r--attic/include/boost/afio/v2/detail/impl/afio.ipp34
-rw-r--r--attic/include/boost/afio/v2/detail/impl/afio_iocp.ipp10
-rw-r--r--attic/include/boost/afio/v2/detail/impl/nt_kernel_stuff.hpp2
-rw-r--r--attic/src/afio.cpp6
-rw-r--r--attic/test/afio_pch.hpp2
-rw-r--r--attic/test/test_functions.hpp10
-rw-r--r--attic/test/test_inline_linkage1.cpp6
-rw-r--r--attic/test/test_inline_linkage2.cpp6
-rw-r--r--attic/test/tests/async_io_adopt_test.cpp10
-rw-r--r--example/single-header.cpp6
-rw-r--r--example/use_cases.cpp110
-rw-r--r--include/llfio.hpp2
-rw-r--r--include/llfio/afio.hpp4
-rw-r--r--include/llfio/v2.0/afio.hpp6
-rw-r--r--include/llfio/v2.0/config.hpp18
-rw-r--r--include/llfio/v2.0/deadline.h4
-rw-r--r--include/llfio/v2.0/detail/impl/posix/async_file_handle.ipp2
-rw-r--r--include/llfio/v2.0/detail/impl/posix/utils.ipp6
-rw-r--r--include/llfio/v2.0/detail/impl/windows/directory_handle.ipp2
-rw-r--r--include/llfio/v2.0/detail/impl/windows/utils.ipp6
-rw-r--r--include/llfio/v2.0/directory_handle.hpp6
-rw-r--r--include/llfio/v2.0/handle.hpp18
-rw-r--r--include/llfio/v2.0/logging.hpp4
-rw-r--r--include/llfio/v2.0/map_handle.hpp2
-rw-r--r--include/llfio/v2.0/native_handle_type.hpp2
-rw-r--r--include/llfio/v2.0/path_discovery.hpp4
-rw-r--r--include/llfio/v2.0/path_view.hpp2
-rw-r--r--include/llfio/v2.0/stat.hpp2
-rw-r--r--include/llfio/v2.0/statfs.hpp2
-rw-r--r--include/llfio/v2.0/status_code.hpp8
-rw-r--r--include/llfio/v2.0/utils.hpp4
-rw-r--r--programs/CMakeLists.txt14
-rw-r--r--programs/benchmark-iostreams/main.cpp34
-rw-r--r--programs/benchmark-locking/main.cpp46
-rw-r--r--programs/fs-probe/main.cpp2
-rw-r--r--programs/key-value-store/include/key_value_store.hpp102
-rw-r--r--src/llfio.cpp (renamed from src/afio.cpp)2
-rw-r--r--test/test_kernel_decl.hpp10
-rw-r--r--test/tests/async_io.cpp24
-rw-r--r--test/tests/coroutines.cpp24
-rw-r--r--test/tests/current_path.cpp20
-rw-r--r--test/tests/directory_handle_create_close/runner.cpp4
-rw-r--r--test/tests/directory_handle_enumerate/runner.cpp2
-rw-r--r--test/tests/file_handle_create_close/runner.cpp8
-rw-r--r--test/tests/file_handle_lock_unlock.cpp14
-rw-r--r--test/tests/map_handle_create_close/runner.cpp2
-rw-r--r--test/tests/mapped_span.cpp4
-rw-r--r--test/tests/path_discovery.cpp12
-rw-r--r--test/tests/path_view.cpp44
-rw-r--r--test/tests/section_handle_create_close/runner.cpp2
-rw-r--r--test/tests/shared_fs_mutex.cpp86
-rw-r--r--test/tests/trivial_vector.cpp10
98 files changed, 819 insertions, 819 deletions
diff --git a/.ci.cmake b/.ci.cmake
index 90aa9e1b..99a4acf5 100644
--- a/.ci.cmake
+++ b/.ci.cmake
@@ -5,7 +5,7 @@ include(cmake/QuickCppLibBootstrap.cmake)
include(QuickCppLibUtils)
-CONFIGURE_CTEST_SCRIPT_FOR_CDASH("afio" "prebuilt")
+CONFIGURE_CTEST_SCRIPT_FOR_CDASH("llfio" "prebuilt")
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
include(FindGit)
set(CTEST_GIT_COMMAND "${GIT_EXECUTABLE}")
@@ -15,62 +15,62 @@ ctest_update()
ctest_configure(OPTIONS ${CTEST_CONFIGURE_OPTIONS})
ctest_build(TARGET _dl)
ctest_build(TARGET _sl)
-ctest_test(RETURN_VALUE retval EXCLUDE "afio_hl|shared_fs_mutex")
+ctest_test(RETURN_VALUE retval EXCLUDE "llfio_hl|shared_fs_mutex")
if(WIN32)
- if(EXISTS "prebuilt/bin/Release/afio_dl-2.0-Windows-x64-Release.dll")
+ if(EXISTS "prebuilt/bin/Release/llfio_dl-2.0-Windows-x64-Release.dll")
checked_execute_process("Tarring up binaries 1"
- COMMAND "${CMAKE_COMMAND}" -E make_directory afio/prebuilt/bin/Release
- COMMAND "${CMAKE_COMMAND}" -E make_directory afio/prebuilt/lib/Release
- COMMAND xcopy doc afio\\doc\\ /s /q
- COMMAND xcopy include afio\\include\\ /s /q
+ COMMAND "${CMAKE_COMMAND}" -E make_directory llfio/prebuilt/bin/Release
+ COMMAND "${CMAKE_COMMAND}" -E make_directory llfio/prebuilt/lib/Release
+ COMMAND xcopy doc llfio\\doc\\ /s /q
+ COMMAND xcopy include llfio\\include\\ /s /q
)
checked_execute_process("Tarring up binaries 2"
- COMMAND "${CMAKE_COMMAND}" -E copy Readme.md afio/
- COMMAND "${CMAKE_COMMAND}" -E copy release_notes.md afio/
+ COMMAND "${CMAKE_COMMAND}" -E copy Readme.md llfio/
+ COMMAND "${CMAKE_COMMAND}" -E copy release_notes.md llfio/
)
checked_execute_process("Tarring up binaries 3"
- COMMAND "${CMAKE_COMMAND}" -E copy prebuilt/lib/Release/afio_sl-2.0-Windows-x64-Release.lib afio/prebuilt/lib/Release/
- COMMAND "${CMAKE_COMMAND}" -E copy prebuilt/lib/Release/ntkernel-error-category_sl.lib afio/prebuilt/lib/Release/
+ COMMAND "${CMAKE_COMMAND}" -E copy prebuilt/lib/Release/llfio_sl-2.0-Windows-x64-Release.lib llfio/prebuilt/lib/Release/
+ COMMAND "${CMAKE_COMMAND}" -E copy prebuilt/lib/Release/ntkernel-error-category_sl.lib llfio/prebuilt/lib/Release/
)
checked_execute_process("Tarring up binaries 4"
- COMMAND "${CMAKE_COMMAND}" -E copy prebuilt/lib/Release/afio_dl-2.0-Windows-x64-Release.lib afio/prebuilt/lib/Release/
- COMMAND "${CMAKE_COMMAND}" -E copy prebuilt/lib/Release/ntkernel-error-category_dl.lib afio/prebuilt/lib/Release/
+ COMMAND "${CMAKE_COMMAND}" -E copy prebuilt/lib/Release/llfio_dl-2.0-Windows-x64-Release.lib llfio/prebuilt/lib/Release/
+ COMMAND "${CMAKE_COMMAND}" -E copy prebuilt/lib/Release/ntkernel-error-category_dl.lib llfio/prebuilt/lib/Release/
)
checked_execute_process("Tarring up binaries 5"
- COMMAND "${CMAKE_COMMAND}" -E copy prebuilt/bin/Release/afio_dl-2.0-Windows-x64-Release.dll afio/prebuilt/bin/Release/
- COMMAND "${CMAKE_COMMAND}" -E copy prebuilt/bin/Release/ntkernel-error-category_dl.dll afio/prebuilt/bin/Release/
+ COMMAND "${CMAKE_COMMAND}" -E copy prebuilt/bin/Release/llfio_dl-2.0-Windows-x64-Release.dll llfio/prebuilt/bin/Release/
+ COMMAND "${CMAKE_COMMAND}" -E copy prebuilt/bin/Release/ntkernel-error-category_dl.dll llfio/prebuilt/bin/Release/
)
checked_execute_process("Tarring up binaries final"
- COMMAND 7z a -tzip afio-v2.0-binaries-win64.zip afio\\
+ COMMAND 7z a -tzip llfio-v2.0-binaries-win64.zip llfio\\
)
- get_filename_component(toupload afio-v2.0-binaries-win64.zip ABSOLUTE)
+ get_filename_component(toupload llfio-v2.0-binaries-win64.zip ABSOLUTE)
endif()
else()
- if(EXISTS "prebuilt/lib/libafio_dl-2.0-Linux-x86_64-Release.so")
+ if(EXISTS "prebuilt/lib/libllfio_dl-2.0-Linux-x86_64-Release.so")
checked_execute_process("Tarring up binaries"
- COMMAND mkdir afio
- COMMAND cp -a doc afio/
- COMMAND cp -a include afio/
- COMMAND cp -a Readme.md afio/
- COMMAND cp -a release_notes.md afio/
- COMMAND cp -a --parents prebuilt/lib/libafio_sl-2.0-Linux-x86_64-Release.a afio/
- COMMAND cp -a --parents prebuilt/lib/libafio_dl-2.0-Linux-x86_64-Release.so afio/
- COMMAND "${CMAKE_COMMAND}" -E tar cfz afio-v2.0-binaries-linux64.tgz afio
+ COMMAND mkdir llfio
+ COMMAND cp -a doc llfio/
+ COMMAND cp -a include llfio/
+ COMMAND cp -a Readme.md llfio/
+ COMMAND cp -a release_notes.md llfio/
+ COMMAND cp -a --parents prebuilt/lib/libllfio_sl-2.0-Linux-x86_64-Release.a llfio/
+ COMMAND cp -a --parents prebuilt/lib/libllfio_dl-2.0-Linux-x86_64-Release.so llfio/
+ COMMAND "${CMAKE_COMMAND}" -E tar cfz llfio-v2.0-binaries-linux64.tgz llfio
)
- get_filename_component(toupload afio-v2.0-binaries-linux64.tgz ABSOLUTE)
+ get_filename_component(toupload llfio-v2.0-binaries-linux64.tgz ABSOLUTE)
endif()
- if(EXISTS "prebuilt/lib/libafio_dl-2.0-Darwin-x86_64-Release.so")
+ if(EXISTS "prebuilt/lib/libllfio_dl-2.0-Darwin-x86_64-Release.so")
checked_execute_process("Tarring up binaries"
- COMMAND mkdir afio
- COMMAND cp -a doc afio/
- COMMAND cp -a include afio/
- COMMAND cp -a Readme.md afio/
- COMMAND cp -a release_notes.md afio/
- COMMAND cp -a --parents prebuilt/lib/libafio_sl-2.0-Darwin-x86_64-Release.a afio/
- COMMAND cp -a --parents prebuilt/lib/libafio_dl-2.0-Darwin-x86_64-Release.dylib afio/
- COMMAND "${CMAKE_COMMAND}" -E tar cfz afio-v2.0-binaries-darwin64.tgz afio
+ COMMAND mkdir llfio
+ COMMAND cp -a doc llfio/
+ COMMAND cp -a include llfio/
+ COMMAND cp -a Readme.md llfio/
+ COMMAND cp -a release_notes.md llfio/
+ COMMAND cp -a --parents prebuilt/lib/libllfio_sl-2.0-Darwin-x86_64-Release.a llfio/
+ COMMAND cp -a --parents prebuilt/lib/libllfio_dl-2.0-Darwin-x86_64-Release.dylib llfio/
+ COMMAND "${CMAKE_COMMAND}" -E tar cfz llfio-v2.0-binaries-darwin64.tgz llfio
)
- get_filename_component(toupload afio-v2.0-binaries-darwin64.tgz ABSOLUTE)
+ get_filename_component(toupload llfio-v2.0-binaries-darwin64.tgz ABSOLUTE)
endif()
endif()
set(retval2 0)
@@ -79,13 +79,13 @@ if(("$ENV{CXX}" MATCHES "clang") OR ("$ENV{CXX}" MATCHES "g\\+\\+"))
if("$ENV{CXX}" MATCHES "clang")
ctest_build(TARGET _sl-asan)
set(CTEST_CONFIGURATION_TYPE "asan")
- ctest_test(RETURN_VALUE retval2 INCLUDE "afio_sl" EXCLUDE "shared_fs_mutex")
+ ctest_test(RETURN_VALUE retval2 INCLUDE "llfio_sl" EXCLUDE "shared_fs_mutex")
else()
set(retval2 0)
endif()
ctest_build(TARGET _sl-ubsan)
set(CTEST_CONFIGURATION_TYPE "ubsan")
- ctest_test(RETURN_VALUE retval3 INCLUDE "afio_sl" EXCLUDE "shared_fs_mutex")
+ ctest_test(RETURN_VALUE retval3 INCLUDE "llfio_sl" EXCLUDE "shared_fs_mutex")
endif()
merge_junit_results_into_ctest_xml()
if(EXISTS "${toupload}")
diff --git a/.docs.cmake b/.docs.cmake
index 9348195c..8763e385 100644
--- a/.docs.cmake
+++ b/.docs.cmake
@@ -4,7 +4,7 @@ include(cmake/QuickCppLibBootstrap.cmake)
include(QuickCppLibUtils)
-CONFIGURE_CTEST_SCRIPT_FOR_CDASH("afio" "cmake_ci")
+CONFIGURE_CTEST_SCRIPT_FOR_CDASH("llfio" "cmake_ci")
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
include(FindGit)
set(CTEST_GIT_COMMAND "${GIT_EXECUTABLE}")
@@ -21,7 +21,7 @@ checked_execute_process("git reset"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/doc/html"
)
ctest_configure()
-ctest_build(TARGET afio_docs)
+ctest_build(TARGET llfio_docs)
#checked_execute_process("git commit"
# COMMAND "${GIT_EXECUTABLE}" commit -a -m "upd"
# COMMAND "${GIT_EXECUTABLE}" push -f origin gh-pages
diff --git a/.gitmodules b/.gitmodules
index 8cde6ef0..78188e3b 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -5,7 +5,7 @@
fetchRecurseSubmodules = true
ignore = none
# shallow = true
-[submodule "include/afio/v2.0/outcome"]
+[submodule "include/llfio/v2.0/outcome"]
path = include/llfio/v2.0/outcome
url = https://github.com/ned14/outcome.git
branch = master
@@ -19,14 +19,14 @@
fetchRecurseSubmodules = true
ignore = untracked
# shallow = true
-[submodule "include/afio/v2.0/quickcpplib"]
+[submodule "include/llfio/v2.0/quickcpplib"]
path = include/llfio/v2.0/quickcpplib
url = https://github.com/ned14/quickcpplib
branch = master
fetchRecurseSubmodules = true
ignore = untracked
# shallow = true
-[submodule "include/afio/ntkernel-error-category"]
+[submodule "include/llfio/ntkernel-error-category"]
path = include/llfio/ntkernel-error-category
url = https://github.com/ned14/ntkernel-error-category.git
branch = master
diff --git a/.travis.yml b/.travis.yml
index 84d65b19..03e29834 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -35,7 +35,7 @@ env:
- secure: "A3TeWTlJdjUaQ31NF60kMOik8mzaJkdKA55jZXjN83BJ2ZjMDmWfq1XmZ7iDIxmn7HC2BVpjhdkj9jpRtPztb08L5VSlJIiVbXlBWNwgzmYANujpR9rA+bhZJwlKDaYQHUZUd4+iGHCHb0dLt2HG0eHF5azaifd0YqCfz5GcWl8="
matrix:
- __="cmake tests (error_code)" NAME=TravisLinuxWorkerEC CMAKE_CONFIGURE_OPTIONS=
- - __="cmake tests (status_code)" NAME=TravisLinuxWorkerSC CMAKE_CONFIGURE_OPTIONS=-DAFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE=ON
+ - __="cmake tests (status_code)" NAME=TravisLinuxWorkerSC CMAKE_CONFIGURE_OPTIONS=-DLLFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE=ON
# - __="cmake tests" NAME=TravisOSXWorker
- __="Documentation" NAME=TravisDocumentation
- __="Programs"
@@ -49,7 +49,7 @@ matrix:
# - os: osx
# env: __="cmake tests (error_code)" NAME=TravisLinuxWorkerEC CMAKE_CONFIGURE_OPTIONS=
# - os: osx
-# env: __="cmake tests (status_code)" NAME=TravisLinuxWorkerSC CMAKE_CONFIGURE_OPTIONS=-DAFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE=ON
+# env: __="cmake tests (status_code)" NAME=TravisLinuxWorkerSC CMAKE_CONFIGURE_OPTIONS=-DLLFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE=ON
- os: linux
compiler: g++
env: __="Documentation" NAME=TravisDocumentation
@@ -104,7 +104,7 @@ script:
cd doc/html;
git add . || true;
git commit -a -m "Travis CI updates documentation" || true;
- git push -f https://jenkins-nedprod:$JENKINS_NEDPROD_PASSWORD@github.com/ned14/boost.afio gh-pages;
+ git push -f https://jenkins-nedprod:$JENKINS_NEDPROD_PASSWORD@github.com/ned14/llfio gh-pages;
cd ../..;
fi
-
@@ -118,15 +118,15 @@ script:
after_success:
# - bash -x ./update_coveralls.sh `pwd`
-# - NEWNAME=afio-v2.0-binaries-linux64-$(date +%Y%m%d%H%M%S).tgz
+# - NEWNAME=llfio-v2.0-binaries-linux64-$(date +%Y%m%d%H%M%S).tgz
- if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "$CXX" = "clang++-4.0" ] && [ "$__" = "cmake tests (error_code)" ]; then
- NEWNAME=afio-v2.0-binaries-linux64-$TRAVIS_COMMIT.tgz;
- mv afio-v2.0-binaries-linux64.tgz $NEWNAME;
+ NEWNAME=llfio-v2.0-binaries-linux64-$TRAVIS_COMMIT.tgz;
+ mv llfio-v2.0-binaries-linux64.tgz $NEWNAME;
curl -T $NEWNAME -u jenkins-nedprod:$JENKINS_NEDPROD_PASSWORD https://dedi5.nedprod.com/static/files/upload/;
fi
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
- NEWNAME=afio-v2.0-binaries-darwin64-$TRAVIS_COMMIT.tgz;
- mv afio-v2.0-binaries-darwin64.tgz $NEWNAME;
+ NEWNAME=llfio-v2.0-binaries-darwin64-$TRAVIS_COMMIT.tgz;
+ mv llfio-v2.0-binaries-darwin64.tgz $NEWNAME;
curl -T $NEWNAME -u jenkins-nedprod:$JENKINS_NEDPROD_PASSWORD https://dedi5.nedprod.com/static/files/upload/;
fi
diff --git a/CTestConfig.cmake b/CTestConfig.cmake
index 1c2cca41..75616d63 100644
--- a/CTestConfig.cmake
+++ b/CTestConfig.cmake
@@ -6,7 +6,7 @@
## ENABLE_TESTING()
## INCLUDE(CTest)
-set(CTEST_PROJECT_NAME "AFIO")
+set(CTEST_PROJECT_NAME "LLFIO")
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
set(CTEST_DROP_METHOD "http")
diff --git a/appveyor.yml b/appveyor.yml
index fad7da02..1ae2f8da 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -32,9 +32,9 @@ test_script:
after_test:
on_success:
-# - set "NEWNAME=afio-v2.0-binaries-win64-%date:~10,4%%date:~4,2%%date:~7,2%%time:~0,2%%time:~3,2%.zip"
- - set "NEWNAME=afio-v2.0-binaries-win64-%APPVEYOR_REPO_COMMIT%.zip"
- - rename afio-v2.0-binaries-win64.zip %NEWNAME%
+# - set "NEWNAME=llfio-v2.0-binaries-win64-%date:~10,4%%date:~4,2%%date:~7,2%%time:~0,2%%time:~3,2%.zip"
+ - set "NEWNAME=llfio-v2.0-binaries-win64-%APPVEYOR_REPO_COMMIT%.zip"
+ - rename llfio-v2.0-binaries-win64.zip %NEWNAME%
- curl -T %NEWNAME% -u jenkins-nedprod:%JENKINS_NEDPROD_PASSWORD% https://dedi5.nedprod.com/static/files/upload/
on_failure:
on_finish:
diff --git a/attic/doc/doxy/doxygen_input/pages/doxygen_mainpage.hpp b/attic/doc/doxy/doxygen_input/pages/doxygen_mainpage.hpp
index e406719a..88417b03 100644
--- a/attic/doc/doxy/doxygen_input/pages/doxygen_mainpage.hpp
+++ b/attic/doc/doxy/doxygen_input/pages/doxygen_mainpage.hpp
@@ -15,7 +15,7 @@
\mainpage Boost.AFIO
Welcome to the Boost.AFIO documentation. You may find the more formal documentation at
-http://boostgsoc13.github.io/boost.afio/ of use. It also includes a full reference manual.
+http://boostgsoc13.github.io/boost.llfio/ of use. It also includes a full reference manual.
*/
diff --git a/attic/example/adopt_example.cpp b/attic/example/adopt_example.cpp
index b18e9827..d068c67c 100644
--- a/attic/example/adopt_example.cpp
+++ b/attic/example/adopt_example.cpp
@@ -1,11 +1,11 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
//[adopt_example
-struct test_handle : boost::afio::handle
+struct test_handle : boost::llfio::handle
{
- test_handle(boost::afio::dispatcher *parent) :
- boost::afio::handle(parent,
- boost::afio::file_flags::none) {}
+ test_handle(boost::llfio::dispatcher *parent) :
+ boost::llfio::handle(parent,
+ boost::llfio::file_flags::none) {}
virtual void close() override final
{
// Do nothing
@@ -18,30 +18,30 @@ struct test_handle : boost::afio::handle
{
return nullptr;
}
- virtual boost::afio::path path(bool refresh=false) override final
+ virtual boost::llfio::path path(bool refresh=false) override final
{
- return boost::afio::path();
+ return boost::llfio::path();
}
- virtual boost::afio::path path() const override final
+ virtual boost::llfio::path path() const override final
{
- return boost::afio::path();
+ return boost::llfio::path();
}
- virtual boost::afio::directory_entry direntry(boost::afio::metadata_flags
- wanted=boost::afio::directory_entry::metadata_fastpath()) override final
+ virtual boost::llfio::directory_entry direntry(boost::llfio::metadata_flags
+ wanted=boost::llfio::directory_entry::metadata_fastpath()) override final
{
- return boost::afio::directory_entry();
+ return boost::llfio::directory_entry();
}
- virtual boost::afio::path target() override final
+ virtual boost::llfio::path target() override final
{
- return boost::afio::path();
+ return boost::llfio::path();
}
- virtual void link(const boost::afio::path_req &req) override final
+ virtual void link(const boost::llfio::path_req &req) override final
{
}
virtual void unlink() override final
{
}
- virtual void atomic_relink(const boost::afio::path_req &req) override final
+ virtual void atomic_relink(const boost::llfio::path_req &req) override final
{
}
};
@@ -49,7 +49,7 @@ struct test_handle : boost::afio::handle
int main(void)
{
using namespace BOOST_AFIO_V2_NAMESPACE;
- auto dispatcher = boost::afio::make_dispatcher().get();
+ auto dispatcher = boost::llfio::make_dispatcher().get();
current_dispatcher_guard h(dispatcher);
auto foreignh=std::make_shared<test_handle>(dispatcher.get());
return 0;
diff --git a/attic/example/barrier_example.cpp b/attic/example/barrier_example.cpp
index 46a739f2..72707cde 100644
--- a/attic/example/barrier_example.cpp
+++ b/attic/example/barrier_example.cpp
@@ -1,4 +1,4 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
int main(void)
{
@@ -10,19 +10,19 @@ int main(void)
// parallel ops and a barrier which completes only when the last of that
// parallel group completes. Chain the next group to only execute after the
// preceding group's barrier completes. Repeat until all groups have been executed.
- std::shared_ptr<boost::afio::dispatcher> dispatcher=
- boost::afio::make_dispatcher().get();
+ std::shared_ptr<boost::llfio::dispatcher> dispatcher=
+ boost::llfio::make_dispatcher().get();
std::vector<std::pair<size_t, int>> groups;
- boost::afio::atomic<size_t> callcount[10000];
+ boost::llfio::atomic<size_t> callcount[10000];
memset(&callcount, 0, sizeof(callcount));
// This lambda is what each parallel op in each group will do: increment an atomic
// for that group.
- auto inccount = [](boost::afio::atomic<size_t> *count){ (*count)++; };
+ auto inccount = [](boost::llfio::atomic<size_t> *count){ (*count)++; };
// This lambda is called after each barrier completes, and it checks that exactly
// the right number of inccount lambdas were executed.
- auto verifybarrier = [](boost::afio::atomic<size_t> *count, size_t shouldbe)
+ auto verifybarrier = [](boost::llfio::atomic<size_t> *count, size_t shouldbe)
{
if (*count != shouldbe)
throw std::runtime_error("Count was not what it should have been!");
@@ -30,14 +30,14 @@ int main(void)
};
// For each group, dispatch ops and a barrier for them
- boost::afio::future<> next;
+ boost::llfio::future<> next;
bool isfirst = true;
for(auto &run : groups)
{
// Create a vector of run.first size of bound inccount lambdas
// This will be the batch issued for this group
std::vector<std::function<void()>> thisgroupcalls(run.first, std::bind(inccount, &callcount[run.second]));
- std::vector<boost::afio::future<>> thisgroupcallops;
+ std::vector<boost::llfio::future<>> thisgroupcallops;
// If this is the first item, schedule without precondition
if (isfirst)
{
@@ -49,7 +49,7 @@ int main(void)
// Create a vector of run.first size of preconditions exactly
// matching the number in this batch. Note that the precondition
// for all of these is the preceding verify op
- std::vector<boost::afio::future<>> dependency(run.first, next);
+ std::vector<boost::llfio::future<>> dependency(run.first, next);
thisgroupcallops = dispatcher->call(dependency, thisgroupcalls);
}
// barrier() is very easy: its number of output ops exactly matches its input
diff --git a/attic/example/benchmark_asio.cpp b/attic/example/benchmark_asio.cpp
index 45de6e45..e7276bc5 100644
--- a/attic/example/benchmark_asio.cpp
+++ b/attic/example/benchmark_asio.cpp
@@ -1,10 +1,10 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
/* My Intel Core i7 3770K running Windows 8 x64: 2591360 closures/sec
My Intel Core i7 3770K running Linux x64: 1611040 closures/sec (4 threads)
*/
-static boost::afio::atomic<size_t> togo(0);
+static boost::llfio::atomic<size_t> togo(0);
static int callback()
{
#if 0
@@ -15,7 +15,7 @@ static int callback()
};
int main(void)
{
- using namespace boost::afio;
+ using namespace boost::llfio;
typedef chrono::duration<double, ratio<1, 1>> secs_type;
auto threadpool=process_threadpool();
auto begin=chrono::high_resolution_clock::now();
diff --git a/attic/example/benchmark_atomic_log.cpp b/attic/example/benchmark_atomic_log.cpp
index ab046837..5b6cd48a 100644
--- a/attic/example/benchmark_atomic_log.cpp
+++ b/attic/example/benchmark_atomic_log.cpp
@@ -1,4 +1,4 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
/* On my Win8.1 x86 laptop Intel i5 540M @ 2.53Ghz on NTFS Samsung SSD:
diff --git a/attic/example/benchmark_chained1.cpp b/attic/example/benchmark_chained1.cpp
index f40bf1c9..3b5edcef 100644
--- a/attic/example/benchmark_chained1.cpp
+++ b/attic/example/benchmark_chained1.cpp
@@ -1,10 +1,10 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
/* My Intel Core i7 3770K running Windows 8 x64: 726124 closures/sec
My Intel Core i7 3770K running Linux x64: 968005 closures/sec
*/
-static std::pair<bool, std::shared_ptr<boost::afio::handle>> _callback(size_t, boost::afio::future<> op)
+static std::pair<bool, std::shared_ptr<boost::llfio::handle>> _callback(size_t, boost::llfio::future<> op)
{
#if 0
// Simulate an i/o op with a context switch
@@ -15,7 +15,7 @@ static std::pair<bool, std::shared_ptr<boost::afio::handle>> _callback(size_t, b
int main(void)
{
- using namespace boost::afio;
+ using namespace boost::llfio;
auto dispatcher=make_dispatcher().get();
typedef chrono::duration<double, ratio<1, 1>> secs_type;
auto begin=chrono::high_resolution_clock::now();
diff --git a/attic/example/benchmark_chained2.cpp b/attic/example/benchmark_chained2.cpp
index d410076c..8e235836 100644
--- a/attic/example/benchmark_chained2.cpp
+++ b/attic/example/benchmark_chained2.cpp
@@ -1,4 +1,4 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
/* My Intel Core i7 3770K running Windows 8 x64: 596318 closures/sec
My Intel Core i7 3770K running Linux x64: 794384 closures/sec
@@ -14,7 +14,7 @@ static int callback()
int main(void)
{
- using namespace boost::afio;
+ using namespace boost::llfio;
auto dispatcher=make_dispatcher().get();
typedef chrono::duration<double, ratio<1, 1>> secs_type;
auto begin=chrono::high_resolution_clock::now();
diff --git a/attic/example/benchmark_latency.cpp b/attic/example/benchmark_latency.cpp
index f11422fd..df9970b0 100644
--- a/attic/example/benchmark_latency.cpp
+++ b/attic/example/benchmark_latency.cpp
@@ -1,4 +1,4 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
#include <thread>
#define ITERATIONS 10000
@@ -8,20 +8,20 @@
//#define MULTIPLIER 1000000 // output number of microseconds instead of seconds
#define MULTIPLIER 3900000000ULL // output number of CPU clocks instead of seconds
-typedef decltype(boost::afio::chrono::high_resolution_clock::now()) time_point;
+typedef decltype(boost::llfio::chrono::high_resolution_clock::now()) time_point;
size_t id_offset;
static time_point points[100000];
static time_point::duration overhead, timesliceoverhead, sleepoverhead;
-static std::pair<bool, std::shared_ptr<boost::afio::handle>> _callback(size_t id, boost::afio::future<> op)
+static std::pair<bool, std::shared_ptr<boost::llfio::handle>> _callback(size_t id, boost::llfio::future<> op)
{
- using namespace boost::afio;
+ using namespace boost::llfio;
points[id-id_offset]=chrono::high_resolution_clock::now();
return std::make_pair(true, op.get_handle());
};
int main(void)
{
- using namespace boost::afio;
+ using namespace boost::llfio;
auto dispatcher=make_dispatcher().get();
typedef chrono::duration<double, ratio<1, 1>> secs_type;
{
@@ -59,7 +59,7 @@ int main(void)
}
std::pair<async_op_flags, dispatcher::completion_t *> callback(async_op_flags::none, _callback);
- std::ofstream csv("afio_latencies.csv");
+ std::ofstream csv("llfio_latencies.csv");
csv << "Timing overhead is calculated to be," << chrono::duration_cast<secs_type>(overhead).count()
#ifdef MULTIPLIER
* MULTIPLIER
diff --git a/attic/example/benchmark_unchained1.cpp b/attic/example/benchmark_unchained1.cpp
index 2f9b6769..e5318a98 100644
--- a/attic/example/benchmark_unchained1.cpp
+++ b/attic/example/benchmark_unchained1.cpp
@@ -1,10 +1,10 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
/* My Intel Core i7 3770K running Windows 8 x64: 1555990 closures/sec
My Intel Core i7 3770K running Linux x64: 1432810 closures/sec
*/
-static std::pair<bool, std::shared_ptr<boost::afio::handle>> callback(size_t, boost::afio::future<> op)
+static std::pair<bool, std::shared_ptr<boost::llfio::handle>> callback(size_t, boost::llfio::future<> op)
{
#if 0
// Simulate an i/o op with a context switch
@@ -15,7 +15,7 @@ static std::pair<bool, std::shared_ptr<boost::afio::handle>> callback(size_t, bo
int main(void)
{
- using namespace boost::afio;
+ using namespace boost::llfio;
auto dispatcher=make_dispatcher().get();
typedef chrono::duration<double, ratio<1, 1>> secs_type;
auto begin=chrono::high_resolution_clock::now();
diff --git a/attic/example/benchmark_unchained2.cpp b/attic/example/benchmark_unchained2.cpp
index db9affe0..d8471ab3 100644
--- a/attic/example/benchmark_unchained2.cpp
+++ b/attic/example/benchmark_unchained2.cpp
@@ -1,4 +1,4 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
/* My Intel Core i7 3770K running Windows 8 x64: 911963 closures/sec
My Intel Core i7 3770K running Linux x64: 1094780 closures/sec
@@ -14,7 +14,7 @@ static int callback()
int main(void)
{
- using namespace boost::afio;
+ using namespace boost::llfio;
auto dispatcher=make_dispatcher().get();
typedef chrono::duration<double, ratio<1, 1>> secs_type;
auto begin=chrono::high_resolution_clock::now();
diff --git a/attic/example/call_example.cpp b/attic/example/call_example.cpp
index d4a72642..5bfc331b 100644
--- a/attic/example/call_example.cpp
+++ b/attic/example/call_example.cpp
@@ -1,14 +1,14 @@
//#define BOOST_RESULT_OF_USE_DECLTYPE 1
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
int main(void)
{
//[call_example
// Create a dispatcher instance
- auto dispatcher=boost::afio::make_dispatcher().get();
+ auto dispatcher=boost::llfio::make_dispatcher().get();
// Schedule an asynchronous call of some function with some bound set of arguments
- auto helloworld=dispatcher->call(boost::afio::future<>() /* no precondition */, [](std::string text) -> int {
+ auto helloworld=dispatcher->call(boost::llfio::future<>() /* no precondition */, [](std::string text) -> int {
std::cout << text << std::endl;
return 42;
}, std::string("Hello world"));
diff --git a/attic/example/closure_execution_afio_io_example.cpp b/attic/example/closure_execution_afio_io_example.cpp
index 96ac4808..fc5d80b3 100644
--- a/attic/example/closure_execution_afio_io_example.cpp
+++ b/attic/example/closure_execution_afio_io_example.cpp
@@ -1,6 +1,6 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
-//[closure_execution_afio_example
+//[closure_execution_llfio_example
#include <vector>
int main()
@@ -16,22 +16,22 @@ int main()
out_file.close();
- //set up the afio dispatcher
- auto dispatcher = boost::afio::make_dispatcher().get();
+ //set up the llfio dispatcher
+ auto dispatcher = boost::llfio::make_dispatcher().get();
//set up an array to hold our integers
int ary[ary_size];
//schedule the file open
- auto opened_file = dispatcher->file(boost::afio::path_req("somefile.dat",
- boost::afio::file_flags::read));
+ auto opened_file = dispatcher->file(boost::llfio::path_req("somefile.dat",
+ boost::llfio::file_flags::read));
//set up vectors for the individual read operations, and the work on each integer
- std::vector<boost::afio::future<>> read_ops(ary_size);
+ std::vector<boost::llfio::future<>> read_ops(ary_size);
std::vector<std::function<void()>> vec_func(ary_size);
for (int i = 0; i < ary_size; ++i)
{
- read_ops[i] = dispatcher->read(boost::afio::io_req<int>(opened_file,
+ read_ops[i] = dispatcher->read(boost::llfio::io_req<int>(opened_file,
&ary[i], sizeof(int), i*sizeof(int)));
vec_func[i] = std::bind([](int* a){ *a *= 2 ; }, &ary[i]);
@@ -44,7 +44,7 @@ int main()
auto closed_file = dispatcher->close(dispatcher->barrier(read_ops).front());
// make sure work has completed before trying to print data from the array
- boost::afio::when_all_p(work.begin(), work.end()).wait();
+ boost::llfio::when_all_p(work.begin(), work.end()).wait();
//verify the out put is as expected: "0, 2, 4, 6, 8, 10, 12, 14, 16, 18"
for (int i = 0; i < ary_size; ++i)
diff --git a/attic/example/closure_execution_traditional_io_example.cpp b/attic/example/closure_execution_traditional_io_example.cpp
index 62483edc..f36f3c3f 100644
--- a/attic/example/closure_execution_traditional_io_example.cpp
+++ b/attic/example/closure_execution_traditional_io_example.cpp
@@ -1,4 +1,4 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
//[closure_execution_traditional_example
#include <iostream>
diff --git a/attic/example/completion_example1.cpp b/attic/example/completion_example1.cpp
index 706a5e44..533a53d4 100644
--- a/attic/example/completion_example1.cpp
+++ b/attic/example/completion_example1.cpp
@@ -1,12 +1,12 @@
//#define BOOST_RESULT_OF_USE_DECLTYPE 1
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
int main(void)
{
//[completion_example1
// Create a dispatcher instance
- std::shared_ptr<boost::afio::dispatcher> dispatcher=
- boost::afio::make_dispatcher().get();
+ std::shared_ptr<boost::llfio::dispatcher> dispatcher=
+ boost::llfio::make_dispatcher().get();
// Completion handlers are the lowest level completion routine available, and therefore the least
// overhead but at the cost of considerable extra programmer effort. You almost certainly want
@@ -15,11 +15,11 @@ int main(void)
// First create some callable entity ...
auto completer=[](
/* These are always the standard parameters */
- size_t id, boost::afio::future<> precondition,
+ size_t id, boost::llfio::future<> precondition,
/* From now on user defined parameters */
std::string text)
/* This is always the return type */
- -> std::pair<bool, std::shared_ptr<boost::afio::handle>>
+ -> std::pair<bool, std::shared_ptr<boost::llfio::handle>>
{
/* id is the unique, non-zero integer id of this op.
precondition is the op you supplied as precondition. As it will by definition
@@ -35,8 +35,8 @@ int main(void)
return std::make_pair(true, precondition.get_handle());
};
- // Bind any user defined parameters to create a proper boost::afio::dispatcher::completion_t
- std::function<boost::afio::dispatcher::completion_t> boundf=
+ // Bind any user defined parameters to create a proper boost::llfio::dispatcher::completion_t
+ std::function<boost::llfio::dispatcher::completion_t> boundf=
std::bind(completer,
/* The standard parameters */
std::placeholders::_1, std::placeholders::_2,
@@ -44,13 +44,13 @@ int main(void)
std::string("Hello world"));
// Schedule an asynchronous call of the completion with some bound set of arguments
- boost::afio::future<> helloworld=
- dispatcher->completion(boost::afio::future<>() /* no precondition */,
- std::make_pair(boost::afio::async_op_flags::none, boundf));
+ boost::llfio::future<> helloworld=
+ dispatcher->completion(boost::llfio::future<>() /* no precondition */,
+ std::make_pair(boost::llfio::async_op_flags::none, boundf));
// Create a boost::stl_future<> representing the ops passed to when_all_p()
- boost::afio::stl_future<std::vector<std::shared_ptr<boost::afio::handle>>> stl_future
- =boost::afio::when_all_p(helloworld);
+ boost::llfio::stl_future<std::vector<std::shared_ptr<boost::llfio::handle>>> stl_future
+ =boost::llfio::when_all_p(helloworld);
// ... and wait for it to complete
stl_future.wait();
//]
diff --git a/attic/example/completion_example2.cpp b/attic/example/completion_example2.cpp
index 513eea77..0e10a976 100644
--- a/attic/example/completion_example2.cpp
+++ b/attic/example/completion_example2.cpp
@@ -1,12 +1,12 @@
//#define BOOST_RESULT_OF_USE_DECLTYPE 1
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
int main(void)
{
//[completion_example2
// Create a dispatcher instance
- std::shared_ptr<boost::afio::dispatcher> dispatcher=
- boost::afio::make_dispatcher().get();
+ std::shared_ptr<boost::llfio::dispatcher> dispatcher=
+ boost::llfio::make_dispatcher().get();
// One thing direct programming of completion handlers can do which call() cannot is immediate
// completions. These run immediately after the precondition finishes by the thread worker
@@ -14,18 +14,18 @@ int main(void)
// be useful for ensuring data is still cache-local for example.
// Create the completion, using the standard form
- auto completion=[](std::shared_ptr<boost::afio::dispatcher> dispatcher,
+ auto completion=[](std::shared_ptr<boost::llfio::dispatcher> dispatcher,
/* These are always the standard parameters */
- size_t id, boost::afio::future<> precondition)
+ size_t id, boost::llfio::future<> precondition)
/* This is always the return type */
- -> std::pair<bool, std::shared_ptr<boost::afio::handle>>
+ -> std::pair<bool, std::shared_ptr<boost::llfio::handle>>
{
std::cout << "I am completion" << std::endl;
// Create some callable entity which will do the actual completion. It can be
// anything you like, but you need a minimum of its integer id.
- auto completer=[](std::shared_ptr<boost::afio::dispatcher> dispatcher,
- size_t id, boost::afio::future<> op) -> int
+ auto completer=[](std::shared_ptr<boost::llfio::dispatcher> dispatcher,
+ size_t id, boost::llfio::future<> op) -> int
{
try
{
@@ -39,7 +39,7 @@ int main(void)
{
// In non-deferred completions AFIO traps exceptions for you. Here, you must
// do it by hand and tell AFIO about what exception state to return.
- boost::afio::exception_ptr e(boost::afio::current_exception());
+ boost::llfio::exception_ptr e(boost::llfio::current_exception());
dispatcher->complete_async_op(id, e);
}
return 0;
@@ -51,25 +51,25 @@ int main(void)
return std::make_pair(false, precondition.get_handle());
};
- // Bind any user defined parameters to create a proper boost::afio::dispatcher::completion_t
- std::function<boost::afio::dispatcher::completion_t> boundf=
+ // Bind any user defined parameters to create a proper boost::llfio::dispatcher::completion_t
+ std::function<boost::llfio::dispatcher::completion_t> boundf=
std::bind(completion, dispatcher,
/* The standard parameters */
std::placeholders::_1, std::placeholders::_2);
// Schedule an asynchronous call of the completion
- boost::afio::future<> op=
- dispatcher->completion(boost::afio::future<>() /* no precondition */,
+ boost::llfio::future<> op=
+ dispatcher->completion(boost::llfio::future<>() /* no precondition */,
std::make_pair(
/* Complete boundf immediately after its precondition (in this
case as there is no precondition that means right now before
completion() returns) */
- boost::afio::async_op_flags::immediate,
+ boost::llfio::async_op_flags::immediate,
boundf));
// Create a boost::stl_future<> representing the ops passed to when_all_p()
- boost::afio::stl_future<std::vector<std::shared_ptr<boost::afio::handle>>> stl_future
- =boost::afio::when_all_p(op);
+ boost::llfio::stl_future<std::vector<std::shared_ptr<boost::llfio::handle>>> stl_future
+ =boost::llfio::when_all_p(op);
// ... and wait for it to complete
stl_future.wait();
//]
diff --git a/attic/example/determine_legal_filenames.cpp b/attic/example/determine_legal_filenames.cpp
index 667b3f36..7b9db1db 100644
--- a/attic/example/determine_legal_filenames.cpp
+++ b/attic/example/determine_legal_filenames.cpp
@@ -1,9 +1,9 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
int main(void)
{
- using namespace boost::afio;
- auto dispatcher=boost::afio::make_dispatcher().get();
+ using namespace boost::llfio;
+ auto dispatcher=boost::llfio::make_dispatcher().get();
auto mkdir(dispatcher->dir(path_req("testdir", file_flags::create)));
try
@@ -14,7 +14,7 @@ int main(void)
path p(cs);
try
{
- auto mkfile(dispatcher->file(path_req::relative(mkdir, p, boost::afio::file_flags::create)));
+ auto mkfile(dispatcher->file(path_req::relative(mkdir, p, boost::llfio::file_flags::create)));
mkfile.get();
auto rmfile(dispatcher->close(dispatcher->rmfile(mkfile)));
std::cout << "Character " << n << " (" << p << ") is permitted on this operating system." << std::endl;
diff --git a/attic/example/enumerate_example.cpp b/attic/example/enumerate_example.cpp
index 35bac7a5..9f69dfe6 100644
--- a/attic/example/enumerate_example.cpp
+++ b/attic/example/enumerate_example.cpp
@@ -1,27 +1,27 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
int main(void)
{
//[enumerate_example
- boost::afio::current_dispatcher_guard h(boost::afio::make_dispatcher().get());
+ boost::llfio::current_dispatcher_guard h(boost::llfio::make_dispatcher().get());
// Schedule an opening of the root directory
- boost::afio::future<> rootdir(boost::afio::async_dir("/"));
+ boost::llfio::future<> rootdir(boost::llfio::async_dir("/"));
- std::pair<std::vector<boost::afio::directory_entry>, bool> list;
+ std::pair<std::vector<boost::llfio::directory_entry>, bool> list;
// This is used to reset the enumeration to the start
bool restart=true;
do
{
// Schedule an enumeration of an open directory handle
- boost::afio::future<std::pair<std::vector<boost::afio::directory_entry>, bool>>
- enumeration(boost::afio::async_enumerate(rootdir,
+ boost::llfio::future<std::pair<std::vector<boost::llfio::directory_entry>, bool>>
+ enumeration(boost::llfio::async_enumerate(rootdir,
/* This is the maximum entries to enumerate. Note
the use of compatibility_maximum() which is the
same value your libc uses. The problem with smaller
enumerations is that the directory contents can change
out from underneath you more frequently. */
- boost::afio::directory_entry::compatibility_maximum(),
+ boost::llfio::directory_entry::compatibility_maximum(),
/* True if to reset enumeration */
restart));
restart=false;
@@ -29,7 +29,7 @@ int main(void)
// People using AFIO often forget that futures can be waited
// on normally without needing to wait on the op handle
list=enumeration.get();
- for(boost::afio::directory_entry &i : list.first)
+ for(boost::llfio::directory_entry &i : list.first)
{
#ifdef WIN32
std::wcout << i.name();
diff --git a/attic/example/filecopy_example.cpp b/attic/example/filecopy_example.cpp
index e48a9c36..a66247cc 100644
--- a/attic/example/filecopy_example.cpp
+++ b/attic/example/filecopy_example.cpp
@@ -1,4 +1,4 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
static uint32_t crc32(const void* data, size_t length, uint32_t previousCrc32 = 0)
{
@@ -16,8 +16,8 @@ static uint32_t crc32(const void* data, size_t length, uint32_t previousCrc32 =
//[filecopy_example
namespace {
- using namespace boost::afio;
- using boost::afio::off_t;
+ using namespace boost::llfio;
+ using boost::llfio::off_t;
// Keep memory buffers around
// A special allocator of highly efficient file i/o memory
@@ -28,7 +28,7 @@ namespace {
stl_future<std::vector<handle_ptr>> async_concatenate_files(
atomic<off_t> &written, off_t &totalbytes,
dispatcher_ptr dispatcher,
- boost::afio::filesystem::path dest, std::vector<boost::afio::filesystem::path> sources,
+ boost::llfio::filesystem::path dest, std::vector<boost::llfio::filesystem::path> sources,
size_t chunk_size=1024*1024 /* 1Mb */)
{
// Schedule the opening of the output file for writing
@@ -106,8 +106,8 @@ namespace {
int main(int argc, const char *argv[])
{
- using namespace boost::afio;
- using boost::afio::off_t;
+ using namespace boost::llfio;
+ using boost::llfio::off_t;
typedef chrono::duration<double, ratio<1, 1>> secs_type;
if(argc<3)
{
@@ -119,13 +119,13 @@ int main(int argc, const char *argv[])
{
atomic<off_t> written(0);
off_t totalbytes=0;
- std::shared_ptr<boost::afio::dispatcher> dispatcher=
- boost::afio::make_dispatcher().get();
+ std::shared_ptr<boost::llfio::dispatcher> dispatcher=
+ boost::llfio::make_dispatcher().get();
// Set a dispatcher as current for this thread
- boost::afio::current_dispatcher_guard guard(dispatcher);
+ boost::llfio::current_dispatcher_guard guard(dispatcher);
- boost::afio::filesystem::path dest=argv[1];
- std::vector<boost::afio::filesystem::path> sources;
+ boost::llfio::filesystem::path dest=argv[1];
+ std::vector<boost::llfio::filesystem::path> sources;
std::cout << "Concatenating into " << dest << " the files ";
for(int n=2; n<argc; ++n)
{
@@ -138,7 +138,7 @@ int main(int argc, const char *argv[])
auto begin=chrono::steady_clock::now();
auto h=async_concatenate_files(written, totalbytes, dispatcher, dest, sources);
// Print progress once a second until it's done
- while(future_status::timeout==h.wait_for(boost::afio::chrono::seconds(1)))
+ while(future_status::timeout==h.wait_for(boost::llfio::chrono::seconds(1)))
{
std::cout << "\r" << (100*written)/totalbytes << "% complete (" << written
<< " out of " << totalbytes << " @ " << (written/chrono::duration_cast<secs_type>(
diff --git a/attic/example/filedir_example.cpp b/attic/example/filedir_example.cpp
index 45439ed5..7aec48bb 100644
--- a/attic/example/filedir_example.cpp
+++ b/attic/example/filedir_example.cpp
@@ -1,24 +1,24 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
int main(void)
{
//[filedir_example
using namespace BOOST_AFIO_V2_NAMESPACE;
using BOOST_AFIO_V2_NAMESPACE::rmdir;
- std::shared_ptr<boost::afio::dispatcher> dispatcher =
- boost::afio::make_dispatcher().get();
+ std::shared_ptr<boost::llfio::dispatcher> dispatcher =
+ boost::llfio::make_dispatcher().get();
current_dispatcher_guard h(dispatcher);
// Free function
try
{
// Schedule creating a directory called testdir
- auto mkdir(async_dir("testdir", boost::afio::file_flags::create));
+ auto mkdir(async_dir("testdir", boost::llfio::file_flags::create));
// Schedule creating a file called testfile in testdir only when testdir has been created
- auto mkfile(async_file(mkdir, "testfile", boost::afio::file_flags::create));
+ auto mkfile(async_file(mkdir, "testfile", boost::llfio::file_flags::create));
// Schedule creating a symbolic link called linktodir to the item referred to by the precondition
// i.e. testdir. Note that on Windows you can only symbolic link directories.
- auto mklink(async_symlink(mkdir, "linktodir", mkdir, boost::afio::file_flags::create));
+ auto mklink(async_symlink(mkdir, "linktodir", mkdir, boost::llfio::file_flags::create));
// Schedule deleting the symbolic link only after when it has been created
auto rmlink(async_rmsymlink(mklink));
@@ -29,7 +29,7 @@ int main(void)
// Schedule deleting the directory only after the barrier completes
auto rmdir(async_rmdir(depends(barrier.front(), mkdir)));
// Check ops for errors
- boost::afio::when_all_p(mkdir, mkfile, mklink, rmlink, rmfile, rmdir).wait();
+ boost::llfio::when_all_p(mkdir, mkfile, mklink, rmlink, rmfile, rmdir).wait();
}
catch (...)
{
@@ -41,18 +41,18 @@ int main(void)
try
{
// Schedule creating a directory called testdir
- auto mkdir(dispatcher->dir(std::vector<boost::afio::path_req>(1,
- boost::afio::path_req("testdir", boost::afio::file_flags::create))).front());
+ auto mkdir(dispatcher->dir(std::vector<boost::llfio::path_req>(1,
+ boost::llfio::path_req("testdir", boost::llfio::file_flags::create))).front());
// Schedule creating a file called testfile in testdir only when testdir has been created
- auto mkfile(dispatcher->file(std::vector<boost::afio::path_req>(1,
- boost::afio::path_req::relative(mkdir, "testfile",
- boost::afio::file_flags::create))).front());
+ auto mkfile(dispatcher->file(std::vector<boost::llfio::path_req>(1,
+ boost::llfio::path_req::relative(mkdir, "testfile",
+ boost::llfio::file_flags::create))).front());
// Schedule creating a symbolic link called linktodir to the item referred to by the precondition
// i.e. testdir. Note that on Windows you can only symbolic link directories. Note that creating
// symlinks must *always* be as an absolute path, as that is how they are stored.
- auto mklink(dispatcher->symlink(std::vector<boost::afio::path_req>(1,
- boost::afio::path_req::absolute(mkdir, "testdir/linktodir",
- boost::afio::file_flags::create))).front());
+ auto mklink(dispatcher->symlink(std::vector<boost::llfio::path_req>(1,
+ boost::llfio::path_req::absolute(mkdir, "testdir/linktodir",
+ boost::llfio::file_flags::create))).front());
// Schedule deleting the symbolic link only after when it has been created
auto rmlink(dispatcher->close(std::vector<future<>>(1, dispatcher->rmsymlink(mklink))).front());
@@ -63,7 +63,7 @@ int main(void)
// Schedule deleting the directory only after the barrier completes
auto rmdir(dispatcher->rmdir(std::vector<path_req>(1, dispatcher->depends(barrier.front(), mkdir))).front());
// Check ops for errors
- boost::afio::when_all_p(mkdir, mkfile, mklink, rmlink, rmfile, rmdir).wait();
+ boost::llfio::when_all_p(mkdir, mkfile, mklink, rmlink, rmfile, rmdir).wait();
}
catch(...)
{
diff --git a/attic/example/filter_example.cpp b/attic/example/filter_example.cpp
index 464f47e8..5e6d9524 100644
--- a/attic/example/filter_example.cpp
+++ b/attic/example/filter_example.cpp
@@ -1,7 +1,7 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
//[filter_example
-using namespace boost::afio;
+using namespace boost::llfio;
// This function will be called for every file opened
static void open_file_filter(detail::OpType, future<> &op) noexcept
@@ -11,7 +11,7 @@ static void open_file_filter(detail::OpType, future<> &op) noexcept
// This function will be called for every read and write performed
static void readwrite_filter(detail::OpType optype, handle *h,
- const detail::io_req_impl<true> &req, boost::afio::off_t offset, size_t buffer_idx,
+ const detail::io_req_impl<true> &req, boost::llfio::off_t offset, size_t buffer_idx,
size_t buffers, const boost::system::error_code &ec, size_t bytes_transferred)
{
std::cout << "File handle " << h->native_handle() << (detail::OpType::read==optype ?
diff --git a/attic/example/find_in_files_afio.cpp b/attic/example/find_in_files_afio.cpp
index a1427fd2..875219ec 100644
--- a/attic/example/find_in_files_afio.cpp
+++ b/attic/example/find_in_files_afio.cpp
@@ -1,4 +1,4 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
#include <deque>
#include <regex>
#include <chrono>
@@ -6,7 +6,7 @@
#include <future>
#include <initializer_list>
#include "boost/exception/diagnostic_information.hpp"
-#include "boost/../libs/afio/test/Aligned_Allocator.hpp"
+#include "boost/../libs/llfio/test/Aligned_Allocator.hpp"
/* My Intel Core i7 3770K running Windows 8 x64 with 7200rpm drive, using
Sysinternals RAMMap to clear disc cache (http://technet.microsoft.com/en-us/sysinternals/ff700229.aspx)
@@ -30,8 +30,8 @@ The search took 242.76 seconds which was 150.033 files per second or 24 Mb/sec.
#define USE_MMAPS
-//[find_in_files_afio
-using namespace boost::afio;
+//[find_in_files_llfio
+using namespace boost::llfio;
// Often it's easiest for a lot of nesting callbacks to carry state via a this pointer
class find_in_files
@@ -43,7 +43,7 @@ public:
recursive_mutex opslock;
std::deque<future<>> ops; // For exception gathering
std::atomic<size_t> bytesread, filesread, filesmatched, scheduled, completed;
- std::vector<std::pair<boost::afio::filesystem::path, size_t>> filepaths;
+ std::vector<std::pair<boost::llfio::filesystem::path, size_t>> filepaths;
// Signals finish once all scheduled ops have completed
void docompleted(size_t inc)
@@ -173,9 +173,9 @@ public:
{
if(entry.st_type()==
#ifdef BOOST_AFIO_USE_LEGACY_FILESYSTEM_SEMANTICS
- boost::afio::filesystem::file_type::directory_file)
+ boost::llfio::filesystem::file_type::directory_file)
#else
- boost::afio::filesystem::file_type::directory)
+ boost::llfio::filesystem::file_type::directory)
#endif
{
auto dir_open=dispatcher->dir(path_req::absolute(lastdir, h->path()/entry.name()));
@@ -221,9 +221,9 @@ public:
{
if(entry.st_type()==
#ifdef BOOST_AFIO_USE_LEGACY_FILESYSTEM_SEMANTICS
- boost::afio::filesystem::file_type::regular_file)
+ boost::llfio::filesystem::file_type::regular_file)
#else
- boost::afio::filesystem::file_type::regular)
+ boost::llfio::filesystem::file_type::regular)
#endif
{
size_t length=(size_t)entry.st_size();
@@ -320,7 +320,7 @@ public:
int main(int argc, const char *argv[])
{
using std::placeholders::_1; using std::placeholders::_2;
- using namespace boost::afio;
+ using namespace boost::llfio;
typedef chrono::duration<double, ratio<1, 1>> secs_type;
if(argc<2)
{
diff --git a/attic/example/find_in_files_iostreams.cpp b/attic/example/find_in_files_iostreams.cpp
index 0114ec57..5868d94e 100644
--- a/attic/example/find_in_files_iostreams.cpp
+++ b/attic/example/find_in_files_iostreams.cpp
@@ -1,4 +1,4 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
#include <iostream>
#include <fstream>
#include <regex>
@@ -31,7 +31,7 @@ The search took 741.131 seconds which was 52.4684 files per second or 7.94029 Mb
int main(int argc, const char *argv[])
{
using namespace std;
- namespace filesystem = boost::afio::filesystem;
+ namespace filesystem = boost::llfio::filesystem;
#if BOOST_AFIO_USE_BOOST_FILESYSTEM
using boost::filesystem::ifstream;
#endif
diff --git a/attic/example/readallof_example.cpp b/attic/example/readallof_example.cpp
index c7882c88..d0f2f816 100644
--- a/attic/example/readallof_example.cpp
+++ b/attic/example/readallof_example.cpp
@@ -1,8 +1,8 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
int main(void)
{
- using namespace boost::afio;
+ using namespace boost::llfio;
auto dispatcher=make_dispatcher().get();
current_dispatcher_guard h(dispatcher);
diff --git a/attic/example/readwrite_example.cpp b/attic/example/readwrite_example.cpp
index 5a94c561..575dcaa2 100644
--- a/attic/example/readwrite_example.cpp
+++ b/attic/example/readwrite_example.cpp
@@ -1,19 +1,19 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
int main(void)
{
try
{
//[readwrite_example
- namespace afio = BOOST_AFIO_V2_NAMESPACE;
+ namespace llfio = BOOST_AFIO_V2_NAMESPACE;
namespace asio = BOOST_AFIO_V2_NAMESPACE::asio;
// Set a dispatcher as current for this thread
- afio::current_dispatcher_guard h(afio::make_dispatcher().get());
+ llfio::current_dispatcher_guard h(llfio::make_dispatcher().get());
// Schedule an opening of a file called example_file.txt
- afio::future<> openfile = afio::async_file("example_file.txt",
- afio::file_flags::create | afio::file_flags::read_write);
+ llfio::future<> openfile = llfio::async_file("example_file.txt",
+ llfio::file_flags::create | llfio::file_flags::read_write);
// Something a bit surprising for many people is that writing off
// the end of a file in AFIO does NOT extend the file and writes
@@ -25,7 +25,7 @@ int main(void)
// workaround: either open a file for append-only access, in which
// case all writes extend the file for you, or else you explicitly
// extend files before writing, like this:
- afio::future<> resizedfile = afio::async_truncate(openfile, 12);
+ llfio::future<> resizedfile = llfio::async_truncate(openfile, 12);
// Config a write gather. You could do this of course as a batch
// of writes, but a write gather has optimised host OS support in most
@@ -38,29 +38,29 @@ int main(void)
buffers.push_back(asio::const_buffer("rl", 2));
buffers.push_back(asio::const_buffer("d\n", 2));
// Schedule the write gather to offset zero after the resize file
- afio::future<> written(afio::async_write(resizedfile, buffers, 0));
+ llfio::future<> written(llfio::async_write(resizedfile, buffers, 0));
// Have the compiler config the exact same write gather as earlier for you
// The compiler assembles an identical sequence of ASIO write gather
// buffers for you
std::vector<std::string> buffers2={ "He", "ll", "o ", "Wo", "rl", "d\n" };
// Schedule this to occur after the previous write completes
- afio::future<> written2(afio::async_write(written, buffers2, 0));
+ llfio::future<> written2(llfio::async_write(written, buffers2, 0));
// Schedule making sure the previous batch has definitely reached physical storage
// This won't complete until the write is on disc
- afio::future<> stored(afio::async_sync(written2));
+ llfio::future<> stored(llfio::async_sync(written2));
// Schedule filling this array from the file. Note how convenient std::array
// is and completely replaces C style char buffer[bytes]
std::array<char, 12> buffer;
- afio::future<> read(afio::async_read(stored, buffer, 0));
+ llfio::future<> read(llfio::async_read(stored, buffer, 0));
// Schedule the closing and deleting of example_file.txt after the contents read
- afio::future<> deletedfile(afio::async_rmfile(afio::async_close(read)));
+ llfio::future<> deletedfile(llfio::async_rmfile(llfio::async_close(read)));
// Wait until the buffer has been filled, checking all steps for errors
- afio::when_all_p(openfile, resizedfile, written, written2, stored, read).get(); /*< waits for file open, resize, write, sync and read to complete, throwing any exceptions encountered >*/
+ llfio::when_all_p(openfile, resizedfile, written, written2, stored, read).get(); /*< waits for file open, resize, write, sync and read to complete, throwing any exceptions encountered >*/
// There is actually a io_req<std::string> specialisation you
// can use to skip this bit by reading directly into a string ...
diff --git a/attic/example/readwrite_example_traditional.cpp b/attic/example/readwrite_example_traditional.cpp
index 56f82113..e350dbea 100644
--- a/attic/example/readwrite_example_traditional.cpp
+++ b/attic/example/readwrite_example_traditional.cpp
@@ -1,4 +1,4 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
int main(void)
{
@@ -31,7 +31,7 @@ int main(void)
// Close the file and delete it
openfile.close(); /*< closes file >*/
- boost::afio::filesystem::remove("example_file.txt"); /*< deletes file >*/
+ boost::llfio::filesystem::remove("example_file.txt"); /*< deletes file >*/
// Convert the read array into a string
std::string contents(buffer.begin(), buffer.end());
diff --git a/attic/example/statfs_example.cpp b/attic/example/statfs_example.cpp
index 122c07e0..5347ab7b 100644
--- a/attic/example/statfs_example.cpp
+++ b/attic/example/statfs_example.cpp
@@ -1,16 +1,16 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
int main(void)
{
//[statfs_example
- boost::afio::current_dispatcher_guard h(boost::afio::make_dispatcher().get());
+ boost::llfio::current_dispatcher_guard h(boost::llfio::make_dispatcher().get());
// Open the root directory
- boost::afio::handle_ptr rootdir(boost::afio::dir("/"));
+ boost::llfio::handle_ptr rootdir(boost::llfio::dir("/"));
// Ask the filing system of the root directory how much free space there is
- boost::afio::statfs_t statfs(boost::afio::statfs(rootdir,
- boost::afio::fs_metadata_flags::bsize|boost::afio::fs_metadata_flags::bfree));
+ boost::llfio::statfs_t statfs(boost::llfio::statfs(rootdir,
+ boost::llfio::fs_metadata_flags::bsize|boost::llfio::fs_metadata_flags::bfree));
std::cout << "Your root filing system has "
<< (statfs.f_bfree*statfs.f_bsize/1024.0/1024.0/1024.0) << " Gb free." << std::endl;
diff --git a/attic/example/workshop_atomic_updates_afio.cpp b/attic/example/workshop_atomic_updates_afio.cpp
index f36ea1c5..72927468 100644
--- a/attic/example/workshop_atomic_updates_afio.cpp
+++ b/attic/example/workshop_atomic_updates_afio.cpp
@@ -1,2 +1,2 @@
-#include "afio_pch.hpp"
-#include "workshop_atomic_updates_afio.ipp"
+#include "llfio_pch.hpp"
+#include "workshop_atomic_updates_llfio.ipp"
diff --git a/attic/example/workshop_atomic_updates_afio.ipp b/attic/example/workshop_atomic_updates_afio.ipp
index c4daafe4..bc703dff 100644
--- a/attic/example/workshop_atomic_updates_afio.ipp
+++ b/attic/example/workshop_atomic_updates_afio.ipp
@@ -1,12 +1,12 @@
-//[workshop_atomic_updates_afio_interface
-namespace afio = BOOST_AFIO_V2_NAMESPACE;
+//[workshop_atomic_updates_llfio_interface
+namespace llfio = BOOST_AFIO_V2_NAMESPACE;
namespace filesystem = BOOST_AFIO_V2_NAMESPACE::filesystem;
using BOOST_OUTCOME_V1_NAMESPACE::lightweight_futures::shared_future;
class data_store
{
- afio::dispatcher_ptr _dispatcher;
- afio::handle_ptr _store;
+ llfio::dispatcher_ptr _dispatcher;
+ llfio::handle_ptr _store;
public:
// Type used for read streams
using istream = std::shared_ptr<std::istream>;
@@ -21,7 +21,7 @@ public:
static constexpr size_t writeable = (1<<0);
// Open a data store at path
- data_store(size_t flags = 0, afio::path path = "store");
+ data_store(size_t flags = 0, llfio::path path = "store");
// Look up item named name for reading, returning an istream for the item
shared_future<istream> lookup(std::string name) noexcept;
@@ -30,38 +30,38 @@ public:
};
//]
-//[workshop_atomic_updates_afio3]
+//[workshop_atomic_updates_llfio3]
namespace asio = BOOST_AFIO_V2_NAMESPACE::asio;
using BOOST_OUTCOME_V1_NAMESPACE::empty;
using BOOST_AFIO_V2_NAMESPACE::error_code;
using BOOST_AFIO_V2_NAMESPACE::generic_category;
// A special allocator of highly efficient file i/o memory
-using file_buffer_type = std::vector<char, afio::utils::page_allocator<char>>;
+using file_buffer_type = std::vector<char, llfio::utils::page_allocator<char>>;
// An iostream which reads directly from a memory mapped AFIO file
struct idirectstream : public std::istream
{
struct directstreambuf : public std::streambuf
{
- afio::handle_ptr h; // Holds the file open
+ llfio::handle_ptr h; // Holds the file open
std::shared_ptr<file_buffer_type> buffer;
- afio::handle::mapped_file_ptr mfp;
+ llfio::handle::mapped_file_ptr mfp;
// From a mmap
- directstreambuf(afio::handle_ptr _h, afio::handle::mapped_file_ptr _mfp, size_t length) : h(std::move(_h)), mfp(std::move(_mfp))
+ directstreambuf(llfio::handle_ptr _h, llfio::handle::mapped_file_ptr _mfp, size_t length) : h(std::move(_h)), mfp(std::move(_mfp))
{
// Set the get buffer this streambuf is to use
setg((char *) mfp->addr, (char *) mfp->addr, (char *) mfp->addr + length);
}
// From a malloc
- directstreambuf(afio::handle_ptr _h, std::shared_ptr<file_buffer_type> _buffer, size_t length) : h(std::move(_h)), buffer(std::move(_buffer))
+ directstreambuf(llfio::handle_ptr _h, std::shared_ptr<file_buffer_type> _buffer, size_t length) : h(std::move(_h)), buffer(std::move(_buffer))
{
// Set the get buffer this streambuf is to use
setg(buffer->data(), buffer->data(), buffer->data() + length);
}
};
std::unique_ptr<directstreambuf> buf;
- template<class U> idirectstream(afio::handle_ptr h, U &&buffer, size_t length) : std::istream(new directstreambuf(std::move(h), std::forward<U>(buffer), length)), buf(static_cast<directstreambuf *>(rdbuf()))
+ template<class U> idirectstream(llfio::handle_ptr h, U &&buffer, size_t length) : std::istream(new directstreambuf(std::move(h), std::forward<U>(buffer), length)), buf(static_cast<directstreambuf *>(rdbuf()))
{
}
virtual ~idirectstream() override
@@ -78,11 +78,11 @@ struct odirectstream : public std::ostream
{
using int_type = std::streambuf::int_type;
using traits_type = std::streambuf::traits_type;
- afio::future<> lastwrite; // the last async write performed
- afio::off_t offset; // offset of next write
+ llfio::future<> lastwrite; // the last async write performed
+ llfio::off_t offset; // offset of next write
file_buffer_type buffer; // a page size on this machine
file_buffer_type lastbuffer;
- directstreambuf(afio::handle_ptr _h) : lastwrite(std::move(_h)), offset(0), buffer(afio::utils::page_sizes().front())
+ directstreambuf(llfio::handle_ptr _h) : lastwrite(std::move(_h)), offset(0), buffer(llfio::utils::page_sizes().front())
{
// Set the put buffer this streambuf is to use
setp(buffer.data(), buffer.data() + buffer.size());
@@ -95,18 +95,18 @@ struct odirectstream : public std::ostream
// Schedule an asynchronous write of the buffer to storage
size_t thisbuffer = pptr() - pbase();
if(thisbuffer)
- lastwrite = afio::async_write(afio::async_truncate(lastwrite, offset+thisbuffer), buffer.data(), thisbuffer, offset);
+ lastwrite = llfio::async_write(llfio::async_truncate(lastwrite, offset+thisbuffer), buffer.data(), thisbuffer, offset);
lastwrite.get();
// TODO: On Windows do I need to close and reopen the file to flush metadata before
// the rename or does the rename do it for me?
// Get handle to the parent directory
auto dirh(lastwrite->container());
// Atomically rename "tmpXXXXXXXXXXXXXXXX" to "0"
- lastwrite->atomic_relink(afio::path_req::relative(dirh, "0"));
+ lastwrite->atomic_relink(llfio::path_req::relative(dirh, "0"));
#ifdef __linux__
- // Journalled Linux filing systems don't need this, but if you enabled afio::file_flags::always_sync
+ // Journalled Linux filing systems don't need this, but if you enabled llfio::file_flags::always_sync
// you might want to issue this too.
- afio::sync(dirh);
+ llfio::sync(dirh);
#endif
}
catch(...)
@@ -138,16 +138,16 @@ struct odirectstream : public std::ostream
buffer.resize(lastbuffer.size());
setp(buffer.data(), buffer.data() + buffer.size());
// Schedule an extension of physical storage by an extra page
- lastwrite = afio::async_truncate(lastwrite, offset + thisbuffer);
+ lastwrite = llfio::async_truncate(lastwrite, offset + thisbuffer);
// Schedule an asynchronous write of the buffer to storage
- lastwrite=afio::async_write(lastwrite, lastbuffer.data(), thisbuffer, offset);
+ lastwrite=llfio::async_write(lastwrite, lastbuffer.data(), thisbuffer, offset);
offset+=thisbuffer;
}
return 0;
}
};
std::unique_ptr<directstreambuf> buf;
- odirectstream(afio::handle_ptr h) : std::ostream(new directstreambuf(std::move(h))), buf(static_cast<directstreambuf *>(rdbuf()))
+ odirectstream(llfio::handle_ptr h) : std::ostream(new directstreambuf(std::move(h))), buf(static_cast<directstreambuf *>(rdbuf()))
{
}
virtual ~odirectstream() override
@@ -158,7 +158,7 @@ struct odirectstream : public std::ostream
};
//]
-//[workshop_atomic_updates_afio1]
+//[workshop_atomic_updates_llfio1]
namespace asio = BOOST_AFIO_V2_NAMESPACE::asio;
using BOOST_OUTCOME_V1_NAMESPACE::empty;
using BOOST_AFIO_V2_NAMESPACE::error_code;
@@ -183,7 +183,7 @@ static std::string random_name()
random_names_type(size_t count) : names(count), idx(0)
{
for(size_t n=0; n<count; n++)
- names[n]=afio::utils::random_string(16); // 128 bits
+ names[n]=llfio::utils::random_string(16); // 128 bits
}
std::string get()
{
@@ -195,13 +195,13 @@ static std::string random_name()
return random_names.get();
}
-data_store::data_store(size_t flags, afio::path path)
+data_store::data_store(size_t flags, llfio::path path)
{
// Make a dispatcher for the local filesystem URI, masking out write flags on all operations if not writeable
- _dispatcher=afio::make_dispatcher("file:///", afio::file_flags::none, !(flags & writeable) ? afio::file_flags::write : afio::file_flags::none).get();
+ _dispatcher=llfio::make_dispatcher("file:///", llfio::file_flags::none, !(flags & writeable) ? llfio::file_flags::write : llfio::file_flags::none).get();
// Set the dispatcher for this thread, and open a handle to the store directory
- afio::current_dispatcher_guard h(_dispatcher);
- _store=afio::dir(std::move(path), afio::file_flags::create); // throws if there was an error
+ llfio::current_dispatcher_guard h(_dispatcher);
+ _store=llfio::dir(std::move(path), llfio::file_flags::create); // throws if there was an error
// Precalculate the cache of random names
random_name();
}
@@ -214,16 +214,16 @@ shared_future<data_store::istream> data_store::lookup(std::string name) noexcept
{
name.append("/0");
// Schedule the opening of the file for reading
- afio::future<> h(afio::async_file(_store, name, afio::file_flags::read));
+ llfio::future<> h(llfio::async_file(_store, name, llfio::file_flags::read));
// When it completes, call this continuation
- return h.then([](afio::future<> &_h) -> shared_future<data_store::istream> {
+ return h.then([](llfio::future<> &_h) -> shared_future<data_store::istream> {
// If file didn't open, return the error or exception immediately
BOOST_OUTCOME_PROPAGATE(_h);
- size_t length=(size_t) _h->lstat(afio::metadata_flags::size).st_size;
+ size_t length=(size_t) _h->lstat(llfio::metadata_flags::size).st_size;
// Is a memory map more appropriate?
if(length>=128*1024)
{
- afio::handle::mapped_file_ptr mfp;
+ llfio::handle::mapped_file_ptr mfp;
if((mfp=_h->map_file()))
{
data_store::istream ret(std::make_shared<idirectstream>(_h.get_handle(), std::move(mfp), length));
@@ -232,9 +232,9 @@ shared_future<data_store::istream> data_store::lookup(std::string name) noexcept
}
// Schedule the reading of the file into a buffer
auto buffer=std::make_shared<file_buffer_type>(length);
- afio::future<> h(afio::async_read(_h, buffer->data(), length, 0));
+ llfio::future<> h(llfio::async_read(_h, buffer->data(), length, 0));
// When the read completes call this continuation
- return h.then([buffer, length](const afio::future<> &h) -> shared_future<data_store::istream> {
+ return h.then([buffer, length](const llfio::future<> &h) -> shared_future<data_store::istream> {
// If read failed, return the error or exception immediately
BOOST_OUTCOME_PROPAGATE(h);
data_store::istream ret(std::make_shared<idirectstream>(h.get_handle(), buffer, length));
@@ -249,7 +249,7 @@ shared_future<data_store::istream> data_store::lookup(std::string name) noexcept
}
//]
-//[workshop_atomic_updates_afio2]
+//[workshop_atomic_updates_llfio2]
shared_future<data_store::ostream> data_store::write(std::string name) noexcept
{
if(!is_valid_name(name))
@@ -257,24 +257,24 @@ shared_future<data_store::ostream> data_store::write(std::string name) noexcept
try
{
// Schedule the opening of the directory
- afio::future<> dirh(afio::async_dir(_store, name, afio::file_flags::create));
+ llfio::future<> dirh(llfio::async_dir(_store, name, llfio::file_flags::create));
#ifdef __linux__
// Flush metadata on Linux only. This will be a noop unless we created a new directory
// above, and if we don't flush the new key directory it and its contents may not appear
// in the store directory after a suddenly power loss, even if it and its contents are
// all on physical storage.
- dirh.then([this](const afio::future<> &h) { async_sync(_store); });
+ dirh.then([this](const llfio::future<> &h) { async_sync(_store); });
#endif
// Make a crypto strong random file name
std::string randomname("tmp");
randomname.append(random_name());
// Schedule the opening of the file for writing
- afio::future<> h(afio::async_file(dirh, randomname, afio::file_flags::create | afio::file_flags::write
- | afio::file_flags::hold_parent_open // handle should keep a handle_ptr to its parent dir
- /*| afio::file_flags::always_sync*/ // writes don't complete until upon physical storage
+ llfio::future<> h(llfio::async_file(dirh, randomname, llfio::file_flags::create | llfio::file_flags::write
+ | llfio::file_flags::hold_parent_open // handle should keep a handle_ptr to its parent dir
+ /*| llfio::file_flags::always_sync*/ // writes don't complete until upon physical storage
));
// When it completes, call this continuation
- return h.then([](const afio::future<> &h) -> shared_future<data_store::ostream> {
+ return h.then([](const llfio::future<> &h) -> shared_future<data_store::ostream> {
// If file didn't open, return the error or exception immediately
BOOST_OUTCOME_PROPAGATE(h);
// Create an ostream which directly uses the file.
diff --git a/attic/example/workshop_benchmark.cpp b/attic/example/workshop_benchmark.cpp
index e3f2d58d..08ca2f3b 100644
--- a/attic/example/workshop_benchmark.cpp
+++ b/attic/example/workshop_benchmark.cpp
@@ -1,4 +1,4 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
#ifdef _DEBUG
#define ITEMS 64
@@ -11,13 +11,13 @@ namespace iostreams {
#include "workshop_naive.ipp"
}
namespace naive {
-#include "workshop_naive_afio.ipp"
+#include "workshop_naive_llfio.ipp"
}
namespace atomic_updates {
-#include "workshop_atomic_updates_afio.ipp"
+#include "workshop_atomic_updates_llfio.ipp"
}
namespace final {
-#include "workshop_final_afio.ipp"
+#include "workshop_final_llfio.ipp"
#include "../detail/SpookyV2.cpp"
}
@@ -144,8 +144,8 @@ int main(void)
while(chrono::duration_cast<secs_type>(chrono::high_resolution_clock::now()-begin).count()<3);
//benchmark<iostreams::data_store>("iostreams.csv", "STL iostreams", true);
- //benchmark<naive::data_store>("afio_naive.csv", "AFIO naive", true);
- //benchmark<atomic_updates::data_store>("afio_atomic.csv", "AFIO atomic update", true);
- benchmark<final::data_store>("afio_final.csv", "AFIO single file", true);
+ //benchmark<naive::data_store>("llfio_naive.csv", "AFIO naive", true);
+ //benchmark<atomic_updates::data_store>("llfio_atomic.csv", "AFIO atomic update", true);
+ benchmark<final::data_store>("llfio_final.csv", "AFIO single file", true);
return 0;
} \ No newline at end of file
diff --git a/attic/example/workshop_final_afio.cpp b/attic/example/workshop_final_afio.cpp
index c3fcceb9..62f51ed6 100644
--- a/attic/example/workshop_final_afio.cpp
+++ b/attic/example/workshop_final_afio.cpp
@@ -1,2 +1,2 @@
-#include "afio_pch.hpp"
-#include "workshop_final_afio.ipp"
+#include "llfio_pch.hpp"
+#include "workshop_final_llfio.ipp"
diff --git a/attic/example/workshop_final_afio.ipp b/attic/example/workshop_final_afio.ipp
index 655b8367..c1a4e98e 100644
--- a/attic/example/workshop_final_afio.ipp
+++ b/attic/example/workshop_final_afio.ipp
@@ -1,7 +1,7 @@
#include "../detail/SpookyV2.h"
//[workshop_final_interface
-namespace afio = BOOST_AFIO_V2_NAMESPACE;
+namespace llfio = BOOST_AFIO_V2_NAMESPACE;
namespace filesystem = BOOST_AFIO_V2_NAMESPACE::filesystem;
using BOOST_OUTCOME_V1_NAMESPACE::outcome;
using BOOST_OUTCOME_V1_NAMESPACE::lightweight_futures::shared_future;
@@ -10,13 +10,13 @@ class data_store
{
struct _ostream;
friend struct _ostream;
- afio::dispatcher_ptr _dispatcher;
+ llfio::dispatcher_ptr _dispatcher;
// The small blob store keeps non-memory mappable blobs at 32 byte alignments
- afio::handle_ptr _small_blob_store, _small_blob_store_append, _small_blob_store_ecc;
+ llfio::handle_ptr _small_blob_store, _small_blob_store_append, _small_blob_store_ecc;
// The large blob store keeps memory mappable blobs at 4Kb alignments
- afio::handle_ptr _large_blob_store, _large_blob_store_append, _large_blob_store_ecc;
+ llfio::handle_ptr _large_blob_store, _large_blob_store_append, _large_blob_store_ecc;
// The index is where we keep the map of keys to blobs
- afio::handle_ptr _index_store, _index_store_append, _index_store_ecc;
+ llfio::handle_ptr _index_store, _index_store_append, _index_store_ecc;
struct index;
std::unique_ptr<index> _index;
public:
@@ -33,7 +33,7 @@ public:
static constexpr size_t writeable = (1<<0);
// Open a data store at path
- data_store(size_t flags = 0, afio::path path = "store");
+ data_store(size_t flags = 0, llfio::path path = "store");
// Look up item named name for reading, returning an istream for the item
shared_future<istream> lookup(std::string name) noexcept;
@@ -49,7 +49,7 @@ using BOOST_AFIO_V2_NAMESPACE::generic_category;
using BOOST_OUTCOME_V1_NAMESPACE::outcome;
// A special allocator of highly efficient file i/o memory
-using file_buffer_type = std::vector<char, afio::utils::page_allocator<char>>;
+using file_buffer_type = std::vector<char, llfio::utils::page_allocator<char>>;
// Serialisation helper types
#pragma pack(push, 1)
@@ -57,18 +57,18 @@ struct ondisk_file_header // 20 bytes
{
union
{
- afio::off_t length; // Always 32 in byte order of whoever wrote this
+ llfio::off_t length; // Always 32 in byte order of whoever wrote this
char endian[8];
};
- afio::off_t index_offset_begin; // Hint to the length of the store when the index was last written
+ llfio::off_t index_offset_begin; // Hint to the length of the store when the index was last written
unsigned int time_count; // Racy monotonically increasing count
};
struct ondisk_record_header // 28 bytes - ALWAYS ALIGNED TO 32 BYTE FILE OFFSET
{
- afio::off_t magic : 16; // 0xad magic
- afio::off_t kind : 2; // 0 for zeroed space, 1,2 for blob, 3 for index
- afio::off_t _spare : 6;
- afio::off_t length : 40; // Size of the object (including this preamble, regions, key values) (+8)
+ llfio::off_t magic : 16; // 0xad magic
+ llfio::off_t kind : 2; // 0 for zeroed space, 1,2 for blob, 3 for index
+ llfio::off_t _spare : 6;
+ llfio::off_t length : 40; // Size of the object (including this preamble, regions, key values) (+8)
unsigned int age; // file header time_count when this was added (+12)
uint64 hash[2]; // 128-bit SpookyHash of the object (from below onwards) (+28)
// ondisk_index_regions
@@ -76,11 +76,11 @@ struct ondisk_record_header // 28 bytes - ALWAYS ALIGNED TO 32 BYTE FILE OFFSET
};
struct ondisk_index_regions // 12 + regions_size * 32
{
- afio::off_t thisoffset; // this index only valid if equals this offset
+ llfio::off_t thisoffset; // this index only valid if equals this offset
unsigned int regions_size; // count of regions with their status (+28)
struct ondisk_index_region
{
- afio::off_t offset; // offset to this region
+ llfio::off_t offset; // offset to this region
ondisk_record_header r; // copy of the header at the offset to avoid a disk seek
} regions[1];
};
@@ -97,13 +97,13 @@ struct data_store::index
struct region
{
enum kind_type { zeroed=0, small_blob=1, large_blob=2, index=3 } kind;
- afio::off_t offset, length;
+ llfio::off_t offset, length;
uint64 hash[2];
region(ondisk_index_regions::ondisk_index_region *r) : kind(static_cast<kind_type>(r->r.kind)), offset(r->offset), length(r->r.length) { memcpy(hash, r->r.hash, sizeof(hash)); }
bool operator<(const region &o) const noexcept { return offset<o.offset; }
bool operator==(const region &o) const noexcept { return offset==o.offset && length==o.length; }
};
- afio::off_t offset_loaded_from; // Offset this index was loaded from
+ llfio::off_t offset_loaded_from; // Offset this index was loaded from
unsigned int last_time_count; // Header time count
std::vector<region> regions;
std::unordered_map<std::string, size_t> key_to_region;
@@ -112,13 +112,13 @@ struct data_store::index
//[workshop_final2]
struct last_good_ondisk_index_info
{
- afio::off_t offset;
+ llfio::off_t offset;
std::unique_ptr<char[]> buffer;
size_t size;
last_good_ondisk_index_info() : offset(0), size(0) { }
};
// Finds the last good index in the store
- outcome<last_good_ondisk_index_info> find_last_good_ondisk_index(afio::handle_ptr h) noexcept
+ outcome<last_good_ondisk_index_info> find_last_good_ondisk_index(llfio::handle_ptr h) noexcept
{
last_good_ondisk_index_info ret;
error_code ec;
@@ -126,8 +126,8 @@ struct data_store::index
{
// Read the front of the store file to get the index offset hint
ondisk_file_header header;
- afio::read(h, header, 0);
- afio::off_t offset=0;
+ llfio::read(h, header, 0);
+ llfio::off_t offset=0;
if(header.length==32)
offset=header.index_offset_begin;
else if(header.endian[0]==32) // wrong endian
@@ -136,15 +136,15 @@ struct data_store::index
return error_code(ENOTSUP, generic_category());
last_time_count=header.time_count;
// Fetch the valid extents
- auto valid_extents(afio::extents(h));
+ auto valid_extents(llfio::extents(h));
auto valid_extents_it=valid_extents.begin();
// Iterate the records starting from index offset hint, keeping track of last known good index
bool done=true;
do
{
- afio::off_t linear_scanning=0;
+ llfio::off_t linear_scanning=0;
ondisk_record_header record;
- afio::off_t file_length=h->lstat(afio::metadata_flags::size).st_size;
+ llfio::off_t file_length=h->lstat(llfio::metadata_flags::size).st_size;
for(; offset<file_length;)
{
// Round to 32 byte boundary
@@ -154,14 +154,14 @@ struct data_store::index
{
if(valid_extents.end()==++valid_extents_it)
{
- valid_extents=afio::extents(h);
+ valid_extents=llfio::extents(h);
valid_extents_it=valid_extents.begin();
}
}
// Is this offset within a valid extent? If not, bump it.
if(offset<valid_extents_it->first)
offset=valid_extents_it->first;
- afio::read(ec, h, record, offset);
+ llfio::read(ec, h, record, offset);
if(ec) return ec;
// If this does not contain a valid record, linear scan
// until we find one
@@ -186,9 +186,9 @@ start_linear_scan:
temp.magic=0xad;
temp.length=offset-linear_scanning;
temp.age=last_time_count;
- afio::write(ec, h, temp, linear_scanning);
+ llfio::write(ec, h, temp, linear_scanning);
// Deallocate the physical storage for the invalid section
- afio::zero(ec, h, {{linear_scanning+12, offset-linear_scanning-12}});
+ llfio::zero(ec, h, {{linear_scanning+12, offset-linear_scanning-12}});
linear_scanning=0;
}
// If not an index, skip entire record
@@ -218,7 +218,7 @@ start_linear_scan:
offset+=record.length;
continue;
}
- afio::read(ec, h, buffer.get(), (size_t) record.length-sizeof(header), offset+sizeof(header));
+ llfio::read(ec, h, buffer.get(), (size_t) record.length-sizeof(header), offset+sizeof(header));
if(ec)
return ec;
uint64 hash[2]={0, 0};
@@ -262,7 +262,7 @@ start_linear_scan:
//]
//[workshop_final3]
// Loads the index from the store
- outcome<void> load(afio::handle_ptr h) noexcept
+ outcome<void> load(llfio::handle_ptr h) noexcept
{
// If find_last_good_ondisk_index() returns error or exception, return those, else
// initialise ondisk_index_info to monad.get()
@@ -291,7 +291,7 @@ start_linear_scan:
//]
//[workshop_final4]
// Writes the index to the store
- outcome<void> store(afio::handle_ptr rwh, afio::handle_ptr appendh) noexcept
+ outcome<void> store(llfio::handle_ptr rwh, llfio::handle_ptr appendh) noexcept
{
error_code ec;
std::vector<ondisk_index_regions::ondisk_index_region> ondisk_regions;
@@ -359,7 +359,7 @@ start_linear_scan:
return error_code(EDEADLK, generic_category());
}
// Take the current length of the store file. Any index written will be at or after this.
- h.header2.thisoffset=appendh->lstat(afio::metadata_flags::size).st_size;
+ h.header2.thisoffset=appendh->lstat(llfio::metadata_flags::size).st_size;
memset(h.header.hash, 0, sizeof(h.header.hash));
// Hash the end of the first gather buffer and all the remaining gather buffers
SpookyHash::Hash128(asio::buffer_cast<const char *>(buffers[0])+24, asio::buffer_size(buffers[0])-24, h.header.hash, h.header.hash+1);
@@ -368,10 +368,10 @@ start_linear_scan:
if(buffers.size()>3)
SpookyHash::Hash128(asio::buffer_cast<const char *>(buffers[3]), asio::buffer_size(buffers[3]), h.header.hash, h.header.hash+1);
// Atomic append the record
- afio::write(ec, appendh, buffers, 0);
+ llfio::write(ec, appendh, buffers, 0);
if(ec) return ec;
// Reread the record
- afio::read(ec, rwh, reread.data(), reread.size(), h.header2.thisoffset);
+ llfio::read(ec, rwh, reread.data(), reread.size(), h.header2.thisoffset);
if(ec) return ec;
// If the record doesn't match it could be due to a lag in st_size between open handles,
// so retry until success or stale index
@@ -380,12 +380,12 @@ start_linear_scan:
// New index has been successfully written. Update the hint at the front of the file.
// This update is racy of course, but as it's merely a hint we don't care.
ondisk_file_header file_header;
- afio::read(ec, rwh, file_header, 0);
+ llfio::read(ec, rwh, file_header, 0);
if(!ec && file_header.index_offset_begin<h.header2.thisoffset)
{
file_header.index_offset_begin=h.header2.thisoffset;
file_header.time_count++;
- afio::write(ec, rwh, file_header, 0);
+ llfio::write(ec, rwh, file_header, 0);
}
offset_loaded_from=h.header2.thisoffset;
last_time_count=file_header.time_count;
@@ -394,17 +394,17 @@ start_linear_scan:
//]
//[workshop_final5]
// Reloads the index if needed
- outcome<void> refresh(afio::handle_ptr h) noexcept
+ outcome<void> refresh(llfio::handle_ptr h) noexcept
{
- static afio::off_t last_size;
+ static llfio::off_t last_size;
error_code ec;
- afio::off_t size=h->lstat(afio::metadata_flags::size).st_size;
+ llfio::off_t size=h->lstat(llfio::metadata_flags::size).st_size;
// Has the size changed? If so, need to check the hint
if(size>last_size)
{
last_size=size;
ondisk_file_header header;
- afio::read(ec, h, header, 0);
+ llfio::read(ec, h, header, 0);
if(ec) return ec;
// If the hint is moved, we are stale
if(header.index_offset_begin>offset_loaded_from)
@@ -421,30 +421,30 @@ using BOOST_AFIO_V2_NAMESPACE::error_code;
using BOOST_AFIO_V2_NAMESPACE::generic_category;
// A special allocator of highly efficient file i/o memory
-using file_buffer_type = std::vector<char, afio::utils::page_allocator<char>>;
+using file_buffer_type = std::vector<char, llfio::utils::page_allocator<char>>;
// An iostream which reads directly from a memory mapped AFIO file
struct idirectstream : public std::istream
{
struct directstreambuf : public std::streambuf
{
- afio::handle_ptr h; // Holds the file open
+ llfio::handle_ptr h; // Holds the file open
std::shared_ptr<file_buffer_type> buffer;
// From a mmap
- directstreambuf(afio::handle_ptr _h, char *addr, size_t length) : h(std::move(_h))
+ directstreambuf(llfio::handle_ptr _h, char *addr, size_t length) : h(std::move(_h))
{
// Set the get buffer this streambuf is to use
setg(addr, addr, addr + length);
}
// From a malloc
- directstreambuf(afio::handle_ptr _h, std::shared_ptr<file_buffer_type> _buffer, size_t length) : h(std::move(_h)), buffer(std::move(_buffer))
+ directstreambuf(llfio::handle_ptr _h, std::shared_ptr<file_buffer_type> _buffer, size_t length) : h(std::move(_h)), buffer(std::move(_buffer))
{
// Set the get buffer this streambuf is to use
setg(buffer->data(), buffer->data(), buffer->data() + length);
}
};
std::unique_ptr<directstreambuf> buf;
- template<class U> idirectstream(afio::handle_ptr h, U &&buffer, size_t length) : std::istream(new directstreambuf(std::move(h), std::forward<U>(buffer), length)), buf(static_cast<directstreambuf *>(rdbuf()))
+ template<class U> idirectstream(llfio::handle_ptr h, U &&buffer, size_t length) : std::istream(new directstreambuf(std::move(h), std::forward<U>(buffer), length)), buf(static_cast<directstreambuf *>(rdbuf()))
{
}
virtual ~idirectstream() override
@@ -465,7 +465,7 @@ struct data_store::_ostream : public std::ostream
data_store *ds;
std::string name;
file_buffer_type buffer;
- ostreambuf(data_store *_ds, std::string _name) : ds(_ds), name(std::move(_name)), buffer(afio::utils::page_sizes().front())
+ ostreambuf(data_store *_ds, std::string _name) : ds(_ds), name(std::move(_name)), buffer(llfio::utils::page_sizes().front())
{
// Set the put buffer this streambuf is to use
setp(buffer.data(), buffer.data() + buffer.size());
@@ -488,8 +488,8 @@ struct data_store::_ostream : public std::ostream
buffers[0]=asio::const_buffer((char *) &r.r, sizeof(r.r));
buffers[1]=asio::const_buffer(buffer.data(), (size_t)(r.r.length-sizeof(r.r)));
error_code ec;
- auto offset=ds->_small_blob_store_append->lstat(afio::metadata_flags::size).st_size;
- afio::write(ec, ds->_small_blob_store_append, buffers, 0);
+ auto offset=ds->_small_blob_store_append->lstat(llfio::metadata_flags::size).st_size;
+ llfio::write(ec, ds->_small_blob_store_append, buffers, 0);
if(ec)
abort(); // should really do something better here
@@ -497,7 +497,7 @@ struct data_store::_ostream : public std::ostream
ondisk_record_header header;
do
{
- afio::read(ec, ds->_small_blob_store_append, header, offset);
+ llfio::read(ec, ds->_small_blob_store_append, header, offset);
if(ec) abort();
if(header.kind==1 /*small blob*/ && !memcmp(header.hash, r.r.hash, sizeof(header.hash)))
{
@@ -505,7 +505,7 @@ struct data_store::_ostream : public std::ostream
break;
}
offset+=header.length;
- } while(offset<ds->_small_blob_store_append->lstat(afio::metadata_flags::size).st_size);
+ } while(offset<ds->_small_blob_store_append->lstat(llfio::metadata_flags::size).st_size);
for(;;)
{
@@ -558,35 +558,35 @@ struct data_store::_ostream : public std::ostream
//]
//[workshop_final8]
-data_store::data_store(size_t flags, afio::path path)
+data_store::data_store(size_t flags, llfio::path path)
{
// Make a dispatcher for the local filesystem URI, masking out write flags on all operations if not writeable
- _dispatcher=afio::make_dispatcher("file:///", afio::file_flags::none, !(flags & writeable) ? afio::file_flags::write : afio::file_flags::none).get();
+ _dispatcher=llfio::make_dispatcher("file:///", llfio::file_flags::none, !(flags & writeable) ? llfio::file_flags::write : llfio::file_flags::none).get();
// Set the dispatcher for this thread, and create/open a handle to the store directory
- afio::current_dispatcher_guard h(_dispatcher);
- auto dirh(afio::dir(std::move(path), afio::file_flags::create)); // throws if there was an error
+ llfio::current_dispatcher_guard h(_dispatcher);
+ auto dirh(llfio::dir(std::move(path), llfio::file_flags::create)); // throws if there was an error
// The small blob store keeps non-memory mappable blobs at 32 byte alignments
- _small_blob_store_append=afio::file(dirh, "small_blob_store", afio::file_flags::create | afio::file_flags::append); // throws if there was an error
- _small_blob_store=afio::file(dirh, "small_blob_store", afio::file_flags::read_write); // throws if there was an error
- _small_blob_store_ecc=afio::file(dirh, "small_blob_store.ecc", afio::file_flags::create | afio::file_flags::read_write); // throws if there was an error
+ _small_blob_store_append=llfio::file(dirh, "small_blob_store", llfio::file_flags::create | llfio::file_flags::append); // throws if there was an error
+ _small_blob_store=llfio::file(dirh, "small_blob_store", llfio::file_flags::read_write); // throws if there was an error
+ _small_blob_store_ecc=llfio::file(dirh, "small_blob_store.ecc", llfio::file_flags::create | llfio::file_flags::read_write); // throws if there was an error
// The large blob store keeps memory mappable blobs at 4Kb alignments
// TODO
// The index is where we keep the map of keys to blobs
- _index_store_append=afio::file(dirh, "index", afio::file_flags::create | afio::file_flags::append); // throws if there was an error
- _index_store=afio::file(dirh, "index", afio::file_flags::read_write); // throws if there was an error
- _index_store_ecc=afio::file(dirh, "index.ecc", afio::file_flags::create | afio::file_flags::read_write); // throws if there was an error
+ _index_store_append=llfio::file(dirh, "index", llfio::file_flags::create | llfio::file_flags::append); // throws if there was an error
+ _index_store=llfio::file(dirh, "index", llfio::file_flags::read_write); // throws if there was an error
+ _index_store_ecc=llfio::file(dirh, "index.ecc", llfio::file_flags::create | llfio::file_flags::read_write); // throws if there was an error
// Is this store just created?
- if(!_index_store_append->lstat(afio::metadata_flags::size).st_size)
+ if(!_index_store_append->lstat(llfio::metadata_flags::size).st_size)
{
ondisk_file_header header;
header.length=32;
header.index_offset_begin=32;
header.time_count=0;
// This is racy, but the file format doesn't care
- afio::write(_index_store_append, header, 0);
+ llfio::write(_index_store_append, header, 0);
}
_index.reset(new index);
}
@@ -600,12 +600,12 @@ shared_future<data_store::istream> data_store::lookup(std::string name) noexcept
if(_index->key_to_region.end()==it)
return error_code(ENOENT, generic_category()); // not found
auto &r=_index->regions[it->second];
- afio::off_t offset=r.offset+24, length=r.length-24;
+ llfio::off_t offset=r.offset+24, length=r.length-24;
// Schedule the reading of the file into a buffer
auto buffer=std::make_shared<file_buffer_type>((size_t) length);
- afio::future<> h(afio::async_read(_small_blob_store, buffer->data(), (size_t) length, offset));
+ llfio::future<> h(llfio::async_read(_small_blob_store, buffer->data(), (size_t) length, offset));
// When the read completes call this continuation
- return h.then([buffer, length](const afio::future<> &h) -> shared_future<data_store::istream> {
+ return h.then([buffer, length](const llfio::future<> &h) -> shared_future<data_store::istream> {
// If read failed, return the error or exception immediately
BOOST_OUTCOME_PROPAGATE(h);
data_store::istream ret(std::make_shared<idirectstream>(h.get_handle(), buffer, (size_t) length));
diff --git a/attic/example/workshop_naive.cpp b/attic/example/workshop_naive.cpp
index 225d09b7..f97592f0 100644
--- a/attic/example/workshop_naive.cpp
+++ b/attic/example/workshop_naive.cpp
@@ -1,2 +1,2 @@
-#include "afio_pch.hpp"
+#include "llfio_pch.hpp"
#include "workshop_naive.ipp"
diff --git a/attic/example/workshop_naive_afio.cpp b/attic/example/workshop_naive_afio.cpp
index a807b6c8..f4af5eb7 100644
--- a/attic/example/workshop_naive_afio.cpp
+++ b/attic/example/workshop_naive_afio.cpp
@@ -1,2 +1,2 @@
-#include "afio_pch.hpp"
-#include "workshop_naive_afio.ipp"
+#include "llfio_pch.hpp"
+#include "workshop_naive_llfio.ipp"
diff --git a/attic/example/workshop_naive_afio.ipp b/attic/example/workshop_naive_afio.ipp
index 6100ed96..019fe44c 100644
--- a/attic/example/workshop_naive_afio.ipp
+++ b/attic/example/workshop_naive_afio.ipp
@@ -1,12 +1,12 @@
-//[workshop_naive_afio_interface
-namespace afio = BOOST_AFIO_V2_NAMESPACE;
+//[workshop_naive_llfio_interface
+namespace llfio = BOOST_AFIO_V2_NAMESPACE;
namespace filesystem = BOOST_AFIO_V2_NAMESPACE::filesystem;
using BOOST_OUTCOME_V1_NAMESPACE::outcome;
class data_store
{
- afio::dispatcher_ptr _dispatcher;
- afio::handle_ptr _store;
+ llfio::dispatcher_ptr _dispatcher;
+ llfio::handle_ptr _store;
public:
// Type used for read streams
using istream = std::shared_ptr<std::istream>;
@@ -21,7 +21,7 @@ public:
static constexpr size_t writeable = (1<<0);
// Open a data store at path
- data_store(size_t flags = 0, afio::path path = "store");
+ data_store(size_t flags = 0, llfio::path path = "store");
// Look up item named name for reading, returning a std::istream for the item if it exists
outcome<istream> lookup(std::string name) noexcept;
@@ -30,27 +30,27 @@ public:
};
//]
-//[workshop_naive_afio2]
+//[workshop_naive_llfio2]
namespace asio = BOOST_AFIO_V2_NAMESPACE::asio;
using BOOST_OUTCOME_V1_NAMESPACE::empty;
using BOOST_AFIO_V2_NAMESPACE::error_code;
using BOOST_AFIO_V2_NAMESPACE::generic_category;
// A special allocator of highly efficient file i/o memory
-using file_buffer_type = std::vector<char, afio::utils::page_allocator<char>>;
+using file_buffer_type = std::vector<char, llfio::utils::page_allocator<char>>;
// An iostream which reads directly from a memory mapped AFIO file
struct idirectstream : public std::istream
{
struct directstreambuf : public std::streambuf
{
- afio::handle_ptr h; // Holds the file open and therefore mapped
+ llfio::handle_ptr h; // Holds the file open and therefore mapped
file_buffer_type buffer;
- afio::handle::mapped_file_ptr mfp;
- directstreambuf(error_code &ec, afio::handle_ptr _h) : h(std::move(_h))
+ llfio::handle::mapped_file_ptr mfp;
+ directstreambuf(error_code &ec, llfio::handle_ptr _h) : h(std::move(_h))
{
// Get the size of the file. If greater than 128Kb mmap it
- size_t length=(size_t) h->lstat(afio::metadata_flags::size).st_size;
+ size_t length=(size_t) h->lstat(llfio::metadata_flags::size).st_size;
char *p=nullptr;
if(length>=128*1024)
{
@@ -60,7 +60,7 @@ struct idirectstream : public std::istream
if(!p)
{
buffer.resize(length);
- afio::read(ec, h, buffer.data(), length, 0);
+ llfio::read(ec, h, buffer.data(), length, 0);
p=buffer.data();
}
// Set the get buffer this streambuf is to use
@@ -68,7 +68,7 @@ struct idirectstream : public std::istream
}
};
std::unique_ptr<directstreambuf> buf;
- idirectstream(error_code &ec, afio::handle_ptr h) : std::istream(new directstreambuf(ec, std::move(h))), buf(static_cast<directstreambuf *>(rdbuf()))
+ idirectstream(error_code &ec, llfio::handle_ptr h) : std::istream(new directstreambuf(ec, std::move(h))), buf(static_cast<directstreambuf *>(rdbuf()))
{
}
virtual ~idirectstream() override
@@ -85,11 +85,11 @@ struct odirectstream : public std::ostream
{
using int_type = std::streambuf::int_type;
using traits_type = std::streambuf::traits_type;
- afio::future<> lastwrite; // the last async write performed
- afio::off_t offset; // offset of next write
+ llfio::future<> lastwrite; // the last async write performed
+ llfio::off_t offset; // offset of next write
file_buffer_type buffer; // a page size on this machine
file_buffer_type lastbuffer;
- directstreambuf(afio::handle_ptr _h) : lastwrite(std::move(_h)), offset(0), buffer(afio::utils::page_sizes().front())
+ directstreambuf(llfio::handle_ptr _h) : lastwrite(std::move(_h)), offset(0), buffer(llfio::utils::page_sizes().front())
{
// Set the put buffer this streambuf is to use
setp(buffer.data(), buffer.data() + buffer.size());
@@ -102,7 +102,7 @@ struct odirectstream : public std::ostream
// Schedule an asynchronous write of the buffer to storage
size_t thisbuffer = pptr() - pbase();
if(thisbuffer)
- lastwrite = afio::async_write(afio::async_truncate(lastwrite, offset+thisbuffer), buffer.data(), thisbuffer, offset);
+ lastwrite = llfio::async_write(llfio::async_truncate(lastwrite, offset+thisbuffer), buffer.data(), thisbuffer, offset);
lastwrite.get();
}
catch(...)
@@ -134,16 +134,16 @@ struct odirectstream : public std::ostream
buffer.resize(lastbuffer.size());
setp(buffer.data(), buffer.data() + buffer.size());
// Schedule an extension of physical storage by an extra page
- lastwrite = afio::async_truncate(lastwrite, offset + thisbuffer);
+ lastwrite = llfio::async_truncate(lastwrite, offset + thisbuffer);
// Schedule an asynchronous write of the buffer to storage
- lastwrite=afio::async_write(lastwrite, lastbuffer.data(), thisbuffer, offset);
+ lastwrite=llfio::async_write(lastwrite, lastbuffer.data(), thisbuffer, offset);
offset+=thisbuffer;
}
return 0;
}
};
std::unique_ptr<directstreambuf> buf;
- odirectstream(afio::handle_ptr h) : std::ostream(new directstreambuf(std::move(h))), buf(static_cast<directstreambuf *>(rdbuf()))
+ odirectstream(llfio::handle_ptr h) : std::ostream(new directstreambuf(std::move(h))), buf(static_cast<directstreambuf *>(rdbuf()))
{
}
virtual ~odirectstream() override
@@ -154,7 +154,7 @@ struct odirectstream : public std::ostream
};
//]
-//[workshop_naive_afio1]
+//[workshop_naive_llfio1]
namespace asio = BOOST_AFIO_V2_NAMESPACE::asio;
using BOOST_OUTCOME_V1_NAMESPACE::empty;
using BOOST_AFIO_V2_NAMESPACE::error_code;
@@ -169,13 +169,13 @@ static bool is_valid_name(const std::string &name) noexcept
return name[0]!='.';
}
-data_store::data_store(size_t flags, afio::path path)
+data_store::data_store(size_t flags, llfio::path path)
{
// Make a dispatcher for the local filesystem URI, masking out write flags on all operations if not writeable
- _dispatcher=afio::make_dispatcher("file:///", afio::file_flags::none, !(flags & writeable) ? afio::file_flags::write : afio::file_flags::none).get();
+ _dispatcher=llfio::make_dispatcher("file:///", llfio::file_flags::none, !(flags & writeable) ? llfio::file_flags::write : llfio::file_flags::none).get();
// Set the dispatcher for this thread, and open a handle to the store directory
- afio::current_dispatcher_guard h(_dispatcher);
- _store=afio::dir(std::move(path), afio::file_flags::create); // throws if there was an error
+ llfio::current_dispatcher_guard h(_dispatcher);
+ _store=llfio::dir(std::move(path), llfio::file_flags::create); // throws if there was an error
}
outcome<data_store::istream> data_store::lookup(std::string name) noexcept
@@ -188,7 +188,7 @@ outcome<data_store::istream> data_store::lookup(std::string name) noexcept
// Open the file using the handle to the store directory as the base.
// The store directory can be freely renamed by any third party process
// and everything here will work perfectly.
- afio::handle_ptr h(afio::file(ec, _store, name, afio::file_flags::read));
+ llfio::handle_ptr h(llfio::file(ec, _store, name, llfio::file_flags::read));
if(ec)
{
// If the file was not found, return empty else the error
@@ -221,8 +221,8 @@ outcome<data_store::ostream> data_store::write(std::string name) noexcept
// buffer writing - this sends 4Kb pages directly to the physical hardware
// bypassing the kernel file page cache, however this is not optimal if reads of
// the value are likely to occur soon.
- afio::handle_ptr h(afio::file(ec, _store, name, afio::file_flags::create | afio::file_flags::write
- /*| afio::file_flags::os_direct*/));
+ llfio::handle_ptr h(llfio::file(ec, _store, name, llfio::file_flags::create | llfio::file_flags::write
+ /*| llfio::file_flags::os_direct*/));
if(ec)
return ec;
// Create an ostream which directly uses the mapped file.
diff --git a/attic/example/workshop_naive_async_afio.cpp b/attic/example/workshop_naive_async_afio.cpp
index 86cb8052..92197aba 100644
--- a/attic/example/workshop_naive_async_afio.cpp
+++ b/attic/example/workshop_naive_async_afio.cpp
@@ -1,2 +1,2 @@
-#include "afio_pch.hpp"
-#include "workshop_naive_async_afio.ipp"
+#include "llfio_pch.hpp"
+#include "workshop_naive_async_llfio.ipp"
diff --git a/attic/example/workshop_naive_async_afio.ipp b/attic/example/workshop_naive_async_afio.ipp
index 651d2a4e..bfa61111 100644
--- a/attic/example/workshop_naive_async_afio.ipp
+++ b/attic/example/workshop_naive_async_afio.ipp
@@ -1,12 +1,12 @@
-//[workshop_naive_async_afio_interface
-namespace afio = BOOST_AFIO_V2_NAMESPACE;
+//[workshop_naive_async_llfio_interface
+namespace llfio = BOOST_AFIO_V2_NAMESPACE;
namespace filesystem = BOOST_AFIO_V2_NAMESPACE::filesystem;
using BOOST_OUTCOME_V1_NAMESPACE::lightweight_futures::shared_future;
class data_store
{
- afio::dispatcher_ptr _dispatcher;
- afio::handle_ptr _store;
+ llfio::dispatcher_ptr _dispatcher;
+ llfio::handle_ptr _store;
public:
// Type used for read streams
using istream = std::shared_ptr<std::istream>;
@@ -21,7 +21,7 @@ public:
static constexpr size_t writeable = (1<<0);
// Open a data store at path
- data_store(size_t flags = 0, afio::path path = "store");
+ data_store(size_t flags = 0, llfio::path path = "store");
// Look up item named name for reading, returning an istream for the item
shared_future<istream> lookup(std::string name) noexcept;
@@ -30,37 +30,37 @@ public:
};
//]
-//[workshop_naive_async_afio3]
+//[workshop_naive_async_llfio3]
namespace asio = BOOST_AFIO_V2_NAMESPACE::asio;
using BOOST_AFIO_V2_NAMESPACE::error_code;
using BOOST_AFIO_V2_NAMESPACE::generic_category;
// A special allocator of highly efficient file i/o memory
-using file_buffer_type = std::vector<char, afio::utils::page_allocator<char>>;
+using file_buffer_type = std::vector<char, llfio::utils::page_allocator<char>>;
// An iostream which reads directly from a memory mapped AFIO file
struct idirectstream : public std::istream
{
struct directstreambuf : public std::streambuf
{
- afio::handle_ptr h; // Holds the file open
+ llfio::handle_ptr h; // Holds the file open
std::shared_ptr<file_buffer_type> buffer;
- afio::handle::mapped_file_ptr mfp;
+ llfio::handle::mapped_file_ptr mfp;
// From a mmap
- directstreambuf(afio::handle_ptr _h, afio::handle::mapped_file_ptr _mfp, size_t length) : h(std::move(_h)), mfp(std::move(_mfp))
+ directstreambuf(llfio::handle_ptr _h, llfio::handle::mapped_file_ptr _mfp, size_t length) : h(std::move(_h)), mfp(std::move(_mfp))
{
// Set the get buffer this streambuf is to use
setg((char *) mfp->addr, (char *) mfp->addr, (char *) mfp->addr + length);
}
// From a malloc
- directstreambuf(afio::handle_ptr _h, std::shared_ptr<file_buffer_type> _buffer, size_t length) : h(std::move(_h)), buffer(std::move(_buffer))
+ directstreambuf(llfio::handle_ptr _h, std::shared_ptr<file_buffer_type> _buffer, size_t length) : h(std::move(_h)), buffer(std::move(_buffer))
{
// Set the get buffer this streambuf is to use
setg(buffer->data(), buffer->data(), buffer->data() + length);
}
};
std::unique_ptr<directstreambuf> buf;
- template<class U> idirectstream(afio::handle_ptr h, U &&buffer, size_t length) : std::istream(new directstreambuf(std::move(h), std::forward<U>(buffer), length)), buf(static_cast<directstreambuf *>(rdbuf()))
+ template<class U> idirectstream(llfio::handle_ptr h, U &&buffer, size_t length) : std::istream(new directstreambuf(std::move(h), std::forward<U>(buffer), length)), buf(static_cast<directstreambuf *>(rdbuf()))
{
}
virtual ~idirectstream() override
@@ -77,11 +77,11 @@ struct odirectstream : public std::ostream
{
using int_type = std::streambuf::int_type;
using traits_type = std::streambuf::traits_type;
- afio::future<> lastwrite; // the last async write performed
- afio::off_t offset; // offset of next write
+ llfio::future<> lastwrite; // the last async write performed
+ llfio::off_t offset; // offset of next write
file_buffer_type buffer; // a page size on this machine
file_buffer_type lastbuffer;
- directstreambuf(afio::handle_ptr _h) : lastwrite(std::move(_h)), offset(0), buffer(afio::utils::page_sizes().front())
+ directstreambuf(llfio::handle_ptr _h) : lastwrite(std::move(_h)), offset(0), buffer(llfio::utils::page_sizes().front())
{
// Set the put buffer this streambuf is to use
setp(buffer.data(), buffer.data() + buffer.size());
@@ -94,7 +94,7 @@ struct odirectstream : public std::ostream
// Schedule an asynchronous write of the buffer to storage
size_t thisbuffer = pptr() - pbase();
if(thisbuffer)
- lastwrite = afio::async_write(afio::async_truncate(lastwrite, offset+thisbuffer), buffer.data(), thisbuffer, offset);
+ lastwrite = llfio::async_write(llfio::async_truncate(lastwrite, offset+thisbuffer), buffer.data(), thisbuffer, offset);
lastwrite.get();
}
catch(...)
@@ -126,16 +126,16 @@ struct odirectstream : public std::ostream
buffer.resize(lastbuffer.size());
setp(buffer.data(), buffer.data() + buffer.size());
// Schedule an extension of physical storage by an extra page
- lastwrite = afio::async_truncate(lastwrite, offset + thisbuffer);
+ lastwrite = llfio::async_truncate(lastwrite, offset + thisbuffer);
// Schedule an asynchronous write of the buffer to storage
- lastwrite=afio::async_write(lastwrite, lastbuffer.data(), thisbuffer, offset);
+ lastwrite=llfio::async_write(lastwrite, lastbuffer.data(), thisbuffer, offset);
offset+=thisbuffer;
}
return 0;
}
};
std::unique_ptr<directstreambuf> buf;
- odirectstream(afio::handle_ptr h) : std::ostream(new directstreambuf(std::move(h))), buf(static_cast<directstreambuf *>(rdbuf()))
+ odirectstream(llfio::handle_ptr h) : std::ostream(new directstreambuf(std::move(h))), buf(static_cast<directstreambuf *>(rdbuf()))
{
}
virtual ~odirectstream() override
@@ -159,16 +159,16 @@ static bool is_valid_name(const std::string &name) noexcept
return name[0]!='.';
}
-data_store::data_store(size_t flags, afio::path path)
+data_store::data_store(size_t flags, llfio::path path)
{
// Make a dispatcher for the local filesystem URI, masking out write flags on all operations if not writeable
- _dispatcher=afio::make_dispatcher("file:///", afio::file_flags::none, !(flags & writeable) ? afio::file_flags::write : afio::file_flags::none).get();
+ _dispatcher=llfio::make_dispatcher("file:///", llfio::file_flags::none, !(flags & writeable) ? llfio::file_flags::write : llfio::file_flags::none).get();
// Set the dispatcher for this thread, and open a handle to the store directory
- afio::current_dispatcher_guard h(_dispatcher);
- _store=afio::dir(std::move(path), afio::file_flags::create); // throws if there was an error
+ llfio::current_dispatcher_guard h(_dispatcher);
+ _store=llfio::dir(std::move(path), llfio::file_flags::create); // throws if there was an error
}
-//[workshop_naive_async_afio2]
+//[workshop_naive_async_llfio2]
shared_future<data_store::istream> data_store::lookup(std::string name) noexcept
{
if(!is_valid_name(name))
@@ -176,16 +176,16 @@ shared_future<data_store::istream> data_store::lookup(std::string name) noexcept
try
{
// Schedule the opening of the file for reading
- afio::future<> h(afio::async_file(_store, name, afio::file_flags::read));
+ llfio::future<> h(llfio::async_file(_store, name, llfio::file_flags::read));
// When it completes, call this continuation
- return h.then([](afio::future<> &_h) -> shared_future<data_store::istream> {
+ return h.then([](llfio::future<> &_h) -> shared_future<data_store::istream> {
// If file didn't open, return the error or exception immediately
BOOST_OUTCOME_PROPAGATE(_h);
- size_t length=(size_t) _h->lstat(afio::metadata_flags::size).st_size;
+ size_t length=(size_t) _h->lstat(llfio::metadata_flags::size).st_size;
// Is a memory map more appropriate?
if(length>=128*1024)
{
- afio::handle::mapped_file_ptr mfp;
+ llfio::handle::mapped_file_ptr mfp;
if((mfp=_h->map_file()))
{
data_store::istream ret(std::make_shared<idirectstream>(_h.get_handle(), std::move(mfp), length));
@@ -194,9 +194,9 @@ shared_future<data_store::istream> data_store::lookup(std::string name) noexcept
}
// Schedule the reading of the file into a buffer
auto buffer=std::make_shared<file_buffer_type>(length);
- afio::future<> h(afio::async_read(_h, buffer->data(), length, 0));
+ llfio::future<> h(llfio::async_read(_h, buffer->data(), length, 0));
// When the read completes call this continuation
- return h.then([buffer, length](const afio::future<> &h) -> shared_future<data_store::istream> {
+ return h.then([buffer, length](const llfio::future<> &h) -> shared_future<data_store::istream> {
// If read failed, return the error or exception immediately
BOOST_OUTCOME_PROPAGATE(h);
data_store::istream ret(std::make_shared<idirectstream>(h.get_handle(), buffer, length));
@@ -212,7 +212,7 @@ shared_future<data_store::istream> data_store::lookup(std::string name) noexcept
}
//]
-//[workshop_naive_async_afio1]
+//[workshop_naive_async_llfio1]
shared_future<data_store::ostream> data_store::write(std::string name) noexcept
{
if(!is_valid_name(name))
@@ -220,9 +220,9 @@ shared_future<data_store::ostream> data_store::write(std::string name) noexcept
try
{
// Schedule the opening of the file for writing
- afio::future<> h(afio::async_file(_store, name, afio::file_flags::create | afio::file_flags::write));
+ llfio::future<> h(llfio::async_file(_store, name, llfio::file_flags::create | llfio::file_flags::write));
// When it completes, call this continuation
- return h.then([](const afio::future<> &h) -> shared_future<data_store::ostream> {
+ return h.then([](const llfio::future<> &h) -> shared_future<data_store::ostream> {
// If file didn't open, return the error or exception immediately
BOOST_OUTCOME_PROPAGATE(h);
// Create an ostream which directly uses the file.
diff --git a/attic/include/boost/afio/v2/afio.hpp b/attic/include/boost/afio/v2/afio.hpp
index acba7071..fc5fa1e9 100644
--- a/attic/include/boost/afio/v2/afio.hpp
+++ b/attic/include/boost/afio/v2/afio.hpp
@@ -48,8 +48,8 @@ DEALINGS IN THE SOFTWARE.
#undef BOOST_AFIO_HEADERS_ONLY_MEMFUNC_SPEC
#undef BOOST_AFIO_HEADERS_ONLY_VIRTUAL_SPEC
-#define BOOST_AFIO_V2_NAMESPACE boost::afio
-#define BOOST_AFIO_V2_NAMESPACE_BEGIN namespace boost { namespace afio {
+#define BOOST_AFIO_V2_NAMESPACE boost::llfio
+#define BOOST_AFIO_V2_NAMESPACE_BEGIN namespace boost { namespace llfio {
#define BOOST_AFIO_V2_NAMESPACE_END } }
#define BOOST_AFIO_HEADERS_ONLY_MEMFUNC_SPEC
#define BOOST_AFIO_HEADERS_ONLY_VIRTUAL_SPEC virtual
@@ -88,7 +88,7 @@ for dispatch. This, being very useful for debugging, defaults to 1 except when
#pragma warning(disable: 4251) // type needs to have dll-interface to be used by clients of class
#endif
-/*! \file afio.hpp
+/*! \file llfio.hpp
\brief Provides a batch asynchronous file i/o implementation based on Boost.ASIO
*/
/*! \def BOOST_AFIO_HEADERS_ONLY
@@ -296,7 +296,7 @@ class std_thread_pool : public thread_source {
explicit worker(std_thread_pool *p) : pool(p) { }
void operator()()
{
- detail::set_threadname("boost::afio::std_thread_pool worker");
+ detail::set_threadname("boost::llfio::std_thread_pool worker");
try
{
pool->service.run();
@@ -797,7 +797,7 @@ using handle_ptr = std::shared_ptr<handle>;
\brief Bitflags for availability of metadata from `struct stat_t`
\ingroup metadata_flags
-See __afio_stat_t__ for explanation of meaning.
+See __llfio_stat_t__ for explanation of meaning.
*/
enum class metadata_flags : size_t
{
@@ -977,7 +977,7 @@ struct statfs_t
Note that `directory_entry_hash` will hash one of these for you, and a `std::hash<directory_entry>` specialisation
is defined for you so you ought to be able to use directory_entry directly in an `unordered_map<>`.
-See `__afio_stat_t__` for explanations of the fields.
+See `__llfio_stat_t__` for explanations of the fields.
\qbk{
[include generated/struct_directory_entry_hash.qbk]
@@ -1210,7 +1210,7 @@ public:
off_t write_count_since_fsync() const { return byteswritten-byteswrittenatlastfsync; }
/*! \brief Returns a mostly filled directory_entry for the file or directory referenced by this handle. Use `metadata_flags::All` if you want it as complete as your platform allows, even at the cost of severe performance loss.
- Related types: `__afio_directory_entry__`, `__afio_stat_t__`
+ Related types: `__llfio_directory_entry__`, `__llfio_stat_t__`
\return A directory entry for this handle.
\param wanted The metadata wanted.
\ingroup async_io_handle__ops
@@ -1224,7 +1224,7 @@ public:
BOOST_AFIO_HEADERS_ONLY_VIRTUAL_SPEC directory_entry direntry(metadata_flags wanted=directory_entry::metadata_fastpath()) BOOST_AFIO_HEADERS_ONLY_VIRTUAL_UNDEFINED_SPEC
/*! \brief Returns a mostly filled stat_t structure for the file or directory referenced by this handle. Use `metadata_flags::All` if you want it as complete as your platform allows, even at the cost of severe performance loss. Calls direntry(), so same race guarantees as that call.
- Related types: `__afio_directory_entry__`, `__afio_stat_t__`
+ Related types: `__llfio_directory_entry__`, `__llfio_stat_t__`
*/
stat_t lstat(metadata_flags wanted=directory_entry::metadata_fastpath())
{
@@ -1273,7 +1273,7 @@ public:
\ntkernelnamespacenote
- Related types: `__afio_path_req__`
+ Related types: `__llfio_path_req__`
\param req The absolute or relative (in which case precondition specifies a directory) path to create a hard link at.
\ingroup async_io_handle__ops
@@ -1289,7 +1289,7 @@ public:
On Microsoft Windows, this routine unlinks items as follows:
- 1. It tries to atomically rename the item to the root of the mounted volume it lives in with a .afiodXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX where
+ 1. It tries to atomically rename the item to the root of the mounted volume it lives in with a .llfiodXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX where
the X's are a 128 bit crypto random hexadecimal. If that fails, it tries the next directory up, and
the next after that until success if any. This rename may fail for any reason, including if it is a directory with
open file handles somewhere within. If it fails, the rename is skipped.
@@ -1309,7 +1309,7 @@ public:
\ntkernelnamespacenote
- Related types: `__afio_path_req__`
+ Related types: `__llfio_path_req__`
\ingroup async_io_handle__ops
\raceguarantees{
@@ -1335,7 +1335,7 @@ public:
\ntkernelnamespacenote
- Related types: `__afio_path_req__`
+ Related types: `__llfio_path_req__`
\param req The absolute or relative (in which case precondition specifies a directory) path to relink to.
\ingroup async_io_handle__ops
@@ -1407,7 +1407,7 @@ public:
void reset(dispatcher_ptr p) { _old=p; }
};
-//! Trait for determining if a type is an afio::future<T>
+//! Trait for determining if a type is an llfio::future<T>
template<class T> struct is_future : std::false_type { };
template<class T> struct is_future<future<T>> : std::true_type {};
@@ -1419,7 +1419,7 @@ namespace detail
template<bool rethrow, class Iterator> inline stl_future<handle_ptr> when_any_ops(Iterator first, Iterator last);
// Shim code for lightweight future continuations
- template<class R, bool return_is_lightweight_future=is_lightweight_future<R>::value, bool return_is_afio_future=is_future<R>::value> struct continuation_return_type { using future_type = future<R>; using promise_type = void; };
+ template<class R, bool return_is_lightweight_future=is_lightweight_future<R>::value, bool return_is_llfio_future=is_future<R>::value> struct continuation_return_type { using future_type = future<R>; using promise_type = void; };
template<class R, bool _> struct continuation_return_type<R, true, _> { using future_type = R; using promise_type = typename future_type::promise_type; };
template<class R, bool _> struct continuation_return_type<R, _, true> { using future_type = R; using promise_type = void; };
template<class future_type, class promise_type> struct do_continuation;
@@ -1792,10 +1792,10 @@ namespace detail
\brief Abstract base class for dispatching file i/o asynchronously
This is a reference counted instance with platform-specific implementation in object code.
-Construct an instance using the `boost::afio::make_dispatcher()` function.
+Construct an instance using the `boost::llfio::make_dispatcher()` function.
\qbk{
-[/ link afio.reference.functions.async_file_io_dispatcher `async_file_io_dispatcher()`]
+[/ link llfio.reference.functions.async_file_io_dispatcher `async_file_io_dispatcher()`]
[/ include generated/group_dispatcher__filter.qbk]
[/ include generated/group_dispatcher__completion.qbk]
[/ include generated/group_dispatcher__call.qbk]
@@ -6219,7 +6219,7 @@ namespace utils
contiguous in physical memory. Regions returned by this allocator \em may be allocated contiguously in physical
memory and therefore the kernel can pass through your scatter gather buffers unmodified.
- A particularly useful combination with this allocator is with the page_sizes() member function of __afio_dispatcher__.
+ A particularly useful combination with this allocator is with the page_sizes() member function of __llfio_dispatcher__.
This will return which pages sizes are possible, and which page sizes are enabled for this user. If writing a
file copy routine for example, using this allocator with the largest page size as the copy chunk makes a great
deal of sense.
@@ -6342,7 +6342,7 @@ namespace std
#if BOOST_AFIO_HEADERS_ONLY == 1 && !defined(DOXYGEN_SHOULD_SKIP_THIS)
#undef BOOST_AFIO_VALIDATE_INPUTS // Let BOOST_AFIO_NEVER_VALIDATE_INPUTS take over
#define BOOST_AFIO_HEADER_INCLUDED 1
-#include "detail/impl/afio.ipp"
+#include "detail/impl/llfio.ipp"
#undef BOOST_AFIO_HEADER_INCLUDED
#endif
diff --git a/attic/include/boost/afio/v2/config.hpp b/attic/include/boost/afio/v2/config.hpp
index 35dda16d..9d925c4d 100644
--- a/attic/include/boost/afio/v2/config.hpp
+++ b/attic/include/boost/afio/v2/config.hpp
@@ -149,9 +149,9 @@ DEALINGS IN THE SOFTWARE.
# include "boost/thread/future.hpp"
#endif
#if BOOST_AFIO_LATEST_VERSION == 2
-# define BOOST_AFIO_V2 (boost), (afio), (BOOST_BINDLIB_NAMESPACE_VERSION(v2, BOOST_AFIO_V2_STL11_IMPL, BOOST_AFIO_V2_FILESYSTEM_IMPL, BOOST_AFIO_V2_ASIO_IMPL), inline)
+# define BOOST_AFIO_V2 (boost), (llfio), (BOOST_BINDLIB_NAMESPACE_VERSION(v2, BOOST_AFIO_V2_STL11_IMPL, BOOST_AFIO_V2_FILESYSTEM_IMPL, BOOST_AFIO_V2_ASIO_IMPL), inline)
#else
-# define BOOST_AFIO_V2 (boost), (afio), (BOOST_BINDLIB_NAMESPACE_VERSION(v2, BOOST_AFIO_V2_STL11_IMPL, BOOST_AFIO_V2_FILESYSTEM_IMPL, BOOST_AFIO_V2_ASIO_IMPL))
+# define BOOST_AFIO_V2 (boost), (llfio), (BOOST_BINDLIB_NAMESPACE_VERSION(v2, BOOST_AFIO_V2_STL11_IMPL, BOOST_AFIO_V2_FILESYSTEM_IMPL, BOOST_AFIO_V2_ASIO_IMPL))
#endif
#define BOOST_AFIO_V2_NAMESPACE BOOST_BINDLIB_NAMESPACE (BOOST_AFIO_V2)
#define BOOST_AFIO_V2_NAMESPACE_BEGIN BOOST_BINDLIB_NAMESPACE_BEGIN(BOOST_AFIO_V2)
@@ -422,7 +422,7 @@ BOOST_AFIO_V2_NAMESPACE_END
#if !defined(BOOST_AFIO_SOURCE) && !defined(BOOST_ALL_NO_LIB) && \
!defined(BOOST_AFIO_NO_LIB) && !AFIO_STANDALONE && !BOOST_AFIO_HEADERS_ONLY
-#define BOOST_LIB_NAME boost_afio
+#define BOOST_LIB_NAME boost_llfio
// tell the auto-link code to select a dll when required:
#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_AFIO_DYN_LINK)
diff --git a/attic/include/boost/afio/v2/detail/Utility.hpp b/attic/include/boost/afio/v2/detail/Utility.hpp
index ea8acdf2..89464685 100644
--- a/attic/include/boost/afio/v2/detail/Utility.hpp
+++ b/attic/include/boost/afio/v2/detail/Utility.hpp
@@ -111,20 +111,20 @@ BOOST_AFIO_V2_NAMESPACE_END
#ifdef BOOST_AFIO_COMPILING_FOR_GCOV
#define BOOST_AFIO_THROW_FATAL(x) std::terminate()
#else
-namespace boost { namespace afio { namespace fatal_exception_throw {
+namespace boost { namespace llfio { namespace fatal_exception_throw {
template<class T> inline void do_throw_fatal_exception(const T &v) noexcept
{
BOOST_AFIO_V2_NAMESPACE::detail::print_fatal_exception_message_to_stderr(v.what());
throw v;
}
- extern "C" inline void boost_afio_do_throw_fatal_exception(std::function<void()> impl) noexcept{ impl(); }
+ extern "C" inline void boost_llfio_do_throw_fatal_exception(std::function<void()> impl) noexcept{ impl(); }
template<class T> inline void throw_fatal_exception(const T &v) noexcept
{
// In case the extern "C" fails to terminate, trap and terminate here
try
{
std::function<void()> doer=std::bind(&do_throw_fatal_exception<T>, std::ref(v));
- boost_afio_do_throw_fatal_exception(doer);
+ boost_llfio_do_throw_fatal_exception(doer);
}
catch(...)
{
@@ -132,7 +132,7 @@ namespace boost { namespace afio { namespace fatal_exception_throw {
}
}
} } }
-#define BOOST_AFIO_THROW_FATAL(x) boost::afio::fatal_exception_throw::throw_fatal_exception(x)
+#define BOOST_AFIO_THROW_FATAL(x) boost::llfio::fatal_exception_throw::throw_fatal_exception(x)
#endif
#ifdef _MSC_VER
#pragma warning(pop)
diff --git a/attic/include/boost/afio/v2/detail/impl/ErrorHandling.ipp b/attic/include/boost/afio/v2/detail/impl/ErrorHandling.ipp
index 28c319b0..e45c0bf1 100644
--- a/attic/include/boost/afio/v2/detail/impl/ErrorHandling.ipp
+++ b/attic/include/boost/afio/v2/detail/impl/ErrorHandling.ipp
@@ -5,7 +5,7 @@ File Created: Nov 2012
#define _CRT_SECURE_NO_WARNINGS
-#include "../../afio.hpp"
+#include "../../llfio.hpp"
#include <locale>
#include <cstring>
@@ -16,12 +16,12 @@ namespace detail {
#ifdef BOOST_AFIO_OP_STACKBACKTRACEDEPTH
try
{
- if(!afio_exception_stack())
- afio_exception_stack()=new afio_exception_stack_t;
- afio_exception_stack_entry se;
+ if(!llfio_exception_stack())
+ llfio_exception_stack()=new llfio_exception_stack_t;
+ llfio_exception_stack_entry se;
se.name=std::move(name);
collect_stack(se.stack);
- afio_exception_stack()->push_back(std::move(se));
+ llfio_exception_stack()->push_back(std::move(se));
} catch(...) { }
#endif
}
diff --git a/attic/include/boost/afio/v2/detail/impl/afio.ipp b/attic/include/boost/afio/v2/detail/impl/afio.ipp
index 744f2dac..28dc3a6a 100644
--- a/attic/include/boost/afio/v2/detail/impl/afio.ipp
+++ b/attic/include/boost/afio/v2/detail/impl/afio.ipp
@@ -63,7 +63,7 @@ File Created: Mar 2013
#define _GNU_SOURCE
#endif
-#include "../../afio.hpp"
+#include "../../llfio.hpp"
#ifndef BOOST_AFIO_DISABLE_VALGRIND
# include "../valgrind/memcheck.h"
#else
@@ -254,7 +254,7 @@ static inline chrono::system_clock::time_point to_timepoint(struct timespec ts)
}
static inline void fill_stat_t(stat_t &stat, BOOST_AFIO_POSIX_STAT_STRUCT s, metadata_flags wanted)
{
- using namespace boost::afio;
+ using namespace boost::llfio;
if(!!(wanted&metadata_flags::dev)) { stat.st_dev=s.st_dev; }
if(!!(wanted&metadata_flags::ino)) { stat.st_ino=s.st_ino; }
if(!!(wanted&metadata_flags::type)) { stat.st_type=to_st_type(s.st_mode); }
@@ -439,15 +439,15 @@ BOOST_AFIO_V2_NAMESPACE_END
#endif
BOOST_AFIO_V2_NAMESPACE_BEGIN
-struct afio_exception_stack_entry
+struct llfio_exception_stack_entry
{
std::string name;
stack_type stack;
};
-typedef std::vector<afio_exception_stack_entry> afio_exception_stack_t;
-inline afio_exception_stack_t *&afio_exception_stack()
+typedef std::vector<llfio_exception_stack_entry> llfio_exception_stack_t;
+inline llfio_exception_stack_t *&llfio_exception_stack()
{
- static BOOST_AFIO_THREAD_LOCAL afio_exception_stack_t *s;
+ static BOOST_AFIO_THREAD_LOCAL llfio_exception_stack_t *s;
return s;
}
BOOST_AFIO_V2_NAMESPACE_END
@@ -580,7 +580,7 @@ namespace detail {
protected:
actual_lock_file(BOOST_AFIO_V2_NAMESPACE::path p) : path(p), lockfilepath(p)
{
- lockfilepath+=".afiolockfile";
+ lockfilepath+=".llfiolockfile";
}
public:
~actual_lock_file()
@@ -1336,7 +1336,7 @@ update_path:
if(it->second.expired())
{
#ifndef NDEBUG
- std::cout << "afio: directory cached handle pruned stale " << it->first << std::endl;
+ std::cout << "llfio: directory cached handle pruned stale " << it->first << std::endl;
#endif
it=dirhcache.erase(it);
continue;
@@ -1364,7 +1364,7 @@ update_path:
dirh=std::move(result.second);
#ifndef NDEBUG
if(dirh)
- std::cout << "afio: directory cached handle created for " << req.path << " (" << dirh.get() << ")" << std::endl;
+ std::cout << "llfio: directory cached handle created for " << req.path << " (" << dirh.get() << ")" << std::endl;
#endif
if(dirh)
{
@@ -1751,7 +1751,7 @@ BOOST_AFIO_HEADERS_ONLY_MEMFUNC_SPEC void dispatcher::int_directory_cached_handl
}
}
#ifndef NDEBUG
- std::cout << "afio: directory cached handle we relocate from " << oldpath << " to " << newpath << " (" << h.get() << ")" << std::endl;
+ std::cout << "llfio: directory cached handle we relocate from " << oldpath << " to " << newpath << " (" << h.get() << ")" << std::endl;
#endif
if(!newpath.empty())
p->dirhcache.insert(std::make_pair(std::move(newpath), std::move(h)));
@@ -1908,10 +1908,10 @@ BOOST_AFIO_HEADERS_ONLY_MEMFUNC_SPEC void dispatcher::complete_async_op(size_t i
{
#ifdef BOOST_AFIO_OP_STACKBACKTRACEDEPTH
auto unexception_stack=detail::Undoer([]{
- delete afio_exception_stack();
- afio_exception_stack()=nullptr;
+ delete llfio_exception_stack();
+ llfio_exception_stack()=nullptr;
});
- if(afio_exception_stack() && !(p->testing_flags & detail::unit_testing_flags::no_symbol_lookup))
+ if(llfio_exception_stack() && !(p->testing_flags & detail::unit_testing_flags::no_symbol_lookup))
{
std::string originalmsg;
error_code ec;
@@ -1927,7 +1927,7 @@ BOOST_AFIO_HEADERS_ONLY_MEMFUNC_SPEC void dispatcher::complete_async_op(size_t i
buffer << originalmsg << ". Op was scheduled at:\n";
print_stack(buffer, thisop->stack);
buffer << "Exceptions were thrown within the engine at:\n";
- for(auto &i : *afio_exception_stack())
+ for(auto &i : *llfio_exception_stack())
{
//buffer << i.name << " Backtrace:\n";
print_stack(buffer, i.stack);
@@ -3335,7 +3335,7 @@ namespace detail {
BOOST_AFIO_V2_NAMESPACE_END
#if defined(WIN32) && !defined(USE_POSIX_ON_WIN32)
-#include "afio_iocp.ipp"
+#include "llfio_iocp.ipp"
#endif
BOOST_AFIO_V2_NAMESPACE_BEGIN
@@ -3619,7 +3619,7 @@ namespace utils
}
#ifndef NDEBUG
else if(ret.page_size_used>65536)
- std::cout << "afio: Large page allocation successful" << std::endl;
+ std::cout << "llfio: Large page allocation successful" << std::endl;
#endif
#else
int flags=MAP_SHARED|MAP_ANON;
@@ -3644,7 +3644,7 @@ namespace utils
}
#ifndef NDEBUG
else if(ret.page_size_used>65536)
- std::cout << "afio: Large page allocation successful" << std::endl;
+ std::cout << "llfio: Large page allocation successful" << std::endl;
#endif
#endif
return ret;
diff --git a/attic/include/boost/afio/v2/detail/impl/afio_iocp.ipp b/attic/include/boost/afio/v2/detail/impl/afio_iocp.ipp
index 012d4aaa..8f79a2dc 100644
--- a/attic/include/boost/afio/v2/detail/impl/afio_iocp.ipp
+++ b/attic/include/boost/afio/v2/detail/impl/afio_iocp.ipp
@@ -115,9 +115,9 @@ namespace detail {
// Two modes of calling, either a handle or a leafname + dir handle
static inline bool isDeletedFile(path::string_type leafname)
{
- if(leafname.size()==64+6 && !leafname.compare(0, 6, L".afiod"))
+ if(leafname.size()==64+6 && !leafname.compare(0, 6, L".llfiod"))
{
- // Could be one of our "deleted" files, is he ".afiod" + all hex?
+ // Could be one of our "deleted" files, is he ".llfiod" + all hex?
for(size_t n=6; n<leafname.size(); n++)
{
auto c=leafname[n];
@@ -622,7 +622,7 @@ namespace detail
BOOST_AFIO_TYPEALIGNMENT(8) path::value_type buffer[32769+sizeof(FILE_NAME_INFORMATION)/sizeof(path::value_type)];
// This is done in two steps to stop annoying temporary failures
// Firstly, get where I am within my volume, NtQueryObject returns too much so simply fetch my current name
- // Then try to rename myself to the closest to the root as possible with a .afiodXXXXX crypto random name
+ // Then try to rename myself to the closest to the root as possible with a .llfiodXXXXX crypto random name
// If I fail to rename myself there, try the next directory up, usually at some point I'll find some directory
// I'm allowed write to
FILE_NAME_INFORMATION *fni=(FILE_NAME_INFORMATION *) buffer;
@@ -630,7 +630,7 @@ namespace detail
bool success=false;
do
{
- auto _randomname(".afiod"+utils::random_string(32 /* 128 bits */));
+ auto _randomname(".llfiod"+utils::random_string(32 /* 128 bits */));
filesystem::path::string_type randomname(_randomname.begin(), _randomname.end());
mypath=path(true);
BOOST_AFIO_ERRHNTFN(NtQueryInformationFile(myid, &isb, fni, sizeof(buffer), FileNameInformation), [this]{return path(); });
@@ -782,7 +782,7 @@ namespace detail
FILE_RENAME_INFORMATION *fni=(FILE_RENAME_INFORMATION *) buffer;
fni->ReplaceIfExists=false;
fni->RootDirectory=nullptr; // same directory
- auto randompath(".afiod"+utils::random_string(32 /* 128 bits */));
+ auto randompath(".llfiod"+utils::random_string(32 /* 128 bits */));
fni->FileNameLength=(ULONG)(randompath.size()*sizeof(path::value_type));
for(size_t n=0; n<randompath.size(); n++)
fni->FileName[n]=randompath[n];
diff --git a/attic/include/boost/afio/v2/detail/impl/nt_kernel_stuff.hpp b/attic/include/boost/afio/v2/detail/impl/nt_kernel_stuff.hpp
index 1c976a8a..1da37d83 100644
--- a/attic/include/boost/afio/v2/detail/impl/nt_kernel_stuff.hpp
+++ b/attic/include/boost/afio/v2/detail/impl/nt_kernel_stuff.hpp
@@ -700,7 +700,7 @@ static inline int winftruncate(int fd, off_t _newsize)
}
static inline void fill_stat_t(stat_t &stat, BOOST_AFIO_POSIX_STAT_STRUCT s, metadata_flags wanted)
{
- using namespace boost::afio;
+ using namespace boost::llfio;
#ifndef WIN32
if(!!(wanted&metadata_flags::dev)) { stat.st_dev=s.st_dev; }
#endif
diff --git a/attic/src/afio.cpp b/attic/src/afio.cpp
index 61fb13cf..4e65dab3 100644
--- a/attic/src/afio.cpp
+++ b/attic/src/afio.cpp
@@ -19,9 +19,9 @@ File Created: Mar 2013
#define BOOST_AFIO_VALIDATE_INPUTS 1
#endif
-#include "boost/afio/afio.hpp"
+#include "boost/llfio/llfio.hpp"
#if BOOST_AFIO_LATEST_VERSION != 2
-# error Mismatched afio.cpp to latest version
+# error Mismatched llfio.cpp to latest version
#endif
-#include "boost/afio/v2/detail/impl/afio.ipp"
+#include "boost/llfio/v2/detail/impl/llfio.ipp"
diff --git a/attic/test/afio_pch.hpp b/attic/test/afio_pch.hpp
index 9a908b9f..2c6ec1b5 100644
--- a/attic/test/afio_pch.hpp
+++ b/attic/test/afio_pch.hpp
@@ -1,7 +1,7 @@
#ifndef BOOST_AFIO_PCH_HPP
# define BOOST_AFIO_PCH_HPP
# define BOOST_AFIO_ENABLE_BENCHMARKING_COMPLETION
-# include "boost/afio/afio.hpp"
+# include "boost/llfio/llfio.hpp"
# include <iostream>
# include <fstream>
#endif
diff --git a/attic/test/test_functions.hpp b/attic/test/test_functions.hpp
index 7606f6a8..8b56d2df 100644
--- a/attic/test/test_functions.hpp
+++ b/attic/test/test_functions.hpp
@@ -14,7 +14,7 @@ Created: Feb 2013
#define _CRT_SECURE_NO_WARNINGS
-#include "boost/afio/afio.hpp"
+#include "boost/llfio/llfio.hpp"
#ifdef __MINGW32__
#include <stdlib.h> // To pull in __MINGW64_VERSION_MAJOR
@@ -37,7 +37,7 @@ extern "C" void tzset(void);
#include <fstream>
#include "../detail/SpookyV2.h"
#include "Aligned_Allocator.hpp"
-#include "boost/afio/v2/detail/valgrind/valgrind.h"
+#include "boost/llfio/v2/detail/valgrind/valgrind.h"
#include <time.h>
#ifdef BOOST_AFIO_INCLUDE_SPOOKY_IMPL
@@ -85,7 +85,7 @@ try{\
}catch(...){BOOST_FAIL("Exception was thrown");}
#else
-# include "../include/boost/afio/bindlib/include/boost/test/unit_test.hpp"
+# include "../include/boost/llfio/bindlib/include/boost/test/unit_test.hpp"
# define BOOST_AFIO_CHECK_THROWS(expr) BOOST_CHECK_THROWS(expr)
# define BOOST_AFIO_CHECK_NO_THROW(expr) BOOST_CHECK_NO_THROW(expr)
#endif
@@ -761,7 +761,7 @@ static std::ostream &operator<<(std::ostream &s, const chrono::system_clock::tim
static stat_t print_stat(handle_ptr h)
{
- using namespace boost::afio;
+ using namespace boost::llfio;
auto entry=h->lstat(metadata_flags::All);
std::cout << "Entry " << h->path(true) << " is a ";
switch(entry.st_type)
@@ -854,7 +854,7 @@ static stat_t print_stat(handle_ptr h)
static void print_stat(handle_ptr dirh, directory_entry direntry)
{
- using namespace boost::afio;
+ using namespace boost::llfio;
std::cout << "Entry " << direntry.name() << " is a ";
auto entry=direntry.fetch_lstat(dirh);
switch(entry.st_type)
diff --git a/attic/test/test_inline_linkage1.cpp b/attic/test/test_inline_linkage1.cpp
index e5cb8fad..533f731c 100644
--- a/attic/test/test_inline_linkage1.cpp
+++ b/attic/test/test_inline_linkage1.cpp
@@ -1,11 +1,11 @@
-#include "boost/afio/afio.hpp"
+#include "boost/llfio/llfio.hpp"
void test_inline_linkage1()
{
- using namespace boost::afio;
+ using namespace boost::llfio;
using namespace std;
vector<char> buffer(64, 'n');
- auto dispatcher = boost::afio::make_dispatcher("file:///", boost::afio::file_flags::always_sync).get();
+ auto dispatcher = boost::llfio::make_dispatcher("file:///", boost::llfio::file_flags::always_sync).get();
std::cout << "\n\nTesting synchronous directory and file creation:\n";
{
auto mkdir(dispatcher->dir(path_req("testdir", file_flags::create)));
diff --git a/attic/test/test_inline_linkage2.cpp b/attic/test/test_inline_linkage2.cpp
index c627fb1f..4358bbca 100644
--- a/attic/test/test_inline_linkage2.cpp
+++ b/attic/test/test_inline_linkage2.cpp
@@ -1,11 +1,11 @@
-#include "boost/afio/afio.hpp"
+#include "boost/llfio/llfio.hpp"
void test_inline_linkage2()
{
- using namespace boost::afio;
+ using namespace boost::llfio;
using namespace std;
vector<char> buffer(64, 'n');
- auto dispatcher = boost::afio::make_dispatcher("file:///", boost::afio::file_flags::always_sync).get();
+ auto dispatcher = boost::llfio::make_dispatcher("file:///", boost::llfio::file_flags::always_sync).get();
std::cout << "\n\nTesting synchronous directory and file creation:\n";
{
auto mkdir(dispatcher->dir(path_req("testdir", file_flags::create)));
diff --git a/attic/test/tests/async_io_adopt_test.cpp b/attic/test/tests/async_io_adopt_test.cpp
index a9bcdaf2..eb4e3b84 100644
--- a/attic/test/tests/async_io_adopt_test.cpp
+++ b/attic/test/tests/async_io_adopt_test.cpp
@@ -2,7 +2,7 @@
using namespace BOOST_AFIO_V2_NAMESPACE;
namespace asio = BOOST_AFIO_V2_NAMESPACE::asio;
-namespace afio = BOOST_AFIO_V2_NAMESPACE;
+namespace llfio = BOOST_AFIO_V2_NAMESPACE;
struct test_handle : handle
{
@@ -20,11 +20,11 @@ struct test_handle : handle
return nullptr;
}
using handle::path;
- virtual afio::path path(bool refresh=false) override final
+ virtual llfio::path path(bool refresh=false) override final
{
return "foo";
}
- virtual afio::path path() const override final
+ virtual llfio::path path() const override final
{
return "foo";
}
@@ -32,9 +32,9 @@ struct test_handle : handle
{
return directory_entry();
}
- virtual afio::path target() override final
+ virtual llfio::path target() override final
{
- return afio::path();
+ return llfio::path();
}
virtual void link(const path_req &req) override final
{
diff --git a/example/single-header.cpp b/example/single-header.cpp
index cde9f7a0..5160ed99 100644
--- a/example/single-header.cpp
+++ b/example/single-header.cpp
@@ -22,11 +22,11 @@ Distributed under the Boost Software License, Version 1.0.
http://www.boost.org/LICENSE_1_0.txt)
*/
-#if __has_include("../single-header/afio-win.hpp") && (_HAS_CXX17 || __cplusplus >= 201700)
+#if __has_include("../single-header/llfio-win.hpp") && (_HAS_CXX17 || __cplusplus >= 201700)
#ifdef _WIN32
-#include "../single-header/afio-win.hpp"
+#include "../single-header/llfio-win.hpp"
#else
-#include "../single-header/afio-posix.hpp"
+#include "../single-header/llfio-posix.hpp"
#endif
int main()
diff --git a/example/use_cases.cpp b/example/use_cases.cpp
index a72a5ec1..0c8825d9 100644
--- a/example/use_cases.cpp
+++ b/example/use_cases.cpp
@@ -22,7 +22,7 @@ Distributed under the Boost Software License, Version 1.0.
http://www.boost.org/LICENSE_1_0.txt)
*/
-#include "../include/afio.hpp"
+#include "../include/llfio.hpp"
#include <future>
#include <iostream>
@@ -36,10 +36,10 @@ Distributed under the Boost Software License, Version 1.0.
void read_entire_file1()
{
//! [file_entire_file1]
- namespace afio = LLFIO_V2_NAMESPACE;
+ namespace llfio = LLFIO_V2_NAMESPACE;
// Open the file for read
- afio::file_handle fh = afio::file( //
+ llfio::file_handle fh = llfio::file( //
{}, // path_handle to base directory
"foo" // path_view to path fragment relative to base directory
// default mode is read only
@@ -49,10 +49,10 @@ void read_entire_file1()
).value(); // If failed, throw a filesystem_error exception
// Make a vector sized the current maximum extent of the file
- std::vector<afio::byte> buffer(fh.maximum_extent().value());
+ std::vector<llfio::byte> buffer(fh.maximum_extent().value());
// Synchronous scatter read from file
- afio::file_handle::buffers_type filled = afio::read(
+ llfio::file_handle::buffers_type filled = llfio::read(
fh, // handle to read from
0, // offset
{{ buffer.data(), buffer.size() }} // Single scatter buffer of the vector
@@ -68,13 +68,13 @@ void read_entire_file1()
void read_entire_file2()
{
//! [file_entire_file2]
- namespace afio = LLFIO_V2_NAMESPACE;
+ namespace llfio = LLFIO_V2_NAMESPACE;
// Create an i/o service to complete the async file i/o
- afio::io_service service;
+ llfio::io_service service;
// Open the file for read
- afio::async_file_handle fh = afio::async_file( //
+ llfio::async_file_handle fh = llfio::async_file( //
service, // The i/o service to complete i/o to
{}, // path_handle to base directory
"foo" // path_view to path fragment relative to base directory
@@ -86,24 +86,24 @@ void read_entire_file2()
// Get the valid extents of the file.
const std::vector<
- std::pair<afio::file_handle::extent_type, afio::file_handle::extent_type>
+ std::pair<llfio::file_handle::extent_type, llfio::file_handle::extent_type>
> valid_extents = fh.extents().value();
// Schedule asynchronous reads for every valid extent
- std::vector<std::pair<std::vector<afio::byte>, afio::async_file_handle::io_state_ptr>> buffers(valid_extents.size());
+ std::vector<std::pair<std::vector<llfio::byte>, llfio::async_file_handle::io_state_ptr>> buffers(valid_extents.size());
for (size_t n = 0; n < valid_extents.size(); n++)
{
// Set up the scatter buffer
buffers[n].first.resize(valid_extents[n].second);
for(;;)
{
- afio::async_file_handle::buffer_type scatter_req{ buffers[n].first.data(), buffers[n].first.size() }; // buffer to fill
- auto ret = afio::async_read( //
+ llfio::async_file_handle::buffer_type scatter_req{ buffers[n].first.data(), buffers[n].first.size() }; // buffer to fill
+ auto ret = llfio::async_read( //
fh, // handle to read from
{ { scatter_req }, valid_extents[n].first }, // The scatter request buffers + offset
[]( // The completion handler
- afio::async_file_handle *, // The parent handle
- afio::async_file_handle::io_result<afio::async_file_handle::buffers_type> & // Result of the i/o
+ llfio::async_file_handle *, // The parent handle
+ llfio::async_file_handle::io_result<llfio::async_file_handle::buffers_type> & // Result of the i/o
) { /* do nothing */ }
// default deadline is infinite
);
@@ -114,7 +114,7 @@ void read_entire_file2()
buffers[n].second = std::move(ret).value();
break;
}
- if (ret.error() == afio::errc::resource_unavailable_try_again)
+ if (ret.error() == llfio::errc::resource_unavailable_try_again)
{
// Many async file i/o implementations have limited total system concurrency
std::this_thread::yield();
@@ -161,15 +161,15 @@ void scatter_write()
*/
return;
//! [scatter_write]
- namespace afio = LLFIO_V2_NAMESPACE;
+ namespace llfio = LLFIO_V2_NAMESPACE;
// Open the file for write, creating if needed, don't cache reads nor writes
- afio::file_handle fh = afio::file( //
+ llfio::file_handle fh = llfio::file( //
{}, // path_handle to base directory
"hello", // path_view to path fragment relative to base directory
- afio::file_handle::mode::write, // write access please
- afio::file_handle::creation::if_needed, // create new file if needed
- afio::file_handle::caching::only_metadata // cache neither reads nor writes of data on this handle
+ llfio::file_handle::mode::write, // write access please
+ llfio::file_handle::creation::if_needed, // create new file if needed
+ llfio::file_handle::caching::only_metadata // cache neither reads nor writes of data on this handle
// default flags is none
).value(); // If failed, throw a filesystem_error exception
@@ -184,10 +184,10 @@ void scatter_write()
fh.write(0, // offset
{ // gather list, buffers use std::byte
- { reinterpret_cast<const afio::byte *>(a), sizeof(a) - 1 },
- { reinterpret_cast<const afio::byte *>(b), sizeof(b) - 1 },
- { reinterpret_cast<const afio::byte *>(c), sizeof(c) - 1 },
- { reinterpret_cast<const afio::byte *>(d), sizeof(d) - 1 },
+ { reinterpret_cast<const llfio::byte *>(a), sizeof(a) - 1 },
+ { reinterpret_cast<const llfio::byte *>(b), sizeof(b) - 1 },
+ { reinterpret_cast<const llfio::byte *>(c), sizeof(c) - 1 },
+ { reinterpret_cast<const llfio::byte *>(d), sizeof(d) - 1 },
}
// default deadline is infinite
).value(); // If failed, throw a filesystem_error exception
@@ -200,18 +200,18 @@ void scatter_write()
void malloc1()
{
//! [malloc1]
- namespace afio = LLFIO_V2_NAMESPACE;
+ namespace llfio = LLFIO_V2_NAMESPACE;
// Call whatever the equivalent to mmap() is on this platform to fetch
// new private memory backed by the swap file. This will be the system
// all bits zero page mapped into each page of the allocation. Only on
// first write will a page fault allocate a real zeroed page for that
// page.
- afio::map_handle mh = afio::map(4096).value();
+ llfio::map_handle mh = llfio::map(4096).value();
// Fill the newly allocated memory with 'a' C style. For each first write
// to a page, it will be page faulted into a private page by the kernel.
- afio::byte *p = mh.address();
+ llfio::byte *p = mh.address();
size_t len = mh.length();
memset(p, 'a', len);
@@ -224,7 +224,7 @@ void malloc1()
mh.do_not_store({mh.address(), mh.length()}).value();
// Fill the memory with 'b' C++ style, probably faulting new pages into existence
- afio::algorithm::mapped_span<char> p2(mh);
+ llfio::algorithm::mapped_span<char> p2(mh);
std::fill(p2.begin(), p2.end(), 'b');
// Kick the contents of the memory out to the swap file so it is no longer cached in RAM
@@ -238,14 +238,14 @@ void malloc1()
// And rather than wait until first page fault read, tell the system we are going to
// use this region soon. Most systems will begin an asynchronous population of the
// kernel page cache immediately.
- afio::map_handle::buffer_type pf[] = { { mh.address(), mh.length() } };
+ llfio::map_handle::buffer_type pf[] = { { mh.address(), mh.length() } };
mh.prefetch(pf).value();
// You can actually save yourself some time and skip manually creating map handles.
// Just construct a mapped_span directly, this creates an internal map_handle instance,
// so memory is released when the span is destroyed
- afio::algorithm::mapped_span<float> f(1000); // 1000 floats, allocated used mmap()
+ llfio::algorithm::mapped_span<float> f(1000); // 1000 floats, allocated used mmap()
std::fill(f.begin(), f.end(), 1.23f);
//! [malloc1]
}
@@ -253,28 +253,28 @@ void malloc1()
void malloc2()
{
//! [malloc2]
- namespace afio = LLFIO_V2_NAMESPACE;
+ namespace llfio = LLFIO_V2_NAMESPACE;
// Create 4Kb of anonymous shared memory. This will persist
// until the last handle to it in the system is destructed.
// You can fetch a path to it to give to other processes using
// sh.current_path()
- afio::section_handle sh = afio::section(4096).value();
+ llfio::section_handle sh = llfio::section(4096).value();
{
// Map it into memory, and fill it with 'a'
- afio::algorithm::mapped_span<char> ms1(sh);
+ llfio::algorithm::mapped_span<char> ms1(sh);
std::fill(ms1.begin(), ms1.end(), 'a');
// Destructor unmaps it from memory
}
// Map it into memory again, verify it contains 'a'
- afio::algorithm::mapped_span<char> ms1(sh);
+ llfio::algorithm::mapped_span<char> ms1(sh);
assert(ms1[0] == 'a');
// Map a *second view* of the same memory
- afio::algorithm::mapped_span<char> ms2(sh);
+ llfio::algorithm::mapped_span<char> ms2(sh);
assert(ms2[0] == 'a');
// The addresses of the two maps are unique
@@ -289,10 +289,10 @@ void malloc2()
void map_file()
{
//! [map_file]
- namespace afio = LLFIO_V2_NAMESPACE;
+ namespace llfio = LLFIO_V2_NAMESPACE;
// Open the file for read
- afio::file_handle rfh = afio::file( //
+ llfio::file_handle rfh = llfio::file( //
{}, // path_handle to base directory
"foo" // path_view to path fragment relative to base directory
// default mode is read only
@@ -302,25 +302,25 @@ void map_file()
).value(); // If failed, throw a filesystem_error exception
// Open the same file for atomic append
- afio::file_handle afh = afio::file( //
+ llfio::file_handle afh = llfio::file( //
{}, // path_handle to base directory
"foo", // path_view to path fragment relative to base directory
- afio::file_handle::mode::append // open for atomic append
+ llfio::file_handle::mode::append // open for atomic append
// default creation is open existing
// default caching is all
// default flags is none
).value(); // If failed, throw a filesystem_error exception
// Create a section for the file of exactly the current length of the file
- afio::section_handle sh = afio::section(rfh).value();
+ llfio::section_handle sh = llfio::section(rfh).value();
// Map the end of the file into memory with a 1Mb address reservation
- afio::map_handle mh = afio::map(sh, 1024 * 1024, sh.length().value() & ~4095).value();
+ llfio::map_handle mh = llfio::map(sh, 1024 * 1024, sh.length().value() & ~4095).value();
// Append stuff to append only handle
- afio::write(afh,
+ llfio::write(afh,
0, // offset is ignored for atomic append only handles
- {{ reinterpret_cast<const afio::byte *>("hello"), 6 }} // single gather buffer
+ {{ reinterpret_cast<const llfio::byte *>("hello"), 6 }} // single gather buffer
// default deadline is infinite
).value();
@@ -342,10 +342,10 @@ void map_file()
void mapped_file()
{
//! [mapped_file]
- namespace afio = LLFIO_V2_NAMESPACE;
+ namespace llfio = LLFIO_V2_NAMESPACE;
// Open the mapped file for read
- afio::mapped_file_handle mh = afio::mapped_file( //
+ llfio::mapped_file_handle mh = llfio::mapped_file( //
{}, // path_handle to base directory
"foo" // path_view to path fragment relative to base directory
// default mode is read only
@@ -370,17 +370,17 @@ void mapped_file()
void sparse_array()
{
//! [sparse_array]
- namespace afio = LLFIO_V2_NAMESPACE;
+ namespace llfio = LLFIO_V2_NAMESPACE;
// Make me a 1 trillion element sparsely allocated integer array!
- afio::mapped_file_handle mfh = afio::mapped_temp_inode().value();
+ llfio::mapped_file_handle mfh = llfio::mapped_temp_inode().value();
// On an extents based filing system, doesn't actually allocate any physical
// storage but does map approximately 4Tb of all bits zero data into memory
(void) mfh.truncate(1000000000000ULL * sizeof(int));
// Create a typed view of the one trillion integers
- afio::algorithm::mapped_span<int> one_trillion_int_array(mfh);
+ llfio::algorithm::mapped_span<int> one_trillion_int_array(mfh);
// Write and read as you see fit, if you exceed physical RAM it'll be paged out
one_trillion_int_array[0] = 5;
@@ -392,14 +392,14 @@ void sparse_array()
std::future<void> coroutine_write()
{
//! [coroutine_write]
- namespace afio = LLFIO_V2_NAMESPACE;
+ namespace llfio = LLFIO_V2_NAMESPACE;
// Create an asynchronous file handle
- afio::io_service service;
- afio::async_file_handle fh =
- afio::async_file(service, {}, "testfile.txt",
- afio::async_file_handle::mode::write,
- afio::async_file_handle::creation::if_needed).value();
+ 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();
@@ -408,7 +408,7 @@ std::future<void> coroutine_write()
// 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<afio::byte *>(buffer), sizeof(buffer) } }).value();
+ co_await co_write(fh, 0, { { reinterpret_cast<llfio::byte *>(buffer), sizeof(buffer) } }).value();
//! [coroutine_write]
}
#endif
diff --git a/include/llfio.hpp b/include/llfio.hpp
index a74367f3..eb93f8ff 100644
--- a/include/llfio.hpp
+++ b/include/llfio.hpp
@@ -1 +1 @@
-#include "afio/afio.hpp"
+#include "llfio/llfio.hpp"
diff --git a/include/llfio/afio.hpp b/include/llfio/afio.hpp
index ec8538a3..af0bd0c5 100644
--- a/include/llfio/afio.hpp
+++ b/include/llfio/afio.hpp
@@ -1,4 +1,4 @@
-//! \file afio/afio.hpp The master *latest version* AFIO include file. All AFIO consuming libraries should include this header only.
+//! \file llfio/llfio.hpp The master *latest version* AFIO include file. All AFIO consuming libraries should include this header only.
#include "version.hpp"
#if defined(_MSC_VER) && !defined(__clang__)
@@ -8,7 +8,7 @@
#endif
#if 0 // cmake's Makefiles and Ninja generators won't pick up dependent headers without this
-#include "v2.0/afio.hpp"
+#include "v2.0/llfio.hpp"
#endif
#define LLFIO_HEADERS_PATH4(a) #a
diff --git a/include/llfio/v2.0/afio.hpp b/include/llfio/v2.0/afio.hpp
index bd45aeaa..c55a09ed 100644
--- a/include/llfio/v2.0/afio.hpp
+++ b/include/llfio/v2.0/afio.hpp
@@ -1,4 +1,4 @@
-//! \file v2.0/afio.hpp The master *versioned* AFIO include file. All version specific AFIO consuming libraries should include this header only.
+//! \file v2.0/llfio.hpp The master *versioned* AFIO include file. All version specific AFIO consuming libraries should include this header only.
#undef LLFIO_VERSION_MAJOR
#undef LLFIO_VERSION_MINOR
@@ -25,10 +25,10 @@
#if defined(__cpp_modules) || defined(DOXYGEN_SHOULD_SKIP_THIS)
#if defined(_MSC_VER) && !defined(__clang__)
//! \brief The AFIO C++ module name
-#define LLFIO_MODULE_NAME LLFIO_VERSION_GLUE(afio_v, LLFIO_NAMESPACE_VERSION, )
+#define LLFIO_MODULE_NAME LLFIO_VERSION_GLUE(llfio_v, LLFIO_NAMESPACE_VERSION, )
#else
//! \brief The AFIO C++ module name
-#define LLFIO_MODULE_NAME LLFIO_VERSION_GLUE(afio_v, LLFIO_NAMESPACE_VERSION, )
+#define LLFIO_MODULE_NAME LLFIO_VERSION_GLUE(llfio_v, LLFIO_NAMESPACE_VERSION, )
#endif
#endif
diff --git a/include/llfio/v2.0/config.hpp b/include/llfio/v2.0/config.hpp
index 7b338c58..32fc18cf 100644
--- a/include/llfio/v2.0/config.hpp
+++ b/include/llfio/v2.0/config.hpp
@@ -148,9 +148,9 @@ Distributed under the Boost Software License, Version 1.0.
#if defined(LLFIO_UNSTABLE_VERSION) && !defined(LLFIO_DISABLE_ABI_PERMUTATION)
#include "../revision.hpp"
-#define LLFIO_V2 (QUICKCPPLIB_BIND_NAMESPACE_VERSION(afio_v2, LLFIO_PREVIOUS_COMMIT_UNIQUE))
+#define LLFIO_V2 (QUICKCPPLIB_BIND_NAMESPACE_VERSION(llfio_v2, LLFIO_PREVIOUS_COMMIT_UNIQUE))
#else
-#define LLFIO_V2 (QUICKCPPLIB_BIND_NAMESPACE_VERSION(afio_v2))
+#define LLFIO_V2 (QUICKCPPLIB_BIND_NAMESPACE_VERSION(llfio_v2))
#endif
/*! \def LLFIO_V2
\ingroup config
@@ -159,7 +159,7 @@ of bracketed tokens later fused by the preprocessor into namespace and C++ modul
*/
#if DOXYGEN_IS_IN_THE_HOUSE
//! The AFIO namespace
-namespace afio_v2_xxx
+namespace llfio_v2_xxx
{
//! Collection of file system based algorithms
namespace algorithm
@@ -175,22 +175,22 @@ namespace afio_v2_xxx
}
}
/*! \brief The namespace of this AFIO v2 which will be some unknown inline
-namespace starting with `v2_` inside the `boost::afio` namespace.
+namespace starting with `v2_` inside the `boost::llfio` namespace.
\ingroup config
*/
-#define LLFIO_V2_NAMESPACE afio_v2_xxx
+#define LLFIO_V2_NAMESPACE llfio_v2_xxx
/*! \brief Expands into the appropriate namespace markup to enter the AFIO v2 namespace.
\ingroup config
*/
#define LLFIO_V2_NAMESPACE_BEGIN \
- namespace afio_v2_xxx \
+ namespace llfio_v2_xxx \
{
/*! \brief Expands into the appropriate namespace markup to enter the C++ module
exported AFIO v2 namespace.
\ingroup config
*/
#define LLFIO_V2_NAMESPACE_EXPORT_BEGIN \
- export namespace afio_v2_xxx \
+ export namespace llfio_v2_xxx \
{
/*! \brief Expands into the appropriate namespace markup to exit the AFIO v2 namespace.
\ingroup config
@@ -300,7 +300,7 @@ LLFIO_V2_NAMESPACE_END
// Used to tag functions which need to be made free by the AST tool
#ifndef LLFIO_MAKE_FREE_FUNCTION
#if 0 //__cplusplus >= 201700 // makes annoying warnings
-#define LLFIO_MAKE_FREE_FUNCTION [[afio::make_free_function]]
+#define LLFIO_MAKE_FREE_FUNCTION [[llfio::make_free_function]]
#else
#define LLFIO_MAKE_FREE_FUNCTION
#endif
@@ -453,7 +453,7 @@ LLFIO_V2_NAMESPACE_END
// Auto library naming
#if !defined(LLFIO_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(LLFIO_NO_LIB) && !LLFIO_STANDALONE && !LLFIO_HEADERS_ONLY
-#define BOOST_LIB_NAME boost_afio
+#define BOOST_LIB_NAME boost_llfio
// tell the auto-link code to select a dll when required:
#if defined(BOOST_ALL_DYN_LINK) || defined(LLFIO_DYN_LINK)
diff --git a/include/llfio/v2.0/deadline.h b/include/llfio/v2.0/deadline.h
index 26ec6080..be6e14d6 100644
--- a/include/llfio/v2.0/deadline.h
+++ b/include/llfio/v2.0/deadline.h
@@ -32,14 +32,14 @@ Distributed under the Boost Software License, Version 1.0.
#if defined(__cplusplus) || DOXYGEN_IS_IN_THE_HOUSE
#ifndef LLFIO_CONFIG_HPP
-#error You must include the master afio.hpp, not individual header files directly
+#error You must include the master llfio.hpp, not individual header files directly
#endif
#include "config.hpp"
#include <stdexcept>
LLFIO_V2_NAMESPACE_EXPORT_BEGIN
#define LLFIO_DEADLINE_NAME deadline
#else
-#define LLFIO_DEADLINE_NAME boost_afio_deadline
+#define LLFIO_DEADLINE_NAME boost_llfio_deadline
#endif
/*! \struct deadline
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 39fdcab5..2225b899 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
@@ -193,7 +193,7 @@ template <class BuffersType, class IORoutine> result<async_file_handle::io_state
// simply marks all items past AIO_LISTIO_MAX as failed
// with EAGAIN. That punishes performance for AFIO
// because we loop setting up and tearing down
- // the handlers, so if we would overload afio_suspend,
+ // the handlers, so if we would overload llfio_suspend,
// better to error out now rather that later in io_service.
if(service()->_aiocbsv.size() + items > AIO_LISTIO_MAX)
{
diff --git a/include/llfio/v2.0/detail/impl/posix/utils.ipp b/include/llfio/v2.0/detail/impl/posix/utils.ipp
index b6db41b3..61209b74 100644
--- a/include/llfio/v2.0/detail/impl/posix/utils.ipp
+++ b/include/llfio/v2.0/detail/impl/posix/utils.ipp
@@ -148,7 +148,7 @@ namespace utils
}
if(-1 == fd || ::read(fd, buffer, bytes) < static_cast<ssize_t>(bytes))
{
- LLFIO_LOG_FATAL(0, "afio: Kernel crypto function failed");
+ LLFIO_LOG_FATAL(0, "llfio: Kernel crypto function failed");
std::terminate();
}
}
@@ -210,7 +210,7 @@ namespace utils
#ifndef NDEBUG
else if(ret.page_size_used > 65536)
{
- printf("afio: Large page allocation successful\n");
+ printf("llfio: Large page allocation successful\n");
}
#endif
return ret;
@@ -219,7 +219,7 @@ namespace utils
{
if(munmap(p, bytes) < 0)
{
- LLFIO_LOG_FATAL(p, "afio: Freeing large pages failed");
+ LLFIO_LOG_FATAL(p, "llfio: Freeing large pages failed");
std::terminate();
}
}
diff --git a/include/llfio/v2.0/detail/impl/windows/directory_handle.ipp b/include/llfio/v2.0/detail/impl/windows/directory_handle.ipp
index 4ad0f419..abdd5a1e 100644
--- a/include/llfio/v2.0/detail/impl/windows/directory_handle.ipp
+++ b/include/llfio/v2.0/detail/impl/windows/directory_handle.ipp
@@ -333,7 +333,7 @@ result<directory_handle::enumerate_info> directory_handle::enumerate(buffers_typ
}
directory_entry &item = tofill[n];
item.leafname = path_view(wstring_view(ffdi->FileName, length));
- if(filtering == filter::fastdeleted && item.leafname.is_afio_deleted())
+ if(filtering == filter::fastdeleted && item.leafname.is_llfio_deleted())
{
continue;
}
diff --git a/include/llfio/v2.0/detail/impl/windows/utils.ipp b/include/llfio/v2.0/detail/impl/windows/utils.ipp
index 5185e5e8..f483b5ea 100644
--- a/include/llfio/v2.0/detail/impl/windows/utils.ipp
+++ b/include/llfio/v2.0/detail/impl/windows/utils.ipp
@@ -102,7 +102,7 @@ namespace utils
using namespace windows_nt_kernel;
if(RtlGenRandom(buffer, static_cast<ULONG>(bytes)) == 0u)
{
- LLFIO_LOG_FATAL(0, "afio: Kernel crypto function failed");
+ LLFIO_LOG_FATAL(0, "llfio: Kernel crypto function failed");
std::terminate();
}
}
@@ -218,7 +218,7 @@ namespace utils
#ifndef NDEBUG
else if(ret.page_size_used > 65536)
{
- printf("afio: Large page allocation successful\n");
+ printf("llfio: Large page allocation successful\n");
}
#endif
return ret;
@@ -228,7 +228,7 @@ namespace utils
(void) bytes;
if(VirtualFree(p, 0, MEM_RELEASE) == 0)
{
- LLFIO_LOG_FATAL(p, "afio: Freeing large pages failed");
+ LLFIO_LOG_FATAL(p, "llfio: Freeing large pages failed");
std::terminate();
}
}
diff --git a/include/llfio/v2.0/directory_handle.hpp b/include/llfio/v2.0/directory_handle.hpp
index 5a00b1aa..5d5aba9f 100644
--- a/include/llfio/v2.0/directory_handle.hpp
+++ b/include/llfio/v2.0/directory_handle.hpp
@@ -291,13 +291,13 @@ inline std::ostream &operator<<(std::ostream &s, const directory_handle::filter
static constexpr const char *values[] = {"none", "fastdeleted"};
if(static_cast<size_t>(v) >= sizeof(values) / sizeof(values[0]) || (values[static_cast<size_t>(v)] == nullptr))
{
- return s << "afio::directory_handle::filter::<unknown>";
+ return s << "llfio::directory_handle::filter::<unknown>";
}
- return s << "afio::directory_handle::filter::" << values[static_cast<size_t>(v)];
+ return s << "llfio::directory_handle::filter::" << values[static_cast<size_t>(v)];
}
inline std::ostream &operator<<(std::ostream &s, const directory_handle::enumerate_info & /*unused*/)
{
- return s << "afio::directory_handle::enumerate_info";
+ return s << "llfio::directory_handle::enumerate_info";
}
//! \brief Constructor for `directory_handle`
diff --git a/include/llfio/v2.0/handle.hpp b/include/llfio/v2.0/handle.hpp
index 81ee118b..eb6066b5 100644
--- a/include/llfio/v2.0/handle.hpp
+++ b/include/llfio/v2.0/handle.hpp
@@ -322,36 +322,36 @@ inline std::ostream &operator<<(std::ostream &s, const handle &v)
{
auto _currentpath = v.current_path();
std::string currentpath = !_currentpath ? std::string(_currentpath.error().message().c_str()) : _currentpath.value().u8string();
- return s << "afio::handle(" << v._v._init << ", " << currentpath << ")";
+ return s << "llfio::handle(" << v._v._init << ", " << currentpath << ")";
}
- return s << "afio::handle(closed)";
+ return s << "llfio::handle(closed)";
}
inline std::ostream &operator<<(std::ostream &s, const handle::mode &v)
{
static constexpr const char *values[] = {"unchanged", nullptr, "none", nullptr, "attr_read", "attr_write", "read", "write", nullptr, "append"};
if(static_cast<size_t>(v) >= sizeof(values) / sizeof(values[0]) || (values[static_cast<size_t>(v)] == nullptr)) // NOLINT
{
- return s << "afio::handle::mode::<unknown>";
+ return s << "llfio::handle::mode::<unknown>";
}
- return s << "afio::handle::mode::" << values[static_cast<size_t>(v)]; // NOLINT
+ return s << "llfio::handle::mode::" << values[static_cast<size_t>(v)]; // NOLINT
}
inline std::ostream &operator<<(std::ostream &s, const handle::creation &v)
{
static constexpr const char *values[] = {"open_existing", "only_if_not_exist", "if_needed", "truncate"};
if(static_cast<size_t>(v) >= sizeof(values) / sizeof(values[0]) || (values[static_cast<size_t>(v)] == nullptr)) // NOLINT
{
- return s << "afio::handle::creation::<unknown>";
+ return s << "llfio::handle::creation::<unknown>";
}
- return s << "afio::handle::creation::" << values[static_cast<size_t>(v)]; // NOLINT
+ return s << "llfio::handle::creation::" << values[static_cast<size_t>(v)]; // NOLINT
}
inline std::ostream &operator<<(std::ostream &s, const handle::caching &v)
{
static constexpr const char *values[] = {"unchanged", "none", "only_metadata", "reads", "all", "reads_and_metadata", "temporary", "safety_fsyncs"};
if(static_cast<size_t>(v) >= sizeof(values) / sizeof(values[0]) || (values[static_cast<size_t>(v)] == nullptr)) // NOLINT
{
- return s << "afio::handle::caching::<unknown>";
+ return s << "llfio::handle::caching::<unknown>";
}
- return s << "afio::handle::caching::" << values[static_cast<size_t>(v)]; // NOLINT
+ return s << "llfio::handle::caching::" << values[static_cast<size_t>(v)]; // NOLINT
}
inline std::ostream &operator<<(std::ostream &s, const handle::flag &v)
{
@@ -404,7 +404,7 @@ inline std::ostream &operator<<(std::ostream &s, const handle::flag &v)
{
temp = "none";
}
- return s << "afio::handle::flag::" << temp;
+ return s << "llfio::handle::flag::" << temp;
}
/*! \brief Metaprogramming shim for constructing any `handle` subclass.
diff --git a/include/llfio/v2.0/logging.hpp b/include/llfio/v2.0/logging.hpp
index 09b2f3bf..16fce9f3 100644
--- a/include/llfio/v2.0/logging.hpp
+++ b/include/llfio/v2.0/logging.hpp
@@ -201,7 +201,7 @@ LLFIO_V2_NAMESPACE_BEGIN
namespace detail
{
// Returns the AFIO namespace as a string
- inline span<char> afio_namespace_string()
+ inline span<char> llfio_namespace_string()
{
static char buffer[64];
static size_t length;
@@ -239,7 +239,7 @@ namespace detail
// Strips a __PRETTY_FUNCTION__ of all instances of ::LLFIO_V2_NAMESPACE:: and ::LLFIO_V2_NAMESPACE::
inline void strip_pretty_function(char *out, size_t bytes, const char *in)
{
- const span<char> remove1 = afio_namespace_string();
+ const span<char> remove1 = llfio_namespace_string();
const span<char> remove2 = outcome_namespace_string();
for(--bytes; bytes && *in; --bytes)
{
diff --git a/include/llfio/v2.0/map_handle.hpp b/include/llfio/v2.0/map_handle.hpp
index d9b494f6..1878d9d5 100644
--- a/include/llfio/v2.0/map_handle.hpp
+++ b/include/llfio/v2.0/map_handle.hpp
@@ -225,7 +225,7 @@ inline std::ostream &operator<<(std::ostream &s, const section_handle::flag &v)
{
temp = "none";
}
- return s << "afio::section_handle::flag::" << temp;
+ return s << "llfio::section_handle::flag::" << temp;
}
//! \brief Constructor for `section_handle`
diff --git a/include/llfio/v2.0/native_handle_type.hpp b/include/llfio/v2.0/native_handle_type.hpp
index 6f98cdab..0961db83 100644
--- a/include/llfio/v2.0/native_handle_type.hpp
+++ b/include/llfio/v2.0/native_handle_type.hpp
@@ -23,7 +23,7 @@ Distributed under the Boost Software License, Version 1.0.
*/
#ifndef LLFIO_CONFIG_HPP
-#error You must include the master afio.hpp, not individual header files directly
+#error You must include the master llfio.hpp, not individual header files directly
#endif
#include "config.hpp"
diff --git a/include/llfio/v2.0/path_discovery.hpp b/include/llfio/v2.0/path_discovery.hpp
index e73a37e2..d6249140 100644
--- a/include/llfio/v2.0/path_discovery.hpp
+++ b/include/llfio/v2.0/path_discovery.hpp
@@ -60,9 +60,9 @@ namespace path_discovery
static constexpr const char *values[] = {"local", "environment", "system", "hardcoded"};
if(static_cast<size_t>(v) >= sizeof(values) / sizeof(values[0]) || (values[static_cast<size_t>(v)] == nullptr))
{
- return s << "afio::path_discovery::discovered_path::source_type::<unknown>";
+ return s << "llfio::path_discovery::discovered_path::source_type::<unknown>";
}
- return s << "afio::path_discovery::discovered_path::source_type::" << values[static_cast<size_t>(v)];
+ return s << "llfio::path_discovery::discovered_path::source_type::" << values[static_cast<size_t>(v)];
}
/*! \brief Returns a list of potential directories which might be usuable for temporary files.
diff --git a/include/llfio/v2.0/path_view.hpp b/include/llfio/v2.0/path_view.hpp
index 788a1e80..46272dc2 100644
--- a/include/llfio/v2.0/path_view.hpp
+++ b/include/llfio/v2.0/path_view.hpp
@@ -301,7 +301,7 @@ public:
});
}
// True if the path view matches the format of an AFIO deleted file
- constexpr bool is_afio_deleted() const noexcept
+ constexpr bool is_llfio_deleted() const noexcept
{
return filename()._invoke([](const auto &v) {
if(v.size() == 64 + 8)
diff --git a/include/llfio/v2.0/stat.hpp b/include/llfio/v2.0/stat.hpp
index 6c3bb795..4ffee773 100644
--- a/include/llfio/v2.0/stat.hpp
+++ b/include/llfio/v2.0/stat.hpp
@@ -26,7 +26,7 @@ Distributed under the Boost Software License, Version 1.0.
#define LLFIO_STAT_H
#ifndef LLFIO_CONFIG_HPP
-#error You must include the master afio.hpp, not individual header files directly
+#error You must include the master llfio.hpp, not individual header files directly
#endif
#include "config.hpp"
diff --git a/include/llfio/v2.0/statfs.hpp b/include/llfio/v2.0/statfs.hpp
index 1a221f7b..71732da5 100644
--- a/include/llfio/v2.0/statfs.hpp
+++ b/include/llfio/v2.0/statfs.hpp
@@ -26,7 +26,7 @@ Distributed under the Boost Software License, Version 1.0.
#define LLFIO_STATFS_H
#ifndef LLFIO_CONFIG_HPP
-#error You must include the master afio.hpp, not individual header files directly
+#error You must include the master llfio.hpp, not individual header files directly
#endif
#include "config.hpp"
diff --git a/include/llfio/v2.0/status_code.hpp b/include/llfio/v2.0/status_code.hpp
index c6e7984c..1d07070a 100644
--- a/include/llfio/v2.0/status_code.hpp
+++ b/include/llfio/v2.0/status_code.hpp
@@ -259,7 +259,7 @@ inline error_code ntkernel_error(SYSTEM_ERROR2_NAMESPACE::win32::NTSTATUS c);
namespace detail
{
- inline std::ostream &operator<<(std::ostream &s, const error_code &v) { return s << "afio::error_code(" << v.message().c_str() << ")"; }
+ inline std::ostream &operator<<(std::ostream &s, const error_code &v) { return s << "llfio::error_code(" << v.message().c_str() << ")"; }
}
inline error_code error_from_exception(std::exception_ptr &&ep = std::current_exception(), error_code not_matched = generic_error(errc::resource_unavailable_try_again)) noexcept
{
@@ -479,9 +479,9 @@ inline std::ostream &operator<<(std::ostream &s, const error_info &v)
{
if(make_error_code(v))
{
- return s << "afio::error_info(" << v.message() << ")";
+ return s << "llfio::error_info(" << v.message() << ")";
}
- return s << "afio::error_info(null)";
+ return s << "llfio::error_info(null)";
}
// Tell Outcome that error_info is to be treated as an error_code
inline std::error_code make_error_code(error_info ei)
@@ -495,7 +495,7 @@ inline void outcome_throw_as_system_error_with_payload(const error_info &ei)
}
/*! \class error
-\brief The exception type synthesised and thrown when an `afio::result` or `afio::outcome` is no-value observed.
+\brief The exception type synthesised and thrown when an `llfio::result` or `llfio::outcome` is no-value observed.
*/
class error : public filesystem::filesystem_error
{
diff --git a/include/llfio/v2.0/utils.hpp b/include/llfio/v2.0/utils.hpp
index 6826e776..8d731016 100644
--- a/include/llfio/v2.0/utils.hpp
+++ b/include/llfio/v2.0/utils.hpp
@@ -26,7 +26,7 @@ Distributed under the Boost Software License, Version 1.0.
#define LLFIO_UTILS_H
#ifndef LLFIO_CONFIG_HPP
-#error You must include the master afio.hpp, not individual header files directly
+#error You must include the master llfio.hpp, not individual header files directly
#endif
#include "config.hpp"
@@ -197,7 +197,7 @@ namespace utils
unmodified.
A particularly useful combination with this allocator is with the
- page_sizes() member function of __afio_dispatcher__. This will return which
+ page_sizes() member function of __llfio_dispatcher__. This will return which
pages sizes are possible, and which page sizes are enabled for this user. If
writing a file copy routine for example, using this allocator with the
largest page size as the copy chunk makes a great deal of sense.
diff --git a/programs/CMakeLists.txt b/programs/CMakeLists.txt
index b4020613..556c399c 100644
--- a/programs/CMakeLists.txt
+++ b/programs/CMakeLists.txt
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
-if(NOT TARGET afio::hl)
- add_subdirectory(.. afio EXCLUDE_FROM_ALL)
+if(NOT TARGET llfio::hl)
+ add_subdirectory(.. llfio EXCLUDE_FROM_ALL)
endif()
-project(afio-programs VERSION 1.0 LANGUAGES CXX)
+project(llfio-programs VERSION 1.0 LANGUAGES CXX)
# Looks like cmake's toolset for LLVM-vs* has some serious problems
if(CMAKE_GENERATOR_TOOLSET MATCHES "LLVM-vs.*")
@@ -37,7 +37,7 @@ function(make_program program)
)
endfunction()
-make_program(benchmark-iostreams afio::hl)
-make_program(benchmark-locking afio::hl)
-make_program(fs-probe afio::hl)
-make_program(key-value-store afio::hl)
+make_program(benchmark-iostreams llfio::hl)
+make_program(benchmark-locking llfio::hl)
+make_program(fs-probe llfio::hl)
+make_program(key-value-store llfio::hl)
diff --git a/programs/benchmark-iostreams/main.cpp b/programs/benchmark-iostreams/main.cpp
index 3e005cdf..b6c5035a 100644
--- a/programs/benchmark-iostreams/main.cpp
+++ b/programs/benchmark-iostreams/main.cpp
@@ -26,11 +26,11 @@ Distributed under the Boost Software License, Version 1.0.
#define MAXBLOCKSIZE (4096)
#define REGIONSIZE (100 * 1024 * 1024)
-#include "../../include/afio/afio.hpp"
+#include "../../include/llfio/llfio.hpp"
#if __has_include("quickcpplib/include/algorithm/small_prng.hpp")
#include "quickcpplib/include/algorithm/small_prng.hpp"
#else
-#include "../../include/afio/v2.0/quickcpplib/include/algorithm/small_prng.hpp"
+#include "../../include/llfio/v2.0/quickcpplib/include/algorithm/small_prng.hpp"
#endif
#include <chrono>
@@ -38,7 +38,7 @@ Distributed under the Boost Software License, Version 1.0.
#include <iostream>
#include <vector>
-namespace afio = LLFIO_V2_NAMESPACE;
+namespace llfio = LLFIO_V2_NAMESPACE;
using QUICKCPPLIB_NAMESPACE::algorithm::small_prng::small_prng;
inline uint64_t ticksclock()
@@ -148,9 +148,9 @@ template <class F> inline void run_test(const char *csv, off_t max_extent, F &&f
int main()
{
{
- auto th = afio::file({}, "testfile", afio::file_handle::mode::write, afio::file_handle::creation::if_needed).value();
+ auto th = llfio::file({}, "testfile", llfio::file_handle::mode::write, llfio::file_handle::creation::if_needed).value();
std::vector<char> buffer(REGIONSIZE, 'a');
- th.write(0, {{(afio::byte *) buffer.data(), buffer.size()}}).value();
+ th.write(0, {{(llfio::byte *) buffer.data(), buffer.size()}}).value();
th.barrier({}, true, true).value();
}
{
@@ -160,8 +160,8 @@ int main()
}
#if 0
{
- std::cout << "Testing latency of afio::file_handle with random malloc/free ..." << std::endl;
- auto th = afio::file({}, "testfile").value();
+ std::cout << "Testing latency of llfio::file_handle with random malloc/free ..." << std::endl;
+ auto th = llfio::file({}, "testfile").value();
std::vector<void *> allocations(1024 * 1024);
small_prng rand;
for(auto &i : allocations)
@@ -169,7 +169,7 @@ int main()
i = malloc(rand() % 4096);
}
run_test("file_handle_malloc_free.csv", 1024 * 1024, [&](unsigned offset, char *buffer, size_t len) {
- th.read(offset, {{(afio::byte *) buffer, len}}).value();
+ th.read(offset, {{(llfio::byte *) buffer, len}}).value();
for(size_t n = 0; n < rand() % 64; n++)
{
size_t i = rand() % (1024 * 1024);
@@ -196,21 +196,21 @@ int main()
}
#endif
{
- std::cout << "Testing latency of afio::file_handle ..." << std::endl;
- auto th = afio::file({}, "testfile").value();
- run_test("file_handle.csv", REGIONSIZE, [&](unsigned offset, char *buffer, size_t len) { th.read(offset, {{(afio::byte *) buffer, len}}).value(); });
+ std::cout << "Testing latency of llfio::file_handle ..." << std::endl;
+ auto th = llfio::file({}, "testfile").value();
+ run_test("file_handle.csv", REGIONSIZE, [&](unsigned offset, char *buffer, size_t len) { th.read(offset, {{(llfio::byte *) buffer, len}}).value(); });
}
#if 1
{
- std::cout << "Testing latency of afio::mapped_file_handle ..." << std::endl;
- auto th = afio::mapped_file({}, "testfile").value();
- run_test("mapped_file_handle.csv", REGIONSIZE, [&](unsigned offset, char *buffer, size_t len) { th.read(offset, {{(afio::byte *) buffer, len}}).value(); });
+ std::cout << "Testing latency of llfio::mapped_file_handle ..." << std::endl;
+ auto th = llfio::mapped_file({}, "testfile").value();
+ run_test("mapped_file_handle.csv", REGIONSIZE, [&](unsigned offset, char *buffer, size_t len) { th.read(offset, {{(llfio::byte *) buffer, len}}).value(); });
}
#endif
#if 1
{
std::cout << "Testing latency of memcpy ..." << std::endl;
- auto th = afio::map(REGIONSIZE).value();
+ auto th = llfio::map(REGIONSIZE).value();
#if 1
{
// Prefault
@@ -226,7 +226,7 @@ int main()
memcpy(buffer, th.address() + offset, len);
#else
// Can't use memcpy, it gets elided
- const afio::byte *__restrict s = th.address() + offset;
+ const llfio::byte *__restrict s = th.address() + offset;
#if defined(__SSE2__) || defined(_M_X64) || (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
while(len >= 4 * sizeof(__m128i))
{
@@ -288,5 +288,5 @@ int main()
});
}
#endif
- afio::filesystem::remove("testfile");
+ llfio::filesystem::remove("testfile");
}
diff --git a/programs/benchmark-locking/main.cpp b/programs/benchmark-locking/main.cpp
index 10a71920..c1910b68 100644
--- a/programs/benchmark-locking/main.cpp
+++ b/programs/benchmark-locking/main.cpp
@@ -30,7 +30,7 @@ Distributed under the Boost Software License, Version 1.0.
#define _CRT_SECURE_NO_WARNINGS 1
-#include "../../include/afio/afio.hpp"
+#include "../../include/llfio/llfio.hpp"
#include "kerneltest/include/kerneltest/v1.0/child_process.hpp"
#include <fstream>
@@ -63,15 +63,15 @@ bool kbhit()
}
#endif
-namespace afio = LLFIO_V2_NAMESPACE;
+namespace llfio = LLFIO_V2_NAMESPACE;
namespace child_process = KERNELTEST_V1_NAMESPACE::child_process;
static volatile size_t *shared_memory;
static void initialise_shared_memory()
{
- auto fh = afio::file_handle::file({}, "shared_memory", afio::file_handle::mode::write, afio::file_handle::creation::if_needed, afio::file_handle::caching::temporary).value();
- auto sh = afio::section_handle::section(fh, 8, afio::section_handle::flag::write).value();
- auto mp = afio::map_handle::map(sh).value();
+ auto fh = llfio::file_handle::file({}, "shared_memory", llfio::file_handle::mode::write, llfio::file_handle::creation::if_needed, llfio::file_handle::caching::temporary).value();
+ auto sh = llfio::section_handle::section(fh, 8, llfio::section_handle::flag::write).value();
+ auto mp = llfio::map_handle::map(sh).value();
shared_memory = (size_t *) mp.address();
if(!shared_memory)
abort();
@@ -121,7 +121,7 @@ int main(int argc, char *argv[])
std::vector<child_process::child_process> children;
auto mypath = child_process::current_process_path();
#ifdef UNICODE
- std::vector<afio::filesystem::path::string_type> args = {L"spawned", L"", L"", L"", L"00"};
+ std::vector<llfio::filesystem::path::string_type> args = {L"spawned", L"", L"", L"", L"00"};
args[1].resize(strlen(argv[1]));
for(size_t n = 0; n < args[1].size(); n++)
args[1][n] = argv[1][n];
@@ -132,7 +132,7 @@ int main(int argc, char *argv[])
for(size_t n = 0; n < args[3].size(); n++)
args[3][n] = argv[3][n];
#else
- std::vector<afio::filesystem::path::string_type> args = {"spawned", argv[1], argv[2], argv[3], "00"};
+ std::vector<llfio::filesystem::path::string_type> args = {"spawned", argv[1], argv[2], argv[3], "00"};
#endif
auto env = child_process::current_process_env();
std::cout << "Launching " << waiters << " copies of myself as a child process ..." << std::endl;
@@ -282,59 +282,59 @@ int main(int argc, char *argv[])
// Wait for parent to let me proceed
std::atomic<int> done(-1);
std::thread worker([test, contended, total_locks, this_child, &done, &count] {
- std::unique_ptr<afio::algorithm::shared_fs_mutex::shared_fs_mutex> algorithm;
- auto base = afio::path_handle::path(".").value();
+ std::unique_ptr<llfio::algorithm::shared_fs_mutex::shared_fs_mutex> algorithm;
+ auto base = llfio::path_handle::path(".").value();
switch(test)
{
case lock_algorithm::atomic_append:
{
- auto v = afio::algorithm::shared_fs_mutex::atomic_append::fs_mutex_append({}, "lockfile");
+ auto v = llfio::algorithm::shared_fs_mutex::atomic_append::fs_mutex_append({}, "lockfile");
if(v.has_error())
{
std::cerr << "ERROR: Creation of lock algorithm returns " << v.error().message() << std::endl;
return;
}
- algorithm = std::make_unique<afio::algorithm::shared_fs_mutex::atomic_append>(std::move(v.value()));
+ algorithm = std::make_unique<llfio::algorithm::shared_fs_mutex::atomic_append>(std::move(v.value()));
break;
}
case lock_algorithm::byte_ranges:
{
- auto v = afio::algorithm::shared_fs_mutex::byte_ranges::fs_mutex_byte_ranges({}, "lockfile");
+ auto v = llfio::algorithm::shared_fs_mutex::byte_ranges::fs_mutex_byte_ranges({}, "lockfile");
if(v.has_error())
{
std::cerr << "ERROR: Creation of lock algorithm returns " << v.error().message() << std::endl;
return;
}
- algorithm = std::make_unique<afio::algorithm::shared_fs_mutex::byte_ranges>(std::move(v.value()));
+ algorithm = std::make_unique<llfio::algorithm::shared_fs_mutex::byte_ranges>(std::move(v.value()));
break;
}
case lock_algorithm::lock_files:
{
- auto v = afio::algorithm::shared_fs_mutex::lock_files::fs_mutex_lock_files(base);
+ auto v = llfio::algorithm::shared_fs_mutex::lock_files::fs_mutex_lock_files(base);
if(v.has_error())
{
std::cerr << "ERROR: Creation of lock algorithm returns " << v.error().message() << std::endl;
return;
}
- algorithm = std::make_unique<afio::algorithm::shared_fs_mutex::lock_files>(std::move(v.value()));
+ algorithm = std::make_unique<llfio::algorithm::shared_fs_mutex::lock_files>(std::move(v.value()));
break;
}
case lock_algorithm::memory_map:
{
- auto v = afio::algorithm::shared_fs_mutex::memory_map<QUICKCPPLIB_NAMESPACE::algorithm::hash::passthru_hash>::fs_mutex_map({}, "lockfile");
+ auto v = llfio::algorithm::shared_fs_mutex::memory_map<QUICKCPPLIB_NAMESPACE::algorithm::hash::passthru_hash>::fs_mutex_map({}, "lockfile");
if(v.has_error())
{
std::cerr << "ERROR: Creation of lock algorithm returns " << v.error().message() << std::endl;
return;
}
- algorithm = std::make_unique<afio::algorithm::shared_fs_mutex::memory_map<QUICKCPPLIB_NAMESPACE::algorithm::hash::passthru_hash>>(std::move(v.value()));
+ algorithm = std::make_unique<llfio::algorithm::shared_fs_mutex::memory_map<QUICKCPPLIB_NAMESPACE::algorithm::hash::passthru_hash>>(std::move(v.value()));
break;
}
case lock_algorithm::unknown:
break;
}
// Create entities named 0 to total_locks
- std::vector<afio::algorithm::shared_fs_mutex::shared_fs_mutex::entity_type> entities(total_locks);
+ std::vector<llfio::algorithm::shared_fs_mutex::shared_fs_mutex::entity_type> entities(total_locks);
for(size_t n = 0; n < total_locks; n++)
{
if(contended)
@@ -352,7 +352,7 @@ int main(int argc, char *argv[])
std::this_thread::yield();
while(!done)
{
- auto result = algorithm->lock(entities, afio::deadline(), false);
+ auto result = algorithm->lock(entities, llfio::deadline(), false);
if(result.has_error())
{
std::cerr << "ERROR: Algorithm lock returns " << result.error().message() << std::endl;
@@ -379,10 +379,10 @@ int main(int argc, char *argv[])
std::cout << "\ncount=" << count << " (+" << (count - lastcount) << "), average=" << (count / secs) << std::endl;
lastcount = count;
#if 1
- auto it = afio::log().cbegin();
+ auto it = llfio::log().cbegin();
for(size_t n = 0; n < 10; n++)
{
- if(it == afio::log().cend())
+ if(it == llfio::log().cend())
break;
std::cout << " " << *it;
++it;
@@ -412,8 +412,8 @@ int main(int argc, char *argv[])
worker.join();
std::cout << "RESULTS(" << count << ")" << std::endl;
#if DEBUG_CSV
- std::ofstream s("benchmark_locking_afio_log" + std::to_string(this_child) + ".csv");
- s << csv(afio::log());
+ std::ofstream s("benchmark_locking_llfio_log" + std::to_string(this_child) + ".csv");
+ s << csv(llfio::log());
#endif
return 0;
}
diff --git a/programs/fs-probe/main.cpp b/programs/fs-probe/main.cpp
index 22c2b49b..2ef117ae 100644
--- a/programs/fs-probe/main.cpp
+++ b/programs/fs-probe/main.cpp
@@ -24,7 +24,7 @@ Distributed under the Boost Software License, Version 1.0.
#define _CRT_SECURE_NO_WARNINGS 1
-#include "../../include/afio/afio.hpp"
+#include "../../include/llfio/llfio.hpp"
#include <fstream>
#include <iomanip>
diff --git a/programs/key-value-store/include/key_value_store.hpp b/programs/key-value-store/include/key_value_store.hpp
index 5fa6fbda..84e0c3a2 100644
--- a/programs/key-value-store/include/key_value_store.hpp
+++ b/programs/key-value-store/include/key_value_store.hpp
@@ -25,21 +25,21 @@ Distributed under the Boost Software License, Version 1.0.
#ifndef KEY_VALUE_STORE_HPP
#define KEY_VALUE_STORE_HPP
-#include "../../../include/afio/afio.hpp"
+#include "../../../include/llfio/llfio.hpp"
#if __has_include("quickcpplib/include/algorithm/open_hash_index.hpp")
#include "quickcpplib/include/algorithm/open_hash_index.hpp"
#else
-#include "../../../include/afio/v2.0/quickcpplib/include/algorithm/open_hash_index.hpp"
+#include "../../../include/llfio/v2.0/quickcpplib/include/algorithm/open_hash_index.hpp"
#endif
#include <vector>
namespace key_value_store
{
- namespace afio = LLFIO_V2_NAMESPACE;
- template <class T> using optional = afio::optional<T>;
- template <class T> using span = afio::span<T>;
- using afio::undoer;
+ namespace llfio = LLFIO_V2_NAMESPACE;
+ template <class T> using optional = llfio::optional<T>;
+ template <class T> using span = llfio::span<T>;
+ using llfio::undoer;
using uint128 = QUICKCPPLIB_NAMESPACE::integers128::uint128;
using key_type = uint128;
@@ -159,21 +159,21 @@ namespace key_value_store
class basic_key_value_store
{
friend class transaction;
- afio::file_handle _indexfile;
- afio::file_handle _mysmallfile; // append only
- afio::file_handle::extent_guard _indexfileguard, _smallfileguard;
+ llfio::file_handle _indexfile;
+ llfio::file_handle _mysmallfile; // append only
+ llfio::file_handle::extent_guard _indexfileguard, _smallfileguard;
size_t _mysmallfileidx{(size_t) -1};
struct
{
- std::vector<afio::file_handle> blocking;
- std::vector<afio::mapped_file_handle> mapped;
+ std::vector<llfio::file_handle> blocking;
+ std::vector<llfio::mapped_file_handle> mapped;
} _smallfiles;
optional<index::open_hash_index> _index;
index::index *_indexheader{nullptr};
std::mutex _commitlock;
size_t _mmap_over_extension{0};
- static constexpr afio::file_handle::extent_type _indexinuseoffset = INT64_MAX;
+ static constexpr llfio::file_handle::extent_type _indexinuseoffset = INT64_MAX;
static constexpr uint64_t _goodmagic = 0x3130564b4f494641; // "AFIOKV01"
static constexpr uint64_t _badmagic = 0x3130564b44414544; // "DEADKV01"
@@ -182,11 +182,11 @@ namespace key_value_store
// We append a value_tail record and round up to 64 byte multiple
return (length + sizeof(index::value_tail) + 63) & ~63;
}
- void _openfiles(const afio::path_handle &dir, afio::file_handle::mode mode, afio::file_handle::caching caching)
+ void _openfiles(const llfio::path_handle &dir, llfio::file_handle::mode mode, llfio::file_handle::caching caching)
{
- const afio::file_handle::mode smallfilemode =
+ const llfio::file_handle::mode smallfilemode =
#ifdef _WIN32
- afio::file_handle::mode::read
+ llfio::file_handle::mode::read
#else
// Linux won't allow taking an exclusive lock on a read only file
mode
@@ -200,18 +200,18 @@ namespace key_value_store
for(size_t n = 0; n < 48; n++)
{
name = std::to_string(n);
- auto fh = afio::file_handle::file(dir, name, smallfilemode, afio::file_handle::creation::open_existing, afio::file_handle::caching::all, afio::file_handle::flag::disable_prefetching);
+ auto fh = llfio::file_handle::file(dir, name, smallfilemode, llfio::file_handle::creation::open_existing, llfio::file_handle::caching::all, llfio::file_handle::flag::disable_prefetching);
if(fh)
{
retry:
bool claimed = false;
- if(mode == afio::file_handle::mode::write && !_mysmallfile.is_valid())
+ if(mode == llfio::file_handle::mode::write && !_mysmallfile.is_valid())
{
// Try to claim this small file
auto smallfileclaimed = fh.value().try_lock(_indexinuseoffset, 1, true);
if(smallfileclaimed)
{
- _mysmallfile = afio::file_handle::file(dir, name, afio::file_handle::mode::write, afio::file_handle::creation::open_existing, caching).value();
+ _mysmallfile = llfio::file_handle::file(dir, name, llfio::file_handle::mode::write, llfio::file_handle::creation::open_existing, caching).value();
_mysmallfile.set_append_only(true).value();
_smallfileguard = std::move(smallfileclaimed).value();
_mysmallfileidx = n;
@@ -224,16 +224,16 @@ namespace key_value_store
{
#ifndef _WIN32
// We really need this to only have read only perms, otherwise any mmaps will extend the file ludicrously
- fh = afio::file_handle::file(dir, name, afio::file_handle::mode::read, afio::file_handle::creation::open_existing, afio::file_handle::caching::all, afio::file_handle::flag::disable_prefetching);
+ fh = llfio::file_handle::file(dir, name, llfio::file_handle::mode::read, llfio::file_handle::creation::open_existing, llfio::file_handle::caching::all, llfio::file_handle::flag::disable_prefetching);
#endif
_smallfiles.blocking.push_back(std::move(fh).value());
}
continue;
}
- else if(mode == afio::file_handle::mode::write && !_mysmallfile.is_valid())
+ else if(mode == llfio::file_handle::mode::write && !_mysmallfile.is_valid())
{
// Going to need a new smallfile
- fh = afio::file_handle::file(dir, name, afio::file_handle::mode::write, afio::file_handle::creation::only_if_not_exist, caching);
+ fh = llfio::file_handle::file(dir, name, llfio::file_handle::mode::write, llfio::file_handle::creation::only_if_not_exist, caching);
if(fh)
{
fh.value().truncate(64).value();
@@ -243,14 +243,14 @@ namespace key_value_store
}
break;
}
- if(mode == afio::file_handle::mode::write && !_mysmallfile.is_valid())
+ if(mode == llfio::file_handle::mode::write && !_mysmallfile.is_valid())
{
throw maximum_writers_reached();
}
// Set up the index, either r/w or read only with copy on write
- afio::section_handle::flag mapflags = (mode == afio::file_handle::mode::write) ? afio::section_handle::flag::readwrite : (afio::section_handle::flag::read | afio::section_handle::flag::cow);
- afio::section_handle sh = afio::section_handle::section(_indexfile, 0, mapflags).value();
- afio::file_handle::extent_type len = sh.length().value();
+ llfio::section_handle::flag mapflags = (mode == llfio::file_handle::mode::write) ? llfio::section_handle::flag::readwrite : (llfio::section_handle::flag::read | llfio::section_handle::flag::cow);
+ llfio::section_handle sh = llfio::section_handle::section(_indexfile, 0, mapflags).value();
+ llfio::file_handle::extent_type len = sh.length().value();
len -= sizeof(index::index);
len /= sizeof(index::open_hash_index::value_type);
size_t offset = sizeof(index::index);
@@ -270,10 +270,10 @@ namespace key_value_store
basic_key_value_store &operator=(const basic_key_value_store &) = delete;
basic_key_value_store &operator=(basic_key_value_store &&) = delete;
- basic_key_value_store(const afio::path_handle &dir, size_t hashtableentries, bool enable_integrity = false, afio::file_handle::mode mode = afio::file_handle::mode::write, afio::file_handle::caching caching = afio::file_handle::caching::all)
- : _indexfile(afio::file_handle::file(dir, "index", mode, (mode == afio::file_handle::mode::write) ? afio::file_handle::creation::if_needed : afio::file_handle::creation::open_existing, caching, afio::file_handle::flag::disable_prefetching).value())
+ basic_key_value_store(const llfio::path_handle &dir, size_t hashtableentries, bool enable_integrity = false, llfio::file_handle::mode mode = llfio::file_handle::mode::write, llfio::file_handle::caching caching = llfio::file_handle::caching::all)
+ : _indexfile(llfio::file_handle::file(dir, "index", mode, (mode == llfio::file_handle::mode::write) ? llfio::file_handle::creation::if_needed : llfio::file_handle::creation::open_existing, caching, llfio::file_handle::flag::disable_prefetching).value())
{
- if(mode == afio::file_handle::mode::write)
+ if(mode == llfio::file_handle::mode::write)
{
// Try an exclusive lock on inuse byte of the index file
auto indexinuse = _indexfile.try_lock(_indexinuseoffset, 1, true);
@@ -282,15 +282,15 @@ namespace key_value_store
// I am the first entrant into this data store
if(_indexfile.maximum_extent().value() == 0)
{
- afio::file_handle::extent_type size = sizeof(index::index) + (hashtableentries) * sizeof(index::open_hash_index::value_type);
- size = afio::utils::round_up_to_page_size(size);
+ llfio::file_handle::extent_type size = sizeof(index::index) + (hashtableentries) * sizeof(index::open_hash_index::value_type);
+ size = llfio::utils::round_up_to_page_size(size);
_indexfile.truncate(size).value();
index::index i;
memset(&i, 0, sizeof(i));
i.magic = _goodmagic;
i.all_writes_synced = _indexfile.are_writes_durable();
i.contents_hashed = enable_integrity;
- _indexfile.write(0, {{(afio::byte *) &i, sizeof(i)}}).value();
+ _indexfile.write(0, {{(llfio::byte *) &i, sizeof(i)}}).value();
}
else
{
@@ -306,18 +306,18 @@ namespace key_value_store
}
// Now we've finished the checks, reset writes_occurring and all_writes_synced
index::index i;
- _indexfile.read(0, {{(afio::byte *) &i, sizeof(i)}}).value();
+ _indexfile.read(0, {{(llfio::byte *) &i, sizeof(i)}}).value();
memset(i.writes_occurring, 0, sizeof(i.writes_occurring));
i.all_writes_synced = _indexfile.are_writes_durable();
memset(&i.hash, 0, sizeof(i.hash));
- _indexfile.write(0, {{(afio::byte *) &i, sizeof(i)}}).value();
+ _indexfile.write(0, {{(llfio::byte *) &i, sizeof(i)}}).value();
}
}
}
// Take a shared lock, blocking if someone is still setting things up
_indexfileguard = _indexfile.lock(_indexinuseoffset, 1, false).value();
{
- afio::byte buffer[8];
+ llfio::byte buffer[8];
_indexfile.read(0, {{buffer, 8}}).value();
auto goodmagic = _goodmagic;
auto badmagic = _badmagic;
@@ -334,13 +334,13 @@ namespace key_value_store
}
}
//! \overload
- basic_key_value_store(const afio::path_view &dir, size_t hashtableentries, bool enable_integrity = false, afio::file_handle::mode mode = afio::file_handle::mode::write, afio::file_handle::caching caching = afio::file_handle::caching::all)
- : basic_key_value_store(afio::directory_handle::directory({}, dir, afio::directory_handle::mode::write, afio::directory_handle::creation::if_needed).value(), hashtableentries, enable_integrity, mode, caching)
+ basic_key_value_store(const llfio::path_view &dir, size_t hashtableentries, bool enable_integrity = false, llfio::file_handle::mode mode = llfio::file_handle::mode::write, llfio::file_handle::caching caching = llfio::file_handle::caching::all)
+ : basic_key_value_store(llfio::directory_handle::directory({}, dir, llfio::directory_handle::mode::write, llfio::directory_handle::creation::if_needed).value(), hashtableentries, enable_integrity, mode, caching)
{
}
//! Opens the store for read only access
- basic_key_value_store(const afio::path_view &dir)
- : basic_key_value_store(afio::path_handle::path(dir).value(), 0, false, afio::file_handle::mode::read)
+ basic_key_value_store(const llfio::path_view &dir)
+ : basic_key_value_store(llfio::path_handle::path(dir).value(), 0, false, llfio::file_handle::mode::read)
{
}
~basic_key_value_store()
@@ -376,7 +376,7 @@ namespace key_value_store
for(size_t n = 0; n < _smallfiles.blocking.size(); n++)
{
auto currentlength = _smallfiles.blocking[n].maximum_extent().value();
- _smallfiles.mapped.push_back(afio::mapped_file_handle(std::move(_smallfiles.blocking[n]), currentlength + overextension));
+ _smallfiles.mapped.push_back(llfio::mapped_file_handle(std::move(_smallfiles.blocking[n]), currentlength + overextension));
}
_smallfileguard.set_handle(&_smallfiles.mapped[_mysmallfileidx]);
_smallfiles.blocking.clear();
@@ -478,7 +478,7 @@ namespace key_value_store
// TODO: Open newly created smallfiles
abort();
}
- afio::byte *buffer;
+ llfio::byte *buffer;
bool free_on_destruct = _smallfiles.mapped.empty();
if(!free_on_destruct)
{
@@ -497,7 +497,7 @@ namespace key_value_store
}
else
{
- buffer = (afio::byte *) malloc(smallfilelength);
+ buffer = (llfio::byte *) malloc(smallfilelength);
if(!buffer)
{
throw std::bad_alloc();
@@ -546,7 +546,7 @@ namespace key_value_store
struct _item
{
basic_key_value_store::keyvalue_info kvi; // the item's value when fetched
- afio::optional<span<const char>> towrite; // the value to be written on commit
+ llfio::optional<span<const char>> towrite; // the value to be written on commit
bool remove; // true if to remove
_item(basic_key_value_store::keyvalue_info &&_kvi)
: kvi(std::move(_kvi))
@@ -739,7 +739,7 @@ namespace key_value_store
bool items_written = false;
if(!_parent->_smallfiles.mapped.empty())
{
- afio::file_handle::extent_type original_length = _parent->_mysmallfile.maximum_extent().value();
+ llfio::file_handle::extent_type original_length = _parent->_mysmallfile.maximum_extent().value();
// How big does this map need to be?
size_t totalcommitsize = 0;
for(size_t n = 0; n < _items.size(); n++)
@@ -751,14 +751,14 @@ namespace key_value_store
if(totalcommitsize >= 4096)
{
auto &mfh = _parent->_smallfiles.mapped[_parent->_mysmallfileidx];
- afio::file_handle::extent_type new_length = original_length + totalcommitsize;
+ llfio::file_handle::extent_type new_length = original_length + totalcommitsize;
if(new_length > mfh.capacity())
{
mfh.reserve(new_length + _parent->_mmap_over_extension).value();
}
mfh.truncate(new_length).value();
- afio::byte *value = mfh.address() + original_length;
- afio::file_handle::extent_type value_offset = original_length;
+ llfio::byte *value = mfh.address() + original_length;
+ llfio::file_handle::extent_type value_offset = original_length;
for(size_t n = 0; n < _items.size(); n++)
{
toupdate_type &thisupdate = toupdate[n];
@@ -803,17 +803,17 @@ namespace key_value_store
if(!items_written)
{
// Gather append write all my items to my smallfile
- afio::file_handle::extent_type value_offset = _parent->_mysmallfile.maximum_extent().value();
+ llfio::file_handle::extent_type value_offset = _parent->_mysmallfile.maximum_extent().value();
assert((value_offset % 64) == 0);
// POSIX guarantees that at least 16 gather buffers can be written in a single shot
- std::vector<afio::file_handle::const_buffer_type> reqs;
+ std::vector<llfio::file_handle::const_buffer_type> reqs;
reqs.reserve(16);
// With tails, that's eight items per syscall
- afio::byte tailbuffers[8][128];
+ llfio::byte tailbuffers[8][128];
memset(tailbuffers, 0, sizeof(tailbuffers));
for(size_t n = 0; n < _items.size(); n++)
{
- afio::byte *tailbuffer = tailbuffers[n % 8];
+ llfio::byte *tailbuffer = tailbuffers[n % 8];
index::value_tail *vt = reinterpret_cast<index::value_tail *>(tailbuffer + 128 - sizeof(index::value_tail));
toupdate_type &thisupdate = toupdate[n];
const transaction::_item &item = _items[n];
@@ -840,7 +840,7 @@ namespace key_value_store
totalwrite = _parent->_pad_length(item.towrite->size());
size_t tailbytes = totalwrite - item.towrite->size();
assert(tailbytes < 128);
- reqs.push_back({(afio::byte *) item.towrite->data(), item.towrite->size()});
+ reqs.push_back({(llfio::byte *) item.towrite->data(), item.towrite->size()});
reqs.push_back({tailbuffer + 128 - tailbytes, tailbytes});
if(_parent->_indexheader->contents_hashed)
{
diff --git a/src/afio.cpp b/src/llfio.cpp
index ca4b902e..4174d6d9 100644
--- a/src/afio.cpp
+++ b/src/llfio.cpp
@@ -1,3 +1,3 @@
#define LLFIO_DYN_LINK 1
#define LLFIO_SOURCE 1
-#include "../include/afio/afio.hpp"
+#include "../include/llfio/llfio.hpp"
diff --git a/test/test_kernel_decl.hpp b/test/test_kernel_decl.hpp
index 2e9d1df2..3b055057 100644
--- a/test/test_kernel_decl.hpp
+++ b/test/test_kernel_decl.hpp
@@ -30,7 +30,7 @@ Distributed under the Boost Software License, Version 1.0.
#define LLFIO_TEST_KERNEL_DECL inline
#else
// We are standalone
-#include "../include/afio/afio.hpp"
+#include "../include/llfio/llfio.hpp"
#define LLFIO_TEST_KERNEL_DECL extern inline QUICKCPPLIB_SYMBOL_EXPORT
#endif
@@ -44,7 +44,7 @@ Distributed under the Boost Software License, Version 1.0.
OUTCOME_V2_NAMESPACE_BEGIN
namespace convert
{
- // Provide custom ValueOrError conversion from afio::result<U> into kerneltest::result<T>
+ // Provide custom ValueOrError conversion from llfio::result<U> into kerneltest::result<T>
template <class T, class U> struct value_or_error<KERNELTEST_V1_NAMESPACE::result<T>, LLFIO_V2_NAMESPACE::result<U>>
{
static constexpr bool enable_result_inputs = true;
@@ -63,7 +63,7 @@ namespace convert
KERNELTEST_V1_NAMESPACE::result<T>{make_error_code(std::forward<X>(src).error())};
}
};
- // Provide custom ValueOrError conversion from afio::result<U> into kerneltest::outcome<T>
+ // Provide custom ValueOrError conversion from llfio::result<U> into kerneltest::outcome<T>
template <class T, class U> struct value_or_error<KERNELTEST_V1_NAMESPACE::outcome<T>, LLFIO_V2_NAMESPACE::result<U>>
{
static constexpr bool enable_result_inputs = true;
@@ -84,8 +84,8 @@ namespace convert
};
}
OUTCOME_V2_NAMESPACE_END
-static_assert(std::is_constructible<KERNELTEST_V1_NAMESPACE::result<int>, LLFIO_V2_NAMESPACE::result<int>>::value, "kerneltest::result<int> is not constructible from afio::result<int>!");
-static_assert(std::is_constructible<KERNELTEST_V1_NAMESPACE::outcome<int>, LLFIO_V2_NAMESPACE::result<int>>::value, "kerneltest::outcome<int> is not constructible from afio::result<int>!");
+static_assert(std::is_constructible<KERNELTEST_V1_NAMESPACE::result<int>, LLFIO_V2_NAMESPACE::result<int>>::value, "kerneltest::result<int> is not constructible from llfio::result<int>!");
+static_assert(std::is_constructible<KERNELTEST_V1_NAMESPACE::outcome<int>, LLFIO_V2_NAMESPACE::result<int>>::value, "kerneltest::outcome<int> is not constructible from llfio::result<int>!");
#endif
#endif // namespace
diff --git a/test/tests/async_io.cpp b/test/tests/async_io.cpp
index da78d63e..f9d1cfec 100644
--- a/test/tests/async_io.cpp
+++ b/test/tests/async_io.cpp
@@ -28,24 +28,24 @@ Distributed under the Boost Software License, Version 1.0.
static inline void TestAsyncFileHandle()
{
- namespace afio = LLFIO_V2_NAMESPACE;
- afio::io_service service;
- afio::async_file_handle h = afio::async_file_handle::async_file(service, {}, "temp", afio::file_handle::mode::write, afio::file_handle::creation::if_needed, afio::file_handle::caching::only_metadata, afio::file_handle::flag::unlink_on_first_close).value();
- std::vector<std::pair<std::future<afio::async_file_handle::const_buffers_type>, afio::async_file_handle::io_state_ptr>> futures;
+ namespace llfio = LLFIO_V2_NAMESPACE;
+ llfio::io_service service;
+ llfio::async_file_handle h = llfio::async_file_handle::async_file(service, {}, "temp", llfio::file_handle::mode::write, llfio::file_handle::creation::if_needed, llfio::file_handle::caching::only_metadata, llfio::file_handle::flag::unlink_on_first_close).value();
+ std::vector<std::pair<std::future<llfio::async_file_handle::const_buffers_type>, llfio::async_file_handle::io_state_ptr>> futures;
futures.reserve(1024);
h.truncate(1024 * 4096).value();
- alignas(4096) afio::byte buffer[4096];
+ alignas(4096) llfio::byte buffer[4096];
memset(buffer, 78, 4096); // NOLINT
- afio::async_file_handle::const_buffer_type bt{buffer, sizeof(buffer)}; // NOLINT
+ llfio::async_file_handle::const_buffer_type bt{buffer, sizeof(buffer)}; // NOLINT
for(size_t n = 0; n < 1024; n++)
{
retry:
- std::promise<afio::async_file_handle::const_buffers_type> p;
+ std::promise<llfio::async_file_handle::const_buffers_type> p;
auto f(p.get_future());
auto schedule_io = [&] {
- return h.async_write({bt, n * 4096}, [ p = std::move(p), n ](afio::async_file_handle *, afio::async_file_handle::io_result<afio::async_file_handle::const_buffers_type> & result) mutable {
+ return h.async_write({bt, n * 4096}, [ p = std::move(p), n ](llfio::async_file_handle *, llfio::async_file_handle::io_result<llfio::async_file_handle::const_buffers_type> & result) mutable {
(void) n;
- if(!result && result.error() == afio::errc::resource_unavailable_try_again)
+ if(!result && result.error() == llfio::errc::resource_unavailable_try_again)
{
std::cout << "*** Completion handler saw error " << result.error() << std::endl;
}
@@ -62,7 +62,7 @@ static inline void TestAsyncFileHandle()
});
};
auto g(schedule_io());
- if(!g && g.error() == afio::errc::resource_unavailable_try_again)
+ if(!g && g.error() == llfio::errc::resource_unavailable_try_again)
{
// Sleep until at least i/o is processed
service.run().value();
@@ -78,10 +78,10 @@ static inline void TestAsyncFileHandle()
// Make sure nothing went wrong by fetching the futures.
for(auto &i : futures)
{
- afio::async_file_handle::const_buffers_type out = i.first.get();
+ llfio::async_file_handle::const_buffers_type out = i.first.get();
// std::cout << out.data()->len << std::endl;
BOOST_CHECK(out.data()->len == 4096);
}
}
-KERNELTEST_TEST_KERNEL(integration, afio, works, async_file_handle, "Tests that afio::async_file_handle works as expected", TestAsyncFileHandle())
+KERNELTEST_TEST_KERNEL(integration, llfio, works, async_file_handle, "Tests that llfio::async_file_handle works as expected", TestAsyncFileHandle())
diff --git a/test/tests/coroutines.cpp b/test/tests/coroutines.cpp
index 7c1a859e..e6a09b6a 100644
--- a/test/tests/coroutines.cpp
+++ b/test/tests/coroutines.cpp
@@ -30,22 +30,22 @@ static inline void TestAsyncFileHandleCoroutines()
{
#ifdef __cpp_coroutines
//! [coroutines_example]
- namespace afio = LLFIO_V2_NAMESPACE;
+ namespace llfio = LLFIO_V2_NAMESPACE;
// Create an i/o service for this thread
- afio::io_service service;
+ llfio::io_service service;
// Create an async file i/o handle attached to the i/o service for this thread
- afio::async_file_handle h = afio::async_file_handle::async_file(service, {}, "temp", afio::file_handle::mode::write, afio::file_handle::creation::if_needed, afio::file_handle::caching::only_metadata, afio::file_handle::flag::unlink_on_first_close).value();
+ llfio::async_file_handle h = llfio::async_file_handle::async_file(service, {}, "temp", llfio::file_handle::mode::write, llfio::file_handle::creation::if_needed, llfio::file_handle::caching::only_metadata, llfio::file_handle::flag::unlink_on_first_close).value();
// Truncate to 1Mb
h.truncate(1024 * 4096);
// Launch 8 coroutines, each writing 4Kb of chars 0-8 to every 32Kb block
auto coroutine = [&h](size_t no) -> std::future<void> {
- std::vector<afio::byte, afio::utils::page_allocator<afio::byte>> buffer(4096);
+ std::vector<llfio::byte, llfio::utils::page_allocator<llfio::byte>> buffer(4096);
memset(buffer.data(), (int) ('0' + no), 4096);
- afio::async_file_handle::const_buffer_type bt{buffer.data(), buffer.size()};
+ llfio::async_file_handle::const_buffer_type bt{buffer.data(), buffer.size()};
for(size_t n = 0; n < 128; n++)
{
// This will initiate the i/o, and suspend the coroutine until completion.
@@ -71,8 +71,8 @@ static inline void TestAsyncFileHandleCoroutines()
//! [coroutines_example]
// Check that the file has the right contents
- alignas(4096) afio::byte buffer1[4096], buffer2[4096];
- afio::async_file_handle::extent_type offset = 0;
+ alignas(4096) llfio::byte buffer1[4096], buffer2[4096];
+ llfio::async_file_handle::extent_type offset = 0;
for(size_t n = 0; n < 128; n++)
{
for(size_t m = 0; m < 8; m++)
@@ -89,8 +89,8 @@ static inline void TestAsyncFileHandleCoroutines()
static inline void TestPostSelfToRunCoroutines()
{
#ifdef __cpp_coroutines
- namespace afio = LLFIO_V2_NAMESPACE;
- afio::io_service service;
+ namespace llfio = LLFIO_V2_NAMESPACE;
+ llfio::io_service service;
std::atomic<bool> ready(false);
auto runthreadid = QUICKCPPLIB_NAMESPACE::utils::thread::this_thread_id();
auto coroutinethread = [&]() -> void {
@@ -98,7 +98,7 @@ static inline void TestPostSelfToRunCoroutines()
auto thisthreadid = QUICKCPPLIB_NAMESPACE::utils::thread::this_thread_id();
BOOST_CHECK(thisthreadid != runthreadid);
ready = true;
- co_await afio::io_service::awaitable_post_to_self(service);
+ co_await llfio::io_service::awaitable_post_to_self(service);
thisthreadid = QUICKCPPLIB_NAMESPACE::utils::thread::this_thread_id();
BOOST_CHECK(thisthreadid == runthreadid);
// std::cout << "Coroutine exiting" << std::endl;
@@ -121,5 +121,5 @@ static inline void TestPostSelfToRunCoroutines()
#endif
}
-KERNELTEST_TEST_KERNEL(integration, afio, coroutines, async_file_handle, "Tests that afio::async_file_handle works as expected with Coroutines", TestAsyncFileHandleCoroutines())
-KERNELTEST_TEST_KERNEL(integration, afio, coroutines, co_post_self_to_run, "Tests that afio::io_service::co_post_self_to_run() works as expected with Coroutines", TestPostSelfToRunCoroutines())
+KERNELTEST_TEST_KERNEL(integration, llfio, coroutines, async_file_handle, "Tests that llfio::async_file_handle works as expected with Coroutines", TestAsyncFileHandleCoroutines())
+KERNELTEST_TEST_KERNEL(integration, llfio, coroutines, co_post_self_to_run, "Tests that llfio::io_service::co_post_self_to_run() works as expected with Coroutines", TestPostSelfToRunCoroutines())
diff --git a/test/tests/current_path.cpp b/test/tests/current_path.cpp
index 80f3aa33..40776008 100644
--- a/test/tests/current_path.cpp
+++ b/test/tests/current_path.cpp
@@ -26,21 +26,21 @@ Distributed under the Boost Software License, Version 1.0.
template <class FileHandleType, class DirectoryHandleType> static inline void TestHandleCurrentPath()
{
- namespace afio = LLFIO_V2_NAMESPACE;
+ namespace llfio = LLFIO_V2_NAMESPACE;
{
std::error_code ec;
- afio::filesystem::remove_all("tempfile", ec);
- afio::filesystem::remove_all("tempfile2", ec);
- afio::filesystem::remove_all("tempdir", ec);
- afio::filesystem::remove_all("tempdir2", ec);
+ llfio::filesystem::remove_all("tempfile", ec);
+ llfio::filesystem::remove_all("tempfile2", ec);
+ llfio::filesystem::remove_all("tempdir", ec);
+ llfio::filesystem::remove_all("tempdir2", ec);
}
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmissing-braces"
#endif
- afio::path_handle null_path_handle;
- FileHandleType h1 = afio::construct<FileHandleType>{null_path_handle, "tempfile", afio::file_handle::mode::write, afio::file_handle::creation::if_needed, afio::file_handle::caching::temporary, afio::file_handle::flag::none}().value(); // NOLINT
- DirectoryHandleType h2 = afio::construct<DirectoryHandleType>{null_path_handle, "tempdir", afio::file_handle::mode::write, afio::file_handle::creation::if_needed, afio::file_handle::caching::all, afio::file_handle::flag::none}().value(); // NOLINT
+ llfio::path_handle null_path_handle;
+ FileHandleType h1 = llfio::construct<FileHandleType>{null_path_handle, "tempfile", llfio::file_handle::mode::write, llfio::file_handle::creation::if_needed, llfio::file_handle::caching::temporary, llfio::file_handle::flag::none}().value(); // NOLINT
+ DirectoryHandleType h2 = llfio::construct<DirectoryHandleType>{null_path_handle, "tempdir", llfio::file_handle::mode::write, llfio::file_handle::creation::if_needed, llfio::file_handle::caching::all, llfio::file_handle::flag::none}().value(); // NOLINT
#ifdef __clang__
#pragma clang diagnostic pop
#endif
@@ -156,6 +156,6 @@ template <class FileHandleType, class DirectoryHandleType> static inline void Te
h2.unlink().value();
}
-KERNELTEST_TEST_KERNEL(integration, afio, current_path, handle, "Tests that afio::handle::current_path() works as expected", TestHandleCurrentPath<LLFIO_V2_NAMESPACE::file_handle, LLFIO_V2_NAMESPACE::directory_handle>())
-KERNELTEST_TEST_KERNEL(integration, afio, current_path, cached_parent_handle_adapter, "Tests that afio::cached_parent_handle_adapter::current_path() works as expected",
+KERNELTEST_TEST_KERNEL(integration, llfio, current_path, handle, "Tests that llfio::handle::current_path() works as expected", TestHandleCurrentPath<LLFIO_V2_NAMESPACE::file_handle, LLFIO_V2_NAMESPACE::directory_handle>())
+KERNELTEST_TEST_KERNEL(integration, llfio, current_path, cached_parent_handle_adapter, "Tests that llfio::cached_parent_handle_adapter::current_path() works as expected",
TestHandleCurrentPath<LLFIO_V2_NAMESPACE::algorithm::cached_parent_handle_adapter<LLFIO_V2_NAMESPACE::file_handle>, LLFIO_V2_NAMESPACE::algorithm::cached_parent_handle_adapter<LLFIO_V2_NAMESPACE::directory_handle>>())
diff --git a/test/tests/directory_handle_create_close/runner.cpp b/test/tests/directory_handle_create_close/runner.cpp
index c502f8b1..0001df01 100644
--- a/test/tests/directory_handle_create_close/runner.cpp
+++ b/test/tests/directory_handle_create_close/runner.cpp
@@ -154,5 +154,5 @@ template <class U> inline void directory_handle_create_close_creation(U &&f)
check_results_with_boost_test(permuter, results);
}
-KERNELTEST_TEST_KERNEL(unit, afio, directory_handle_create_close, directory_handle, "Tests that afio::directory_handle::directory()'s parameters with absolute paths work as expected", directory_handle_create_close_creation(directory_handle_create_close::test_kernel_directory_handle_absolute))
-KERNELTEST_TEST_KERNEL(unit, afio, directory_handle_create_close, directory_handle, "Tests that afio::directory_handle::directory()'s parameters with relative paths work as expected", directory_handle_create_close_creation(directory_handle_create_close::test_kernel_directory_handle_relative))
+KERNELTEST_TEST_KERNEL(unit, llfio, directory_handle_create_close, directory_handle, "Tests that llfio::directory_handle::directory()'s parameters with absolute paths work as expected", directory_handle_create_close_creation(directory_handle_create_close::test_kernel_directory_handle_absolute))
+KERNELTEST_TEST_KERNEL(unit, llfio, directory_handle_create_close, directory_handle, "Tests that llfio::directory_handle::directory()'s parameters with relative paths work as expected", directory_handle_create_close_creation(directory_handle_create_close::test_kernel_directory_handle_relative))
diff --git a/test/tests/directory_handle_enumerate/runner.cpp b/test/tests/directory_handle_enumerate/runner.cpp
index 13eb53af..99bc10b7 100644
--- a/test/tests/directory_handle_enumerate/runner.cpp
+++ b/test/tests/directory_handle_enumerate/runner.cpp
@@ -124,4 +124,4 @@ template <class U> inline void directory_handle_enumerate_(U &&f)
check_results_with_boost_test(permuter, results);
}
-KERNELTEST_TEST_KERNEL(unit, afio, directory_handle_enumerate, directory_handle, "Tests that afio::directory_handle::enumerate's parameters work as expected", directory_handle_enumerate_(directory_handle_enumerate::test_kernel_directory_handle_enumerate))
+KERNELTEST_TEST_KERNEL(unit, llfio, directory_handle_enumerate, directory_handle, "Tests that llfio::directory_handle::enumerate's parameters work as expected", directory_handle_enumerate_(directory_handle_enumerate::test_kernel_directory_handle_enumerate))
diff --git a/test/tests/file_handle_create_close/runner.cpp b/test/tests/file_handle_create_close/runner.cpp
index 6f23131e..e33b0c09 100644
--- a/test/tests/file_handle_create_close/runner.cpp
+++ b/test/tests/file_handle_create_close/runner.cpp
@@ -94,7 +94,7 @@ template <class U> inline void file_handle_create_close_creation(U &&f)
check_results_with_boost_test(permuter, results);
}
-KERNELTEST_TEST_KERNEL(unit, afio, file_handle_create_close, file_handle, "Tests that afio::file_handle::file()'s parameters with absolute paths work as expected", file_handle_create_close_creation(file_handle_create_close::test_kernel_file_handle_absolute))
-KERNELTEST_TEST_KERNEL(unit, afio, file_handle_create_close, file_handle, "Tests that afio::file_handle::file()'s parameters with relative paths work as expected", file_handle_create_close_creation(file_handle_create_close::test_kernel_file_handle_relative))
-KERNELTEST_TEST_KERNEL(unit, afio, file_handle_create_close, async_file_handle, "Tests that afio::async_file_handle::async_file()'s parameters with absolute paths work as expected", file_handle_create_close_creation(file_handle_create_close::test_kernel_async_file_handle_absolute))
-KERNELTEST_TEST_KERNEL(unit, afio, file_handle_create_close, async_file_handle, "Tests that afio::async_file_handle::async_file()'s parameters with relative paths work as expected", file_handle_create_close_creation(file_handle_create_close::test_kernel_async_file_handle_relative))
+KERNELTEST_TEST_KERNEL(unit, llfio, file_handle_create_close, file_handle, "Tests that llfio::file_handle::file()'s parameters with absolute paths work as expected", file_handle_create_close_creation(file_handle_create_close::test_kernel_file_handle_absolute))
+KERNELTEST_TEST_KERNEL(unit, llfio, file_handle_create_close, file_handle, "Tests that llfio::file_handle::file()'s parameters with relative paths work as expected", file_handle_create_close_creation(file_handle_create_close::test_kernel_file_handle_relative))
+KERNELTEST_TEST_KERNEL(unit, llfio, file_handle_create_close, async_file_handle, "Tests that llfio::async_file_handle::async_file()'s parameters with absolute paths work as expected", file_handle_create_close_creation(file_handle_create_close::test_kernel_async_file_handle_absolute))
+KERNELTEST_TEST_KERNEL(unit, llfio, file_handle_create_close, async_file_handle, "Tests that llfio::async_file_handle::async_file()'s parameters with relative paths work as expected", file_handle_create_close_creation(file_handle_create_close::test_kernel_async_file_handle_relative))
diff --git a/test/tests/file_handle_lock_unlock.cpp b/test/tests/file_handle_lock_unlock.cpp
index d884c00f..141a5233 100644
--- a/test/tests/file_handle_lock_unlock.cpp
+++ b/test/tests/file_handle_lock_unlock.cpp
@@ -26,21 +26,21 @@ Distributed under the Boost Software License, Version 1.0.
static inline void TestFileHandleLockUnlock()
{
- namespace afio = LLFIO_V2_NAMESPACE;
- afio::file_handle h1 = afio::file_handle::file({}, "temp", afio::file_handle::mode::write, afio::file_handle::creation::if_needed, afio::file_handle::caching::temporary, afio::file_handle::flag::unlink_on_first_close).value();
- afio::file_handle h2 = afio::file_handle::file({}, "temp", afio::file_handle::mode::write, afio::file_handle::creation::if_needed, afio::file_handle::caching::temporary, afio::file_handle::flag::unlink_on_first_close).value();
+ namespace llfio = LLFIO_V2_NAMESPACE;
+ llfio::file_handle h1 = llfio::file_handle::file({}, "temp", llfio::file_handle::mode::write, llfio::file_handle::creation::if_needed, llfio::file_handle::caching::temporary, llfio::file_handle::flag::unlink_on_first_close).value();
+ llfio::file_handle h2 = llfio::file_handle::file({}, "temp", llfio::file_handle::mode::write, llfio::file_handle::creation::if_needed, llfio::file_handle::caching::temporary, llfio::file_handle::flag::unlink_on_first_close).value();
// Two exclusive locks not possible
{
auto _1 = h1.lock(0, 0, true, std::chrono::seconds(0));
BOOST_REQUIRE(!_1.has_error());
- if(h1.flags() & afio::file_handle::flag::byte_lock_insanity)
+ if(h1.flags() & llfio::file_handle::flag::byte_lock_insanity)
{
std::cout << "This platform has byte_lock_insanity so this test won't be useful, bailing out" << std::endl;
return;
}
auto _2 = h2.lock(0, 0, true, std::chrono::seconds(0));
BOOST_REQUIRE(_2.has_error());
- BOOST_CHECK(_2.error() == afio::errc::timed_out);
+ BOOST_CHECK(_2.error() == llfio::errc::timed_out);
}
// Two non-exclusive locks okay
{
@@ -55,8 +55,8 @@ static inline void TestFileHandleLockUnlock()
BOOST_REQUIRE(!_1.has_error());
auto _2 = h2.lock(0, 0, true, std::chrono::seconds(0));
BOOST_REQUIRE(_2.has_error());
- BOOST_CHECK(_2.error() == afio::errc::timed_out);
+ BOOST_CHECK(_2.error() == llfio::errc::timed_out);
}
}
-KERNELTEST_TEST_KERNEL(integration, afio, file_handle_lock_unlock, file_handle, "Tests that afio::file_handle's lock and unlock work as expected", TestFileHandleLockUnlock())
+KERNELTEST_TEST_KERNEL(integration, llfio, file_handle_lock_unlock, file_handle, "Tests that llfio::file_handle's lock and unlock work as expected", TestFileHandleLockUnlock())
diff --git a/test/tests/map_handle_create_close/runner.cpp b/test/tests/map_handle_create_close/runner.cpp
index e9f8ba4f..cba2d578 100644
--- a/test/tests/map_handle_create_close/runner.cpp
+++ b/test/tests/map_handle_create_close/runner.cpp
@@ -161,4 +161,4 @@ template <class U> inline void map_handle_create_close_(U &&f)
check_results_with_boost_test(permuter, results);
}
-KERNELTEST_TEST_KERNEL(unit, afio, map_handle_create_close, map_handle, "Tests that afio::map_handle's creation parameters work as expected", map_handle_create_close_(map_handle_create_close::test_kernel_map_handle))
+KERNELTEST_TEST_KERNEL(unit, llfio, map_handle_create_close, map_handle, "Tests that llfio::map_handle's creation parameters work as expected", map_handle_create_close_(map_handle_create_close::test_kernel_map_handle))
diff --git a/test/tests/mapped_span.cpp b/test/tests/mapped_span.cpp
index 7a1466a8..af32c200 100644
--- a/test/tests/mapped_span.cpp
+++ b/test/tests/mapped_span.cpp
@@ -136,5 +136,5 @@ static inline void TestMappedView2()
BOOST_CHECK(mfh.address() == nullptr);
}
-KERNELTEST_TEST_KERNEL(integration, afio, algorithm, mapped_span1, "Tests that afio::algorithm::mapped_span works as expected", TestMappedView1())
-KERNELTEST_TEST_KERNEL(integration, afio, algorithm, mapped_span2, "Tests that afio::algorithm::mapped_span works as expected", TestMappedView2())
+KERNELTEST_TEST_KERNEL(integration, llfio, algorithm, mapped_span1, "Tests that llfio::algorithm::mapped_span works as expected", TestMappedView1())
+KERNELTEST_TEST_KERNEL(integration, llfio, algorithm, mapped_span2, "Tests that llfio::algorithm::mapped_span works as expected", TestMappedView2())
diff --git a/test/tests/path_discovery.cpp b/test/tests/path_discovery.cpp
index 0a0257aa..ef9ae5e8 100644
--- a/test/tests/path_discovery.cpp
+++ b/test/tests/path_discovery.cpp
@@ -26,22 +26,22 @@ Distributed under the Boost Software License, Version 1.0.
static inline void TestPathDiscovery()
{
- namespace afio = LLFIO_V2_NAMESPACE;
- auto raw_list = afio::path_discovery::all_temporary_directories();
+ namespace llfio = LLFIO_V2_NAMESPACE;
+ auto raw_list = llfio::path_discovery::all_temporary_directories();
std::cout << "The raw list of temporary directory paths on this system are:" << std::endl;
for(auto &i : raw_list)
{
std::cout << " " << i.path << " (" << i.source << ")" << std::endl;
}
- auto verified_list = afio::path_discovery::verified_temporary_directories();
+ auto verified_list = llfio::path_discovery::verified_temporary_directories();
std::cout << "\nThe verified list of temporary directory paths on this system are:" << std::endl;
for(auto &i : verified_list)
{
std::cout << " " << i.path << " (" << i.source << ")" << std::endl;
}
- auto &storage_backed = afio::path_discovery::storage_backed_temporary_files_directory();
+ auto &storage_backed = llfio::path_discovery::storage_backed_temporary_files_directory();
if(storage_backed.is_valid())
{
std::cout << "\nThe storage backed temporary files directory chosen is:\n " << storage_backed.current_path().value() << std::endl;
@@ -51,7 +51,7 @@ static inline void TestPathDiscovery()
std::cout << "\nNo storage backed temporary files directory found!" << std::endl;
}
- auto &memory_backed = afio::path_discovery::memory_backed_temporary_files_directory();
+ auto &memory_backed = llfio::path_discovery::memory_backed_temporary_files_directory();
if(memory_backed.is_valid())
{
std::cout << "\nThe memory backed temporary files directory chosen is:\n " << memory_backed.current_path().value() << std::endl;
@@ -62,4 +62,4 @@ static inline void TestPathDiscovery()
}
}
-KERNELTEST_TEST_KERNEL(integration, afio, path_discovery, temp_directories, "Tests that afio::path_discovery works as expected", TestPathDiscovery())
+KERNELTEST_TEST_KERNEL(integration, llfio, path_discovery, temp_directories, "Tests that llfio::path_discovery works as expected", TestPathDiscovery())
diff --git a/test/tests/path_view.cpp b/test/tests/path_view.cpp
index 93eb697d..78ef8b9b 100644
--- a/test/tests/path_view.cpp
+++ b/test/tests/path_view.cpp
@@ -26,53 +26,53 @@ Distributed under the Boost Software License, Version 1.0.
static inline void TestPathView()
{
- namespace afio = LLFIO_V2_NAMESPACE;
+ namespace llfio = LLFIO_V2_NAMESPACE;
// path view has constexpr construction
- constexpr afio::path_view a, b("hello");
+ constexpr llfio::path_view a, b("hello");
BOOST_CHECK(a.empty());
BOOST_CHECK(!b.empty());
BOOST_CHECK(b == "hello");
// Globs
- BOOST_CHECK(afio::path_view("niall*").contains_glob());
+ BOOST_CHECK(llfio::path_view("niall*").contains_glob());
// Splitting
- constexpr const char p[] = "/mnt/c/Users/ned/Documents/boostish/afio/programs/build_posix/testdir/0";
- afio::path_view e(p); // NOLINT
- afio::path_view f(e.filename());
+ constexpr const char p[] = "/mnt/c/Users/ned/Documents/boostish/llfio/programs/build_posix/testdir/0";
+ llfio::path_view e(p); // NOLINT
+ llfio::path_view f(e.filename());
e.remove_filename();
- BOOST_CHECK(e == "/mnt/c/Users/ned/Documents/boostish/afio/programs/build_posix/testdir");
+ BOOST_CHECK(e == "/mnt/c/Users/ned/Documents/boostish/llfio/programs/build_posix/testdir");
BOOST_CHECK(f == "0");
#ifndef _WIN32
// cstr
- afio::path_view::c_str g(e);
+ llfio::path_view::c_str g(e);
BOOST_CHECK(g.buffer != p); // NOLINT
- afio::path_view::c_str h(f);
+ llfio::path_view::c_str h(f);
BOOST_CHECK(h.buffer == p + 70); // NOLINT
#endif
#ifdef _WIN32
// On Windows, UTF-8 and UTF-16 paths are equivalent and backslash conversion happens
- afio::path_view c("path/to"), d(L"path\\to");
+ llfio::path_view c("path/to"), d(L"path\\to");
BOOST_CHECK(c == d);
// Globs
- BOOST_CHECK(afio::path_view(L"niall*").contains_glob());
- BOOST_CHECK(afio::path_view("0123456789012345678901234567890123456789012345678901234567890123.deleted").is_afio_deleted());
- BOOST_CHECK(afio::path_view(L"0123456789012345678901234567890123456789012345678901234567890123.deleted").is_afio_deleted());
- BOOST_CHECK(!afio::path_view("0123456789012345678901234567890123456789g12345678901234567890123.deleted").is_afio_deleted());
+ BOOST_CHECK(llfio::path_view(L"niall*").contains_glob());
+ BOOST_CHECK(llfio::path_view("0123456789012345678901234567890123456789012345678901234567890123.deleted").is_llfio_deleted());
+ BOOST_CHECK(llfio::path_view(L"0123456789012345678901234567890123456789012345678901234567890123.deleted").is_llfio_deleted());
+ BOOST_CHECK(!llfio::path_view("0123456789012345678901234567890123456789g12345678901234567890123.deleted").is_llfio_deleted());
// Splitting
- constexpr const wchar_t p2[] = L"\\mnt\\c\\Users\\ned\\Documents\\boostish\\afio\\programs\\build_posix\\testdir\\0";
- afio::path_view g(p2);
- afio::path_view h(g.filename());
+ constexpr const wchar_t p2[] = L"\\mnt\\c\\Users\\ned\\Documents\\boostish\\llfio\\programs\\build_posix\\testdir\\0";
+ llfio::path_view g(p2);
+ llfio::path_view h(g.filename());
g.remove_filename();
- BOOST_CHECK(g == "\\mnt\\c\\Users\\ned\\Documents\\boostish\\afio\\programs\\build_posix\\testdir");
+ BOOST_CHECK(g == "\\mnt\\c\\Users\\ned\\Documents\\boostish\\llfio\\programs\\build_posix\\testdir");
BOOST_CHECK(h == "0");
// cstr
- afio::path_view::c_str i(g, false);
+ llfio::path_view::c_str i(g, false);
BOOST_CHECK(i.buffer != p2);
- afio::path_view::c_str j(g, true);
+ llfio::path_view::c_str j(g, true);
BOOST_CHECK(j.buffer == p2);
- afio::path_view::c_str k(h, false);
+ llfio::path_view::c_str k(h, false);
BOOST_CHECK(k.buffer == p2 + 70);
#endif
}
-KERNELTEST_TEST_KERNEL(integration, afio, path_view, path_view, "Tests that afio::path_view() works as expected", TestPathView())
+KERNELTEST_TEST_KERNEL(integration, llfio, path_view, path_view, "Tests that llfio::path_view() works as expected", TestPathView())
diff --git a/test/tests/section_handle_create_close/runner.cpp b/test/tests/section_handle_create_close/runner.cpp
index fc11b716..bcf19165 100644
--- a/test/tests/section_handle_create_close/runner.cpp
+++ b/test/tests/section_handle_create_close/runner.cpp
@@ -94,4 +94,4 @@ template <class U> inline void section_handle_create_close_(U &&f)
check_results_with_boost_test(permuter, results);
}
-KERNELTEST_TEST_KERNEL(unit, afio, section_handle_create_close, section_handle, "Tests that afio::section_handle's creation parameters work as expected", section_handle_create_close_(section_handle_create_close::test_kernel_section_handle))
+KERNELTEST_TEST_KERNEL(unit, llfio, section_handle_create_close, section_handle, "Tests that llfio::section_handle's creation parameters work as expected", section_handle_create_close_(section_handle_create_close::test_kernel_section_handle))
diff --git a/test/tests/shared_fs_mutex.cpp b/test/tests/shared_fs_mutex.cpp
index 075b427d..60145f58 100644
--- a/test/tests/shared_fs_mutex.cpp
+++ b/test/tests/shared_fs_mutex.cpp
@@ -26,7 +26,7 @@ Distributed under the Boost Software License, Version 1.0.
#include "../test_kernel_decl.hpp"
-KERNELTEST_TEST_KERNEL(unit, afio, shared_fs_mutex, entity_endian, "Tests that afio::algorithm::shared_fs_mutex::entity_type has the right endian", [] {
+KERNELTEST_TEST_KERNEL(unit, llfio, shared_fs_mutex, entity_endian, "Tests that llfio::algorithm::shared_fs_mutex::entity_type has the right endian", [] {
LLFIO_V2_NAMESPACE::algorithm::shared_fs_mutex::shared_fs_mutex::entity_type v(0, true);
BOOST_REQUIRE(v._init != 1UL); // NOLINT
}())
@@ -332,29 +332,29 @@ static inline void check_child_worker(const KERNELTEST_V1_NAMESPACE::child_worke
static std::string _TestSharedFSMutexCorrectnessChildWorker(KERNELTEST_V1_NAMESPACE::waitable_done &waitable, size_t childidx, shared_memory *shmem) // NOLINT
{
- namespace afio = LLFIO_V2_NAMESPACE;
+ namespace llfio = LLFIO_V2_NAMESPACE;
++shmem->current_exclusive;
while(-1 != shmem->current_exclusive)
{
std::this_thread::yield();
}
- std::unique_ptr<afio::algorithm::shared_fs_mutex::shared_fs_mutex> lock;
+ std::unique_ptr<llfio::algorithm::shared_fs_mutex::shared_fs_mutex> lock;
switch(shmem->mutex_kind)
{
case shared_memory::mutex_kind_type::atomic_append:
- lock = std::make_unique<afio::algorithm::shared_fs_mutex::atomic_append>(afio::algorithm::shared_fs_mutex::atomic_append::fs_mutex_append({}, "lockfile").value());
+ lock = std::make_unique<llfio::algorithm::shared_fs_mutex::atomic_append>(llfio::algorithm::shared_fs_mutex::atomic_append::fs_mutex_append({}, "lockfile").value());
break;
case shared_memory::mutex_kind_type::byte_ranges:
- lock = std::make_unique<afio::algorithm::shared_fs_mutex::byte_ranges>(afio::algorithm::shared_fs_mutex::byte_ranges::fs_mutex_byte_ranges({}, "lockfile").value());
+ lock = std::make_unique<llfio::algorithm::shared_fs_mutex::byte_ranges>(llfio::algorithm::shared_fs_mutex::byte_ranges::fs_mutex_byte_ranges({}, "lockfile").value());
break;
case shared_memory::mutex_kind_type::safe_byte_ranges:
- lock = std::make_unique<afio::algorithm::shared_fs_mutex::safe_byte_ranges>(afio::algorithm::shared_fs_mutex::safe_byte_ranges::fs_mutex_safe_byte_ranges({}, "lockfile").value());
+ lock = std::make_unique<llfio::algorithm::shared_fs_mutex::safe_byte_ranges>(llfio::algorithm::shared_fs_mutex::safe_byte_ranges::fs_mutex_safe_byte_ranges({}, "lockfile").value());
break;
case shared_memory::mutex_kind_type::lock_files:
- lock = std::make_unique<afio::algorithm::shared_fs_mutex::lock_files>(afio::algorithm::shared_fs_mutex::lock_files::fs_mutex_lock_files(afio::path_handle::path(".").value()).value());
+ lock = std::make_unique<llfio::algorithm::shared_fs_mutex::lock_files>(llfio::algorithm::shared_fs_mutex::lock_files::fs_mutex_lock_files(llfio::path_handle::path(".").value()).value());
break;
case shared_memory::mutex_kind_type::memory_map:
- lock = std::make_unique<afio::algorithm::shared_fs_mutex::memory_map<>>(afio::algorithm::shared_fs_mutex::memory_map<>::fs_mutex_map({}, "lockfile").value());
+ lock = std::make_unique<llfio::algorithm::shared_fs_mutex::memory_map<>>(llfio::algorithm::shared_fs_mutex::memory_map<>::fs_mutex_map({}, "lockfile").value());
break;
}
++shmem->current_shared;
@@ -367,7 +367,7 @@ static std::string _TestSharedFSMutexCorrectnessChildWorker(KERNELTEST_V1_NAMESP
{
if(shmem->testtype == shared_memory::test_type::exclusive || (shmem->testtype == shared_memory::test_type::both && childidx < 2))
{
- auto h = lock->lock(afio::algorithm::shared_fs_mutex::shared_fs_mutex::entity_type(0, true)).value();
+ auto h = lock->lock(llfio::algorithm::shared_fs_mutex::shared_fs_mutex::entity_type(0, true)).value();
long oldval = shmem->current_exclusive.exchange(static_cast<long>(childidx));
if(oldval != -1)
{
@@ -386,7 +386,7 @@ static std::string _TestSharedFSMutexCorrectnessChildWorker(KERNELTEST_V1_NAMESP
}
else if(shmem->testtype == shared_memory::test_type::shared || shmem->testtype == shared_memory::test_type::both)
{
- auto h = lock->lock(afio::algorithm::shared_fs_mutex::shared_fs_mutex::entity_type(0, false)).value();
+ auto h = lock->lock(llfio::algorithm::shared_fs_mutex::shared_fs_mutex::entity_type(0, false)).value();
long oldval = ++shmem->current_shared;
if(oldval > maxreaders)
{
@@ -403,10 +403,10 @@ static std::string _TestSharedFSMutexCorrectnessChildWorker(KERNELTEST_V1_NAMESP
return "ok, max concurrent readers was " + std::to_string(maxreaders);
}
static auto TestSharedFSMutexCorrectnessChildWorker = KERNELTEST_V1_NAMESPACE::register_child_worker("TestSharedFSMutexCorrectness", [](KERNELTEST_V1_NAMESPACE::waitable_done &waitable, size_t childidx, const char * /*unused*/) -> std::string { // NOLINT
- namespace afio = LLFIO_V2_NAMESPACE;
- auto shared_mem_file = afio::file_handle::file({}, "shared_memory", afio::file_handle::mode::write, afio::file_handle::creation::open_existing, afio::file_handle::caching::temporary).value();
- auto shared_mem_file_section = afio::section_handle::section(shared_mem_file, sizeof(shared_memory), afio::section_handle::flag::readwrite).value();
- auto shared_mem_file_map = afio::map_handle::map(shared_mem_file_section).value();
+ namespace llfio = LLFIO_V2_NAMESPACE;
+ auto shared_mem_file = llfio::file_handle::file({}, "shared_memory", llfio::file_handle::mode::write, llfio::file_handle::creation::open_existing, llfio::file_handle::caching::temporary).value();
+ auto shared_mem_file_section = llfio::section_handle::section(shared_mem_file, sizeof(shared_memory), llfio::section_handle::flag::readwrite).value();
+ auto shared_mem_file_map = llfio::map_handle::map(shared_mem_file_section).value();
auto *shmem = reinterpret_cast<shared_memory *>(shared_mem_file_map.address()); // NOLINT
return _TestSharedFSMutexCorrectnessChildWorker(waitable, childidx, shmem);
});
@@ -419,11 +419,11 @@ else. Verify shared allows other shared.
void TestSharedFSMutexCorrectness(shared_memory::mutex_kind_type mutex_kind, shared_memory::test_type testtype, bool threads_not_processes)
{
- namespace afio = LLFIO_V2_NAMESPACE;
- auto shared_mem_file = afio::file_handle::file({}, "shared_memory", afio::file_handle::mode::write, afio::file_handle::creation::if_needed, afio::file_handle::caching::temporary, afio::file_handle::flag::unlink_on_first_close).value();
+ namespace llfio = LLFIO_V2_NAMESPACE;
+ auto shared_mem_file = llfio::file_handle::file({}, "shared_memory", llfio::file_handle::mode::write, llfio::file_handle::creation::if_needed, llfio::file_handle::caching::temporary, llfio::file_handle::flag::unlink_on_first_close).value();
shared_mem_file.truncate(sizeof(shared_memory)).value();
- auto shared_mem_file_section = afio::section_handle::section(shared_mem_file, sizeof(shared_memory), afio::section_handle::flag::readwrite).value();
- auto shared_mem_file_map = afio::map_handle::map(shared_mem_file_section).value();
+ auto shared_mem_file_section = llfio::section_handle::section(shared_mem_file, sizeof(shared_memory), llfio::section_handle::flag::readwrite).value();
+ auto shared_mem_file_map = llfio::map_handle::map(shared_mem_file_section).value();
auto *shmem = reinterpret_cast<shared_memory *>(shared_mem_file_map.address()); // NOLINT
shmem->current_shared = -static_cast<long>(std::thread::hardware_concurrency());
shmem->current_exclusive = -static_cast<long>(std::thread::hardware_concurrency()) - 1;
@@ -473,22 +473,22 @@ void TestSharedFSMutexCorrectness(shared_memory::mutex_kind_type mutex_kind, sha
}
}
-KERNELTEST_TEST_KERNEL(integration, afio, shared_fs_mutex_byte_ranges, exclusives, "Tests that afio::algorithm::shared_fs_mutex::byte_ranges implementation implements exclusive locking", [] { TestSharedFSMutexCorrectness(shared_memory::byte_ranges, shared_memory::exclusive, false); }())
-KERNELTEST_TEST_KERNEL(integration, afio, shared_fs_mutex_byte_ranges, shared, "Tests that afio::algorithm::shared_fs_mutex::byte_ranges implementation implements shared locking", [] { TestSharedFSMutexCorrectness(shared_memory::byte_ranges, shared_memory::shared, false); }())
-KERNELTEST_TEST_KERNEL(integration, afio, shared_fs_mutex_byte_ranges, both, "Tests that afio::algorithm::shared_fs_mutex::byte_ranges implementation implements a mixture of exclusive and shared locking", [] { TestSharedFSMutexCorrectness(shared_memory::byte_ranges, shared_memory::both, false); }())
+KERNELTEST_TEST_KERNEL(integration, llfio, shared_fs_mutex_byte_ranges, exclusives, "Tests that llfio::algorithm::shared_fs_mutex::byte_ranges implementation implements exclusive locking", [] { TestSharedFSMutexCorrectness(shared_memory::byte_ranges, shared_memory::exclusive, false); }())
+KERNELTEST_TEST_KERNEL(integration, llfio, shared_fs_mutex_byte_ranges, shared, "Tests that llfio::algorithm::shared_fs_mutex::byte_ranges implementation implements shared locking", [] { TestSharedFSMutexCorrectness(shared_memory::byte_ranges, shared_memory::shared, false); }())
+KERNELTEST_TEST_KERNEL(integration, llfio, shared_fs_mutex_byte_ranges, both, "Tests that llfio::algorithm::shared_fs_mutex::byte_ranges implementation implements a mixture of exclusive and shared locking", [] { TestSharedFSMutexCorrectness(shared_memory::byte_ranges, shared_memory::both, false); }())
-KERNELTEST_TEST_KERNEL(integration, afio, shared_fs_mutex_memory_map, exclusives, "Tests that afio::algorithm::shared_fs_mutex::memory_map implementation implements exclusive locking", [] { TestSharedFSMutexCorrectness(shared_memory::memory_map, shared_memory::exclusive, false); }())
-KERNELTEST_TEST_KERNEL(integration, afio, shared_fs_mutex_memory_map, shared, "Tests that afio::algorithm::shared_fs_mutex::memory_map implementation implements shared locking", [] { TestSharedFSMutexCorrectness(shared_memory::memory_map, shared_memory::shared, false); }())
-KERNELTEST_TEST_KERNEL(integration, afio, shared_fs_mutex_memory_map, both, "Tests that afio::algorithm::shared_fs_mutex::memory_map implementation implements a mixture of exclusive and shared locking", [] { TestSharedFSMutexCorrectness(shared_memory::memory_map, shared_memory::both, false); }())
+KERNELTEST_TEST_KERNEL(integration, llfio, shared_fs_mutex_memory_map, exclusives, "Tests that llfio::algorithm::shared_fs_mutex::memory_map implementation implements exclusive locking", [] { TestSharedFSMutexCorrectness(shared_memory::memory_map, shared_memory::exclusive, false); }())
+KERNELTEST_TEST_KERNEL(integration, llfio, shared_fs_mutex_memory_map, shared, "Tests that llfio::algorithm::shared_fs_mutex::memory_map implementation implements shared locking", [] { TestSharedFSMutexCorrectness(shared_memory::memory_map, shared_memory::shared, false); }())
+KERNELTEST_TEST_KERNEL(integration, llfio, shared_fs_mutex_memory_map, both, "Tests that llfio::algorithm::shared_fs_mutex::memory_map implementation implements a mixture of exclusive and shared locking", [] { TestSharedFSMutexCorrectness(shared_memory::memory_map, shared_memory::both, false); }())
-KERNELTEST_TEST_KERNEL(integration, afio, shared_fs_mutex_safe_byte_ranges_process, exclusives, "Tests that afio::algorithm::shared_fs_mutex::safe_byte_ranges implementation implements exclusive locking with processes", [] { TestSharedFSMutexCorrectness(shared_memory::memory_map, shared_memory::exclusive, false); }())
-KERNELTEST_TEST_KERNEL(integration, afio, shared_fs_mutex_safe_byte_ranges_process, shared, "Tests that afio::algorithm::shared_fs_mutex::safe_byte_ranges implementation implements shared locking with processes", [] { TestSharedFSMutexCorrectness(shared_memory::memory_map, shared_memory::shared, false); }())
-KERNELTEST_TEST_KERNEL(integration, afio, shared_fs_mutex_safe_byte_ranges_process, both, "Tests that afio::algorithm::shared_fs_mutex::safe_byte_ranges implementation implements a mixture of exclusive and shared locking with processes",
+KERNELTEST_TEST_KERNEL(integration, llfio, shared_fs_mutex_safe_byte_ranges_process, exclusives, "Tests that llfio::algorithm::shared_fs_mutex::safe_byte_ranges implementation implements exclusive locking with processes", [] { TestSharedFSMutexCorrectness(shared_memory::memory_map, shared_memory::exclusive, false); }())
+KERNELTEST_TEST_KERNEL(integration, llfio, shared_fs_mutex_safe_byte_ranges_process, shared, "Tests that llfio::algorithm::shared_fs_mutex::safe_byte_ranges implementation implements shared locking with processes", [] { TestSharedFSMutexCorrectness(shared_memory::memory_map, shared_memory::shared, false); }())
+KERNELTEST_TEST_KERNEL(integration, llfio, shared_fs_mutex_safe_byte_ranges_process, both, "Tests that llfio::algorithm::shared_fs_mutex::safe_byte_ranges implementation implements a mixture of exclusive and shared locking with processes",
[] { TestSharedFSMutexCorrectness(shared_memory::memory_map, shared_memory::both, false); }())
-KERNELTEST_TEST_KERNEL(integration, afio, shared_fs_mutex_safe_byte_ranges_thread, exclusives, "Tests that afio::algorithm::shared_fs_mutex::safe_byte_ranges implementation implements exclusive locking with threads", [] { TestSharedFSMutexCorrectness(shared_memory::memory_map, shared_memory::exclusive, true); }())
-KERNELTEST_TEST_KERNEL(integration, afio, shared_fs_mutex_safe_byte_ranges_thread, shared, "Tests that afio::algorithm::shared_fs_mutex::safe_byte_ranges implementation implements shared locking with threads", [] { TestSharedFSMutexCorrectness(shared_memory::memory_map, shared_memory::shared, true); }())
-KERNELTEST_TEST_KERNEL(integration, afio, shared_fs_mutex_safe_byte_ranges_thread, both, "Tests that afio::algorithm::shared_fs_mutex::safe_byte_ranges implementation implements a mixture of exclusive and shared locking with threads",
+KERNELTEST_TEST_KERNEL(integration, llfio, shared_fs_mutex_safe_byte_ranges_thread, exclusives, "Tests that llfio::algorithm::shared_fs_mutex::safe_byte_ranges implementation implements exclusive locking with threads", [] { TestSharedFSMutexCorrectness(shared_memory::memory_map, shared_memory::exclusive, true); }())
+KERNELTEST_TEST_KERNEL(integration, llfio, shared_fs_mutex_safe_byte_ranges_thread, shared, "Tests that llfio::algorithm::shared_fs_mutex::safe_byte_ranges implementation implements shared locking with threads", [] { TestSharedFSMutexCorrectness(shared_memory::memory_map, shared_memory::shared, true); }())
+KERNELTEST_TEST_KERNEL(integration, llfio, shared_fs_mutex_safe_byte_ranges_thread, both, "Tests that llfio::algorithm::shared_fs_mutex::safe_byte_ranges implementation implements a mixture of exclusive and shared locking with threads",
[] { TestSharedFSMutexCorrectness(shared_memory::memory_map, shared_memory::both, true); }())
/*
@@ -509,11 +509,11 @@ and destructing the lock. This should find interesting races in the more complex
*/
static void TestSharedFSMutexConstructDestruct(shared_memory::mutex_kind_type mutex_kind)
{
- namespace afio = LLFIO_V2_NAMESPACE;
- auto shared_mem_file = afio::file_handle::file({}, "shared_memory", afio::file_handle::mode::write, afio::file_handle::creation::if_needed, afio::file_handle::caching::temporary, afio::file_handle::flag::unlink_on_first_close).value();
+ namespace llfio = LLFIO_V2_NAMESPACE;
+ auto shared_mem_file = llfio::file_handle::file({}, "shared_memory", llfio::file_handle::mode::write, llfio::file_handle::creation::if_needed, llfio::file_handle::caching::temporary, llfio::file_handle::flag::unlink_on_first_close).value();
shared_mem_file.truncate(sizeof(shared_memory)).value();
- auto shared_mem_file_section = afio::section_handle::section(shared_mem_file, sizeof(shared_memory), afio::section_handle::flag::readwrite).value();
- auto shared_mem_file_map = afio::map_handle::map(shared_mem_file_section).value();
+ auto shared_mem_file_section = llfio::section_handle::section(shared_mem_file, sizeof(shared_memory), llfio::section_handle::flag::readwrite).value();
+ auto shared_mem_file_map = llfio::map_handle::map(shared_mem_file_section).value();
auto *shmem = reinterpret_cast<shared_memory *>(shared_mem_file_map.address()); // NOLINT
shmem->current_shared = -2;
shmem->current_exclusive = -3;
@@ -548,33 +548,33 @@ static void TestSharedFSMutexConstructDestruct(shared_memory::mutex_kind_type mu
}
static auto TestSharedFSMutexConstructDestructChildWorker = KERNELTEST_V1_NAMESPACE::register_child_worker("TestSharedFSMutexConstructDestruct", [](KERNELTEST_V1_NAMESPACE::waitable_done & /*unused*/, size_t /*unused*/, const char *params) -> std::string { // NOLINT
- namespace afio = LLFIO_V2_NAMESPACE;
- std::unique_ptr<afio::algorithm::shared_fs_mutex::shared_fs_mutex> lock;
+ namespace llfio = LLFIO_V2_NAMESPACE;
+ std::unique_ptr<llfio::algorithm::shared_fs_mutex::shared_fs_mutex> lock;
auto mutex_kind = static_cast<shared_memory::mutex_kind_type>(atoi(params)); // NOLINT
switch(mutex_kind)
{
case shared_memory::mutex_kind_type::atomic_append:
- lock = std::make_unique<afio::algorithm::shared_fs_mutex::atomic_append>(afio::algorithm::shared_fs_mutex::atomic_append::fs_mutex_append({}, "lockfile").value());
+ lock = std::make_unique<llfio::algorithm::shared_fs_mutex::atomic_append>(llfio::algorithm::shared_fs_mutex::atomic_append::fs_mutex_append({}, "lockfile").value());
break;
case shared_memory::mutex_kind_type::byte_ranges:
- lock = std::make_unique<afio::algorithm::shared_fs_mutex::byte_ranges>(afio::algorithm::shared_fs_mutex::byte_ranges::fs_mutex_byte_ranges({}, "lockfile").value());
+ lock = std::make_unique<llfio::algorithm::shared_fs_mutex::byte_ranges>(llfio::algorithm::shared_fs_mutex::byte_ranges::fs_mutex_byte_ranges({}, "lockfile").value());
break;
case shared_memory::mutex_kind_type::safe_byte_ranges:
- lock = std::make_unique<afio::algorithm::shared_fs_mutex::safe_byte_ranges>(afio::algorithm::shared_fs_mutex::safe_byte_ranges::fs_mutex_safe_byte_ranges({}, "lockfile").value());
+ lock = std::make_unique<llfio::algorithm::shared_fs_mutex::safe_byte_ranges>(llfio::algorithm::shared_fs_mutex::safe_byte_ranges::fs_mutex_safe_byte_ranges({}, "lockfile").value());
break;
case shared_memory::mutex_kind_type::lock_files:
- lock = std::make_unique<afio::algorithm::shared_fs_mutex::lock_files>(afio::algorithm::shared_fs_mutex::lock_files::fs_mutex_lock_files(afio::path_handle::path(".").value()).value());
+ lock = std::make_unique<llfio::algorithm::shared_fs_mutex::lock_files>(llfio::algorithm::shared_fs_mutex::lock_files::fs_mutex_lock_files(llfio::path_handle::path(".").value()).value());
break;
case shared_memory::mutex_kind_type::memory_map:
- lock = std::make_unique<afio::algorithm::shared_fs_mutex::memory_map<>>(afio::algorithm::shared_fs_mutex::memory_map<>::fs_mutex_map({}, "lockfile").value());
+ lock = std::make_unique<llfio::algorithm::shared_fs_mutex::memory_map<>>(llfio::algorithm::shared_fs_mutex::memory_map<>::fs_mutex_map({}, "lockfile").value());
break;
}
// Take a shared lock of a different entity
- auto h = lock->lock(afio::algorithm::shared_fs_mutex::shared_fs_mutex::entity_type(1, false)).value();
+ auto h = lock->lock(llfio::algorithm::shared_fs_mutex::shared_fs_mutex::entity_type(1, false)).value();
return "ok";
});
-KERNELTEST_TEST_KERNEL(integration, afio, shared_fs_mutex_memory_map, construct_destruct, "Tests that afio::algorithm::shared_fs_mutex::memory_map constructor and destructor are race free", [] { TestSharedFSMutexConstructDestruct(shared_memory::memory_map); }())
+KERNELTEST_TEST_KERNEL(integration, llfio, shared_fs_mutex_memory_map, construct_destruct, "Tests that llfio::algorithm::shared_fs_mutex::memory_map constructor and destructor are race free", [] { TestSharedFSMutexConstructDestruct(shared_memory::memory_map); }())
/*
diff --git a/test/tests/trivial_vector.cpp b/test/tests/trivial_vector.cpp
index a2d166c3..6cc5c60f 100644
--- a/test/tests/trivial_vector.cpp
+++ b/test/tests/trivial_vector.cpp
@@ -179,7 +179,7 @@ static inline void BenchmarkTrivialVector1()
{
csv << times[n][0] << "," << times[n][1] << "," << times[n][2] << std::endl;
std::cout << " std::vector<udt> inserts " << printKb(times[n][0]) << " in " << times[n][1] << " microseconds" << std::endl;
- std::cout << "afio::algorithm::trivial_vector<udt> inserts " << printKb(times[n][0]) << " in " << times[n][2] << " microseconds" << std::endl;
+ std::cout << "llfio::algorithm::trivial_vector<udt> inserts " << printKb(times[n][0]) << " in " << times[n][2] << " microseconds" << std::endl;
}
}
@@ -239,10 +239,10 @@ static inline void BenchmarkTrivialVector2()
{
csv << times[n][0] << "," << times[n][1] << "," << times[n][2] << std::endl;
std::cout << " std::vector<udt> resizes " << printKb(times[n][0]) << " in " << times[n][1] << " microseconds" << std::endl;
- std::cout << "afio::algorithm::trivial_vector<udt> resizes " << printKb(times[n][0]) << " in " << times[n][2] << " microseconds" << std::endl;
+ std::cout << "llfio::algorithm::trivial_vector<udt> resizes " << printKb(times[n][0]) << " in " << times[n][2] << " microseconds" << std::endl;
}
}
-KERNELTEST_TEST_KERNEL(integration, afio, algorithm, trivial_vector, "Tests that afio::algorithm::trivial_vector works as expected", TestTrivialVector())
-KERNELTEST_TEST_KERNEL(integration, afio, algorithm, trivial_vector2, "Benchmarks afio::algorithm::trivial_vector against std::vector with push_back()", BenchmarkTrivialVector1())
-KERNELTEST_TEST_KERNEL(integration, afio, algorithm, trivial_vector3, "Benchmarks afio::algorithm::trivial_vector against std::vector with resize()", BenchmarkTrivialVector2())
+KERNELTEST_TEST_KERNEL(integration, llfio, algorithm, trivial_vector, "Tests that llfio::algorithm::trivial_vector works as expected", TestTrivialVector())
+KERNELTEST_TEST_KERNEL(integration, llfio, algorithm, trivial_vector2, "Benchmarks llfio::algorithm::trivial_vector against std::vector with push_back()", BenchmarkTrivialVector1())
+KERNELTEST_TEST_KERNEL(integration, llfio, algorithm, trivial_vector3, "Benchmarks llfio::algorithm::trivial_vector against std::vector with resize()", BenchmarkTrivialVector2())