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-08-16 11:38:26 +0300
committerNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2018-08-16 11:38:26 +0300
commitd39c3ba6c1510c6692db851288c12ec0d7b60e39 (patch)
tree2d04cab43e21bd8bdf750f2aaedf8f32ae2129dc
parentafab43f626a05e26304886984630c0fcbbb8210d (diff)
Revert inadvertent name change in attic files
-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
49 files changed, 420 insertions, 420 deletions
diff --git a/attic/doc/doxy/doxygen_input/pages/doxygen_mainpage.hpp b/attic/doc/doxy/doxygen_input/pages/doxygen_mainpage.hpp
index 88417b03..e406719a 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.llfio/ of use. It also includes a full reference manual.
+http://boostgsoc13.github.io/boost.afio/ of use. It also includes a full reference manual.
*/
diff --git a/attic/example/adopt_example.cpp b/attic/example/adopt_example.cpp
index d068c67c..b18e9827 100644
--- a/attic/example/adopt_example.cpp
+++ b/attic/example/adopt_example.cpp
@@ -1,11 +1,11 @@
-#include "llfio_pch.hpp"
+#include "afio_pch.hpp"
//[adopt_example
-struct test_handle : boost::llfio::handle
+struct test_handle : boost::afio::handle
{
- test_handle(boost::llfio::dispatcher *parent) :
- boost::llfio::handle(parent,
- boost::llfio::file_flags::none) {}
+ test_handle(boost::afio::dispatcher *parent) :
+ boost::afio::handle(parent,
+ boost::afio::file_flags::none) {}
virtual void close() override final
{
// Do nothing
@@ -18,30 +18,30 @@ struct test_handle : boost::llfio::handle
{
return nullptr;
}
- virtual boost::llfio::path path(bool refresh=false) override final
+ virtual boost::afio::path path(bool refresh=false) override final
{
- return boost::llfio::path();
+ return boost::afio::path();
}
- virtual boost::llfio::path path() const override final
+ virtual boost::afio::path path() const override final
{
- return boost::llfio::path();
+ return boost::afio::path();
}
- virtual boost::llfio::directory_entry direntry(boost::llfio::metadata_flags
- wanted=boost::llfio::directory_entry::metadata_fastpath()) override final
+ virtual boost::afio::directory_entry direntry(boost::afio::metadata_flags
+ wanted=boost::afio::directory_entry::metadata_fastpath()) override final
{
- return boost::llfio::directory_entry();
+ return boost::afio::directory_entry();
}
- virtual boost::llfio::path target() override final
+ virtual boost::afio::path target() override final
{
- return boost::llfio::path();
+ return boost::afio::path();
}
- virtual void link(const boost::llfio::path_req &req) override final
+ virtual void link(const boost::afio::path_req &req) override final
{
}
virtual void unlink() override final
{
}
- virtual void atomic_relink(const boost::llfio::path_req &req) override final
+ virtual void atomic_relink(const boost::afio::path_req &req) override final
{
}
};
@@ -49,7 +49,7 @@ struct test_handle : boost::llfio::handle
int main(void)
{
using namespace BOOST_AFIO_V2_NAMESPACE;
- auto dispatcher = boost::llfio::make_dispatcher().get();
+ auto dispatcher = boost::afio::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 72707cde..46a739f2 100644
--- a/attic/example/barrier_example.cpp
+++ b/attic/example/barrier_example.cpp
@@ -1,4 +1,4 @@
-#include "llfio_pch.hpp"
+#include "afio_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::llfio::dispatcher> dispatcher=
- boost::llfio::make_dispatcher().get();
+ std::shared_ptr<boost::afio::dispatcher> dispatcher=
+ boost::afio::make_dispatcher().get();
std::vector<std::pair<size_t, int>> groups;
- boost::llfio::atomic<size_t> callcount[10000];
+ boost::afio::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::llfio::atomic<size_t> *count){ (*count)++; };
+ auto inccount = [](boost::afio::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::llfio::atomic<size_t> *count, size_t shouldbe)
+ auto verifybarrier = [](boost::afio::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::llfio::future<> next;
+ boost::afio::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::llfio::future<>> thisgroupcallops;
+ std::vector<boost::afio::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::llfio::future<>> dependency(run.first, next);
+ std::vector<boost::afio::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 e7276bc5..45de6e45 100644
--- a/attic/example/benchmark_asio.cpp
+++ b/attic/example/benchmark_asio.cpp
@@ -1,10 +1,10 @@
-#include "llfio_pch.hpp"
+#include "afio_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::llfio::atomic<size_t> togo(0);
+static boost::afio::atomic<size_t> togo(0);
static int callback()
{
#if 0
@@ -15,7 +15,7 @@ static int callback()
};
int main(void)
{
- using namespace boost::llfio;
+ using namespace boost::afio;
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 5b6cd48a..ab046837 100644
--- a/attic/example/benchmark_atomic_log.cpp
+++ b/attic/example/benchmark_atomic_log.cpp
@@ -1,4 +1,4 @@
-#include "llfio_pch.hpp"
+#include "afio_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 3b5edcef..f40bf1c9 100644
--- a/attic/example/benchmark_chained1.cpp
+++ b/attic/example/benchmark_chained1.cpp
@@ -1,10 +1,10 @@
-#include "llfio_pch.hpp"
+#include "afio_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::llfio::handle>> _callback(size_t, boost::llfio::future<> op)
+static std::pair<bool, std::shared_ptr<boost::afio::handle>> _callback(size_t, boost::afio::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::llfio::handle>> _callback(size_t,
int main(void)
{
- using namespace boost::llfio;
+ using namespace boost::afio;
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 8e235836..d410076c 100644
--- a/attic/example/benchmark_chained2.cpp
+++ b/attic/example/benchmark_chained2.cpp
@@ -1,4 +1,4 @@
-#include "llfio_pch.hpp"
+#include "afio_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::llfio;
+ using namespace boost::afio;
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 df9970b0..f11422fd 100644
--- a/attic/example/benchmark_latency.cpp
+++ b/attic/example/benchmark_latency.cpp
@@ -1,4 +1,4 @@
-#include "llfio_pch.hpp"
+#include "afio_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::llfio::chrono::high_resolution_clock::now()) time_point;
+typedef decltype(boost::afio::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::llfio::handle>> _callback(size_t id, boost::llfio::future<> op)
+static std::pair<bool, std::shared_ptr<boost::afio::handle>> _callback(size_t id, boost::afio::future<> op)
{
- using namespace boost::llfio;
+ using namespace boost::afio;
points[id-id_offset]=chrono::high_resolution_clock::now();
return std::make_pair(true, op.get_handle());
};
int main(void)
{
- using namespace boost::llfio;
+ using namespace boost::afio;
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("llfio_latencies.csv");
+ std::ofstream csv("afio_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 e5318a98..2f9b6769 100644
--- a/attic/example/benchmark_unchained1.cpp
+++ b/attic/example/benchmark_unchained1.cpp
@@ -1,10 +1,10 @@
-#include "llfio_pch.hpp"
+#include "afio_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::llfio::handle>> callback(size_t, boost::llfio::future<> op)
+static std::pair<bool, std::shared_ptr<boost::afio::handle>> callback(size_t, boost::afio::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::llfio::handle>> callback(size_t, b
int main(void)
{
- using namespace boost::llfio;
+ using namespace boost::afio;
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 d8471ab3..db9affe0 100644
--- a/attic/example/benchmark_unchained2.cpp
+++ b/attic/example/benchmark_unchained2.cpp
@@ -1,4 +1,4 @@
-#include "llfio_pch.hpp"
+#include "afio_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::llfio;
+ using namespace boost::afio;
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 5bfc331b..d4a72642 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 "llfio_pch.hpp"
+#include "afio_pch.hpp"
int main(void)
{
//[call_example
// Create a dispatcher instance
- auto dispatcher=boost::llfio::make_dispatcher().get();
+ auto dispatcher=boost::afio::make_dispatcher().get();
// Schedule an asynchronous call of some function with some bound set of arguments
- auto helloworld=dispatcher->call(boost::llfio::future<>() /* no precondition */, [](std::string text) -> int {
+ auto helloworld=dispatcher->call(boost::afio::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 fc5d80b3..96ac4808 100644
--- a/attic/example/closure_execution_afio_io_example.cpp
+++ b/attic/example/closure_execution_afio_io_example.cpp
@@ -1,6 +1,6 @@
-#include "llfio_pch.hpp"
+#include "afio_pch.hpp"
-//[closure_execution_llfio_example
+//[closure_execution_afio_example
#include <vector>
int main()
@@ -16,22 +16,22 @@ int main()
out_file.close();
- //set up the llfio dispatcher
- auto dispatcher = boost::llfio::make_dispatcher().get();
+ //set up the afio dispatcher
+ auto dispatcher = boost::afio::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::llfio::path_req("somefile.dat",
- boost::llfio::file_flags::read));
+ auto opened_file = dispatcher->file(boost::afio::path_req("somefile.dat",
+ boost::afio::file_flags::read));
//set up vectors for the individual read operations, and the work on each integer
- std::vector<boost::llfio::future<>> read_ops(ary_size);
+ std::vector<boost::afio::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::llfio::io_req<int>(opened_file,
+ read_ops[i] = dispatcher->read(boost::afio::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::llfio::when_all_p(work.begin(), work.end()).wait();
+ boost::afio::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 f36f3c3f..62483edc 100644
--- a/attic/example/closure_execution_traditional_io_example.cpp
+++ b/attic/example/closure_execution_traditional_io_example.cpp
@@ -1,4 +1,4 @@
-#include "llfio_pch.hpp"
+#include "afio_pch.hpp"
//[closure_execution_traditional_example
#include <iostream>
diff --git a/attic/example/completion_example1.cpp b/attic/example/completion_example1.cpp
index 533a53d4..706a5e44 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 "llfio_pch.hpp"
+#include "afio_pch.hpp"
int main(void)
{
//[completion_example1
// Create a dispatcher instance
- std::shared_ptr<boost::llfio::dispatcher> dispatcher=
- boost::llfio::make_dispatcher().get();
+ std::shared_ptr<boost::afio::dispatcher> dispatcher=
+ boost::afio::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::llfio::future<> precondition,
+ size_t id, boost::afio::future<> precondition,
/* From now on user defined parameters */
std::string text)
/* This is always the return type */
- -> std::pair<bool, std::shared_ptr<boost::llfio::handle>>
+ -> std::pair<bool, std::shared_ptr<boost::afio::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::llfio::dispatcher::completion_t
- std::function<boost::llfio::dispatcher::completion_t> boundf=
+ // Bind any user defined parameters to create a proper boost::afio::dispatcher::completion_t
+ std::function<boost::afio::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::llfio::future<> helloworld=
- dispatcher->completion(boost::llfio::future<>() /* no precondition */,
- std::make_pair(boost::llfio::async_op_flags::none, boundf));
+ boost::afio::future<> helloworld=
+ dispatcher->completion(boost::afio::future<>() /* no precondition */,
+ std::make_pair(boost::afio::async_op_flags::none, boundf));
// Create a boost::stl_future<> representing the ops passed to when_all_p()
- boost::llfio::stl_future<std::vector<std::shared_ptr<boost::llfio::handle>>> stl_future
- =boost::llfio::when_all_p(helloworld);
+ boost::afio::stl_future<std::vector<std::shared_ptr<boost::afio::handle>>> stl_future
+ =boost::afio::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 0e10a976..513eea77 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 "llfio_pch.hpp"
+#include "afio_pch.hpp"
int main(void)
{
//[completion_example2
// Create a dispatcher instance
- std::shared_ptr<boost::llfio::dispatcher> dispatcher=
- boost::llfio::make_dispatcher().get();
+ std::shared_ptr<boost::afio::dispatcher> dispatcher=
+ boost::afio::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::llfio::dispatcher> dispatcher,
+ auto completion=[](std::shared_ptr<boost::afio::dispatcher> dispatcher,
/* These are always the standard parameters */
- size_t id, boost::llfio::future<> precondition)
+ size_t id, boost::afio::future<> precondition)
/* This is always the return type */
- -> std::pair<bool, std::shared_ptr<boost::llfio::handle>>
+ -> std::pair<bool, std::shared_ptr<boost::afio::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::llfio::dispatcher> dispatcher,
- size_t id, boost::llfio::future<> op) -> int
+ auto completer=[](std::shared_ptr<boost::afio::dispatcher> dispatcher,
+ size_t id, boost::afio::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::llfio::exception_ptr e(boost::llfio::current_exception());
+ boost::afio::exception_ptr e(boost::afio::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::llfio::dispatcher::completion_t
- std::function<boost::llfio::dispatcher::completion_t> boundf=
+ // Bind any user defined parameters to create a proper boost::afio::dispatcher::completion_t
+ std::function<boost::afio::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::llfio::future<> op=
- dispatcher->completion(boost::llfio::future<>() /* no precondition */,
+ boost::afio::future<> op=
+ dispatcher->completion(boost::afio::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::llfio::async_op_flags::immediate,
+ boost::afio::async_op_flags::immediate,
boundf));
// Create a boost::stl_future<> representing the ops passed to when_all_p()
- boost::llfio::stl_future<std::vector<std::shared_ptr<boost::llfio::handle>>> stl_future
- =boost::llfio::when_all_p(op);
+ boost::afio::stl_future<std::vector<std::shared_ptr<boost::afio::handle>>> stl_future
+ =boost::afio::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 7b9db1db..667b3f36 100644
--- a/attic/example/determine_legal_filenames.cpp
+++ b/attic/example/determine_legal_filenames.cpp
@@ -1,9 +1,9 @@
-#include "llfio_pch.hpp"
+#include "afio_pch.hpp"
int main(void)
{
- using namespace boost::llfio;
- auto dispatcher=boost::llfio::make_dispatcher().get();
+ using namespace boost::afio;
+ auto dispatcher=boost::afio::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::llfio::file_flags::create)));
+ auto mkfile(dispatcher->file(path_req::relative(mkdir, p, boost::afio::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 9f69dfe6..35bac7a5 100644
--- a/attic/example/enumerate_example.cpp
+++ b/attic/example/enumerate_example.cpp
@@ -1,27 +1,27 @@
-#include "llfio_pch.hpp"
+#include "afio_pch.hpp"
int main(void)
{
//[enumerate_example
- boost::llfio::current_dispatcher_guard h(boost::llfio::make_dispatcher().get());
+ boost::afio::current_dispatcher_guard h(boost::afio::make_dispatcher().get());
// Schedule an opening of the root directory
- boost::llfio::future<> rootdir(boost::llfio::async_dir("/"));
+ boost::afio::future<> rootdir(boost::afio::async_dir("/"));
- std::pair<std::vector<boost::llfio::directory_entry>, bool> list;
+ std::pair<std::vector<boost::afio::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::llfio::future<std::pair<std::vector<boost::llfio::directory_entry>, bool>>
- enumeration(boost::llfio::async_enumerate(rootdir,
+ boost::afio::future<std::pair<std::vector<boost::afio::directory_entry>, bool>>
+ enumeration(boost::afio::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::llfio::directory_entry::compatibility_maximum(),
+ boost::afio::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::llfio::directory_entry &i : list.first)
+ for(boost::afio::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 a66247cc..e48a9c36 100644
--- a/attic/example/filecopy_example.cpp
+++ b/attic/example/filecopy_example.cpp
@@ -1,4 +1,4 @@
-#include "llfio_pch.hpp"
+#include "afio_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::llfio;
- using boost::llfio::off_t;
+ using namespace boost::afio;
+ using boost::afio::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::llfio::filesystem::path dest, std::vector<boost::llfio::filesystem::path> sources,
+ boost::afio::filesystem::path dest, std::vector<boost::afio::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::llfio;
- using boost::llfio::off_t;
+ using namespace boost::afio;
+ using boost::afio::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::llfio::dispatcher> dispatcher=
- boost::llfio::make_dispatcher().get();
+ std::shared_ptr<boost::afio::dispatcher> dispatcher=
+ boost::afio::make_dispatcher().get();
// Set a dispatcher as current for this thread
- boost::llfio::current_dispatcher_guard guard(dispatcher);
+ boost::afio::current_dispatcher_guard guard(dispatcher);
- boost::llfio::filesystem::path dest=argv[1];
- std::vector<boost::llfio::filesystem::path> sources;
+ boost::afio::filesystem::path dest=argv[1];
+ std::vector<boost::afio::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::llfio::chrono::seconds(1)))
+ while(future_status::timeout==h.wait_for(boost::afio::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 7aec48bb..45439ed5 100644
--- a/attic/example/filedir_example.cpp
+++ b/attic/example/filedir_example.cpp
@@ -1,24 +1,24 @@
-#include "llfio_pch.hpp"
+#include "afio_pch.hpp"
int main(void)
{
//[filedir_example
using namespace BOOST_AFIO_V2_NAMESPACE;
using BOOST_AFIO_V2_NAMESPACE::rmdir;
- std::shared_ptr<boost::llfio::dispatcher> dispatcher =
- boost::llfio::make_dispatcher().get();
+ std::shared_ptr<boost::afio::dispatcher> dispatcher =
+ boost::afio::make_dispatcher().get();
current_dispatcher_guard h(dispatcher);
// Free function
try
{
// Schedule creating a directory called testdir
- auto mkdir(async_dir("testdir", boost::llfio::file_flags::create));
+ auto mkdir(async_dir("testdir", boost::afio::file_flags::create));
// Schedule creating a file called testfile in testdir only when testdir has been created
- auto mkfile(async_file(mkdir, "testfile", boost::llfio::file_flags::create));
+ auto mkfile(async_file(mkdir, "testfile", boost::afio::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::llfio::file_flags::create));
+ auto mklink(async_symlink(mkdir, "linktodir", mkdir, boost::afio::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::llfio::when_all_p(mkdir, mkfile, mklink, rmlink, rmfile, rmdir).wait();
+ boost::afio::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::llfio::path_req>(1,
- boost::llfio::path_req("testdir", boost::llfio::file_flags::create))).front());
+ auto mkdir(dispatcher->dir(std::vector<boost::afio::path_req>(1,
+ boost::afio::path_req("testdir", boost::afio::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::llfio::path_req>(1,
- boost::llfio::path_req::relative(mkdir, "testfile",
- boost::llfio::file_flags::create))).front());
+ auto mkfile(dispatcher->file(std::vector<boost::afio::path_req>(1,
+ boost::afio::path_req::relative(mkdir, "testfile",
+ boost::afio::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::llfio::path_req>(1,
- boost::llfio::path_req::absolute(mkdir, "testdir/linktodir",
- boost::llfio::file_flags::create))).front());
+ 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());
// 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::llfio::when_all_p(mkdir, mkfile, mklink, rmlink, rmfile, rmdir).wait();
+ boost::afio::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 5e6d9524..464f47e8 100644
--- a/attic/example/filter_example.cpp
+++ b/attic/example/filter_example.cpp
@@ -1,7 +1,7 @@
-#include "llfio_pch.hpp"
+#include "afio_pch.hpp"
//[filter_example
-using namespace boost::llfio;
+using namespace boost::afio;
// 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::llfio::off_t offset, size_t buffer_idx,
+ const detail::io_req_impl<true> &req, boost::afio::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 875219ec..a1427fd2 100644
--- a/attic/example/find_in_files_afio.cpp
+++ b/attic/example/find_in_files_afio.cpp
@@ -1,4 +1,4 @@
-#include "llfio_pch.hpp"
+#include "afio_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/llfio/test/Aligned_Allocator.hpp"
+#include "boost/../libs/afio/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_llfio
-using namespace boost::llfio;
+//[find_in_files_afio
+using namespace boost::afio;
// 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::llfio::filesystem::path, size_t>> filepaths;
+ std::vector<std::pair<boost::afio::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::llfio::filesystem::file_type::directory_file)
+ boost::afio::filesystem::file_type::directory_file)
#else
- boost::llfio::filesystem::file_type::directory)
+ boost::afio::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::llfio::filesystem::file_type::regular_file)
+ boost::afio::filesystem::file_type::regular_file)
#else
- boost::llfio::filesystem::file_type::regular)
+ boost::afio::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::llfio;
+ using namespace boost::afio;
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 5868d94e..0114ec57 100644
--- a/attic/example/find_in_files_iostreams.cpp
+++ b/attic/example/find_in_files_iostreams.cpp
@@ -1,4 +1,4 @@
-#include "llfio_pch.hpp"
+#include "afio_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::llfio::filesystem;
+ namespace filesystem = boost::afio::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 d0f2f816..c7882c88 100644
--- a/attic/example/readallof_example.cpp
+++ b/attic/example/readallof_example.cpp
@@ -1,8 +1,8 @@
-#include "llfio_pch.hpp"
+#include "afio_pch.hpp"
int main(void)
{
- using namespace boost::llfio;
+ using namespace boost::afio;
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 575dcaa2..5a94c561 100644
--- a/attic/example/readwrite_example.cpp
+++ b/attic/example/readwrite_example.cpp
@@ -1,19 +1,19 @@
-#include "llfio_pch.hpp"
+#include "afio_pch.hpp"
int main(void)
{
try
{
//[readwrite_example
- namespace llfio = BOOST_AFIO_V2_NAMESPACE;
+ namespace afio = BOOST_AFIO_V2_NAMESPACE;
namespace asio = BOOST_AFIO_V2_NAMESPACE::asio;
// Set a dispatcher as current for this thread
- llfio::current_dispatcher_guard h(llfio::make_dispatcher().get());
+ afio::current_dispatcher_guard h(afio::make_dispatcher().get());
// Schedule an opening of a file called example_file.txt
- llfio::future<> openfile = llfio::async_file("example_file.txt",
- llfio::file_flags::create | llfio::file_flags::read_write);
+ afio::future<> openfile = afio::async_file("example_file.txt",
+ afio::file_flags::create | afio::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:
- llfio::future<> resizedfile = llfio::async_truncate(openfile, 12);
+ afio::future<> resizedfile = afio::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
- llfio::future<> written(llfio::async_write(resizedfile, buffers, 0));
+ afio::future<> written(afio::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
- llfio::future<> written2(llfio::async_write(written, buffers2, 0));
+ afio::future<> written2(afio::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
- llfio::future<> stored(llfio::async_sync(written2));
+ afio::future<> stored(afio::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;
- llfio::future<> read(llfio::async_read(stored, buffer, 0));
+ afio::future<> read(afio::async_read(stored, buffer, 0));
// Schedule the closing and deleting of example_file.txt after the contents read
- llfio::future<> deletedfile(llfio::async_rmfile(llfio::async_close(read)));
+ afio::future<> deletedfile(afio::async_rmfile(afio::async_close(read)));
// Wait until the buffer has been filled, checking all steps for errors
- 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 >*/
+ 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 >*/
// 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 e350dbea..56f82113 100644
--- a/attic/example/readwrite_example_traditional.cpp
+++ b/attic/example/readwrite_example_traditional.cpp
@@ -1,4 +1,4 @@
-#include "llfio_pch.hpp"
+#include "afio_pch.hpp"
int main(void)
{
@@ -31,7 +31,7 @@ int main(void)
// Close the file and delete it
openfile.close(); /*< closes file >*/
- boost::llfio::filesystem::remove("example_file.txt"); /*< deletes file >*/
+ boost::afio::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 5347ab7b..122c07e0 100644
--- a/attic/example/statfs_example.cpp
+++ b/attic/example/statfs_example.cpp
@@ -1,16 +1,16 @@
-#include "llfio_pch.hpp"
+#include "afio_pch.hpp"
int main(void)
{
//[statfs_example
- boost::llfio::current_dispatcher_guard h(boost::llfio::make_dispatcher().get());
+ boost::afio::current_dispatcher_guard h(boost::afio::make_dispatcher().get());
// Open the root directory
- boost::llfio::handle_ptr rootdir(boost::llfio::dir("/"));
+ boost::afio::handle_ptr rootdir(boost::afio::dir("/"));
// Ask the filing system of the root directory how much free space there is
- boost::llfio::statfs_t statfs(boost::llfio::statfs(rootdir,
- boost::llfio::fs_metadata_flags::bsize|boost::llfio::fs_metadata_flags::bfree));
+ boost::afio::statfs_t statfs(boost::afio::statfs(rootdir,
+ boost::afio::fs_metadata_flags::bsize|boost::afio::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 72927468..f36ea1c5 100644
--- a/attic/example/workshop_atomic_updates_afio.cpp
+++ b/attic/example/workshop_atomic_updates_afio.cpp
@@ -1,2 +1,2 @@
-#include "llfio_pch.hpp"
-#include "workshop_atomic_updates_llfio.ipp"
+#include "afio_pch.hpp"
+#include "workshop_atomic_updates_afio.ipp"
diff --git a/attic/example/workshop_atomic_updates_afio.ipp b/attic/example/workshop_atomic_updates_afio.ipp
index bc703dff..c4daafe4 100644
--- a/attic/example/workshop_atomic_updates_afio.ipp
+++ b/attic/example/workshop_atomic_updates_afio.ipp
@@ -1,12 +1,12 @@
-//[workshop_atomic_updates_llfio_interface
-namespace llfio = BOOST_AFIO_V2_NAMESPACE;
+//[workshop_atomic_updates_afio_interface
+namespace afio = BOOST_AFIO_V2_NAMESPACE;
namespace filesystem = BOOST_AFIO_V2_NAMESPACE::filesystem;
using BOOST_OUTCOME_V1_NAMESPACE::lightweight_futures::shared_future;
class data_store
{
- llfio::dispatcher_ptr _dispatcher;
- llfio::handle_ptr _store;
+ afio::dispatcher_ptr _dispatcher;
+ afio::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, llfio::path path = "store");
+ data_store(size_t flags = 0, afio::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_llfio3]
+//[workshop_atomic_updates_afio3]
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, llfio::utils::page_allocator<char>>;
+using file_buffer_type = std::vector<char, afio::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
{
- llfio::handle_ptr h; // Holds the file open
+ afio::handle_ptr h; // Holds the file open
std::shared_ptr<file_buffer_type> buffer;
- llfio::handle::mapped_file_ptr mfp;
+ afio::handle::mapped_file_ptr mfp;
// From a mmap
- directstreambuf(llfio::handle_ptr _h, llfio::handle::mapped_file_ptr _mfp, size_t length) : h(std::move(_h)), mfp(std::move(_mfp))
+ directstreambuf(afio::handle_ptr _h, afio::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(llfio::handle_ptr _h, std::shared_ptr<file_buffer_type> _buffer, size_t length) : h(std::move(_h)), buffer(std::move(_buffer))
+ directstreambuf(afio::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(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()))
+ 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()))
{
}
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;
- llfio::future<> lastwrite; // the last async write performed
- llfio::off_t offset; // offset of next write
+ afio::future<> lastwrite; // the last async write performed
+ afio::off_t offset; // offset of next write
file_buffer_type buffer; // a page size on this machine
file_buffer_type lastbuffer;
- directstreambuf(llfio::handle_ptr _h) : lastwrite(std::move(_h)), offset(0), buffer(llfio::utils::page_sizes().front())
+ directstreambuf(afio::handle_ptr _h) : lastwrite(std::move(_h)), offset(0), buffer(afio::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 = llfio::async_write(llfio::async_truncate(lastwrite, offset+thisbuffer), buffer.data(), thisbuffer, offset);
+ lastwrite = afio::async_write(afio::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(llfio::path_req::relative(dirh, "0"));
+ lastwrite->atomic_relink(afio::path_req::relative(dirh, "0"));
#ifdef __linux__
- // Journalled Linux filing systems don't need this, but if you enabled llfio::file_flags::always_sync
+ // Journalled Linux filing systems don't need this, but if you enabled afio::file_flags::always_sync
// you might want to issue this too.
- llfio::sync(dirh);
+ afio::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 = llfio::async_truncate(lastwrite, offset + thisbuffer);
+ lastwrite = afio::async_truncate(lastwrite, offset + thisbuffer);
// Schedule an asynchronous write of the buffer to storage
- lastwrite=llfio::async_write(lastwrite, lastbuffer.data(), thisbuffer, offset);
+ lastwrite=afio::async_write(lastwrite, lastbuffer.data(), thisbuffer, offset);
offset+=thisbuffer;
}
return 0;
}
};
std::unique_ptr<directstreambuf> buf;
- odirectstream(llfio::handle_ptr h) : std::ostream(new directstreambuf(std::move(h))), buf(static_cast<directstreambuf *>(rdbuf()))
+ odirectstream(afio::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_llfio1]
+//[workshop_atomic_updates_afio1]
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]=llfio::utils::random_string(16); // 128 bits
+ names[n]=afio::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, llfio::path path)
+data_store::data_store(size_t flags, afio::path path)
{
// Make a dispatcher for the local filesystem URI, masking out write flags on all operations if not writeable
- _dispatcher=llfio::make_dispatcher("file:///", llfio::file_flags::none, !(flags & writeable) ? llfio::file_flags::write : llfio::file_flags::none).get();
+ _dispatcher=afio::make_dispatcher("file:///", afio::file_flags::none, !(flags & writeable) ? afio::file_flags::write : afio::file_flags::none).get();
// Set the dispatcher for this thread, and open a handle to the store directory
- llfio::current_dispatcher_guard h(_dispatcher);
- _store=llfio::dir(std::move(path), llfio::file_flags::create); // throws if there was an error
+ afio::current_dispatcher_guard h(_dispatcher);
+ _store=afio::dir(std::move(path), afio::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
- llfio::future<> h(llfio::async_file(_store, name, llfio::file_flags::read));
+ afio::future<> h(afio::async_file(_store, name, afio::file_flags::read));
// When it completes, call this continuation
- return h.then([](llfio::future<> &_h) -> shared_future<data_store::istream> {
+ return h.then([](afio::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(llfio::metadata_flags::size).st_size;
+ size_t length=(size_t) _h->lstat(afio::metadata_flags::size).st_size;
// Is a memory map more appropriate?
if(length>=128*1024)
{
- llfio::handle::mapped_file_ptr mfp;
+ afio::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);
- llfio::future<> h(llfio::async_read(_h, buffer->data(), length, 0));
+ afio::future<> h(afio::async_read(_h, buffer->data(), length, 0));
// When the read completes call this continuation
- return h.then([buffer, length](const llfio::future<> &h) -> shared_future<data_store::istream> {
+ return h.then([buffer, length](const afio::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_llfio2]
+//[workshop_atomic_updates_afio2]
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
- llfio::future<> dirh(llfio::async_dir(_store, name, llfio::file_flags::create));
+ afio::future<> dirh(afio::async_dir(_store, name, afio::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 llfio::future<> &h) { async_sync(_store); });
+ dirh.then([this](const afio::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
- 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
+ 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
));
// When it completes, call this continuation
- return h.then([](const llfio::future<> &h) -> shared_future<data_store::ostream> {
+ return h.then([](const afio::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 08ca2f3b..e3f2d58d 100644
--- a/attic/example/workshop_benchmark.cpp
+++ b/attic/example/workshop_benchmark.cpp
@@ -1,4 +1,4 @@
-#include "llfio_pch.hpp"
+#include "afio_pch.hpp"
#ifdef _DEBUG
#define ITEMS 64
@@ -11,13 +11,13 @@ namespace iostreams {
#include "workshop_naive.ipp"
}
namespace naive {
-#include "workshop_naive_llfio.ipp"
+#include "workshop_naive_afio.ipp"
}
namespace atomic_updates {
-#include "workshop_atomic_updates_llfio.ipp"
+#include "workshop_atomic_updates_afio.ipp"
}
namespace final {
-#include "workshop_final_llfio.ipp"
+#include "workshop_final_afio.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>("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);
+ //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);
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 62f51ed6..c3fcceb9 100644
--- a/attic/example/workshop_final_afio.cpp
+++ b/attic/example/workshop_final_afio.cpp
@@ -1,2 +1,2 @@
-#include "llfio_pch.hpp"
-#include "workshop_final_llfio.ipp"
+#include "afio_pch.hpp"
+#include "workshop_final_afio.ipp"
diff --git a/attic/example/workshop_final_afio.ipp b/attic/example/workshop_final_afio.ipp
index c1a4e98e..655b8367 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 llfio = BOOST_AFIO_V2_NAMESPACE;
+namespace afio = 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;
- llfio::dispatcher_ptr _dispatcher;
+ afio::dispatcher_ptr _dispatcher;
// The small blob store keeps non-memory mappable blobs at 32 byte alignments
- llfio::handle_ptr _small_blob_store, _small_blob_store_append, _small_blob_store_ecc;
+ afio::handle_ptr _small_blob_store, _small_blob_store_append, _small_blob_store_ecc;
// The large blob store keeps memory mappable blobs at 4Kb alignments
- llfio::handle_ptr _large_blob_store, _large_blob_store_append, _large_blob_store_ecc;
+ afio::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
- llfio::handle_ptr _index_store, _index_store_append, _index_store_ecc;
+ afio::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, llfio::path path = "store");
+ data_store(size_t flags = 0, afio::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, llfio::utils::page_allocator<char>>;
+using file_buffer_type = std::vector<char, afio::utils::page_allocator<char>>;
// Serialisation helper types
#pragma pack(push, 1)
@@ -57,18 +57,18 @@ struct ondisk_file_header // 20 bytes
{
union
{
- llfio::off_t length; // Always 32 in byte order of whoever wrote this
+ afio::off_t length; // Always 32 in byte order of whoever wrote this
char endian[8];
};
- llfio::off_t index_offset_begin; // Hint to the length of the store when the index was last written
+ afio::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
{
- 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)
+ 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)
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
{
- llfio::off_t thisoffset; // this index only valid if equals this offset
+ afio::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
{
- llfio::off_t offset; // offset to this region
+ afio::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;
- llfio::off_t offset, length;
+ afio::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; }
};
- llfio::off_t offset_loaded_from; // Offset this index was loaded from
+ afio::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
{
- llfio::off_t offset;
+ afio::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(llfio::handle_ptr h) noexcept
+ outcome<last_good_ondisk_index_info> find_last_good_ondisk_index(afio::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;
- llfio::read(h, header, 0);
- llfio::off_t offset=0;
+ afio::read(h, header, 0);
+ afio::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(llfio::extents(h));
+ auto valid_extents(afio::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
{
- llfio::off_t linear_scanning=0;
+ afio::off_t linear_scanning=0;
ondisk_record_header record;
- llfio::off_t file_length=h->lstat(llfio::metadata_flags::size).st_size;
+ afio::off_t file_length=h->lstat(afio::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=llfio::extents(h);
+ valid_extents=afio::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;
- llfio::read(ec, h, record, offset);
+ afio::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;
- llfio::write(ec, h, temp, linear_scanning);
+ afio::write(ec, h, temp, linear_scanning);
// Deallocate the physical storage for the invalid section
- llfio::zero(ec, h, {{linear_scanning+12, offset-linear_scanning-12}});
+ afio::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;
}
- llfio::read(ec, h, buffer.get(), (size_t) record.length-sizeof(header), offset+sizeof(header));
+ afio::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(llfio::handle_ptr h) noexcept
+ outcome<void> load(afio::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(llfio::handle_ptr rwh, llfio::handle_ptr appendh) noexcept
+ outcome<void> store(afio::handle_ptr rwh, afio::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(llfio::metadata_flags::size).st_size;
+ h.header2.thisoffset=appendh->lstat(afio::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
- llfio::write(ec, appendh, buffers, 0);
+ afio::write(ec, appendh, buffers, 0);
if(ec) return ec;
// Reread the record
- llfio::read(ec, rwh, reread.data(), reread.size(), h.header2.thisoffset);
+ afio::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;
- llfio::read(ec, rwh, file_header, 0);
+ afio::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++;
- llfio::write(ec, rwh, file_header, 0);
+ afio::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(llfio::handle_ptr h) noexcept
+ outcome<void> refresh(afio::handle_ptr h) noexcept
{
- static llfio::off_t last_size;
+ static afio::off_t last_size;
error_code ec;
- llfio::off_t size=h->lstat(llfio::metadata_flags::size).st_size;
+ afio::off_t size=h->lstat(afio::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;
- llfio::read(ec, h, header, 0);
+ afio::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, llfio::utils::page_allocator<char>>;
+using file_buffer_type = std::vector<char, afio::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
{
- llfio::handle_ptr h; // Holds the file open
+ afio::handle_ptr h; // Holds the file open
std::shared_ptr<file_buffer_type> buffer;
// From a mmap
- directstreambuf(llfio::handle_ptr _h, char *addr, size_t length) : h(std::move(_h))
+ directstreambuf(afio::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(llfio::handle_ptr _h, std::shared_ptr<file_buffer_type> _buffer, size_t length) : h(std::move(_h)), buffer(std::move(_buffer))
+ directstreambuf(afio::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(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()))
+ 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()))
{
}
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(llfio::utils::page_sizes().front())
+ ostreambuf(data_store *_ds, std::string _name) : ds(_ds), name(std::move(_name)), buffer(afio::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(llfio::metadata_flags::size).st_size;
- llfio::write(ec, ds->_small_blob_store_append, buffers, 0);
+ auto offset=ds->_small_blob_store_append->lstat(afio::metadata_flags::size).st_size;
+ afio::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
{
- llfio::read(ec, ds->_small_blob_store_append, header, offset);
+ afio::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(llfio::metadata_flags::size).st_size);
+ } while(offset<ds->_small_blob_store_append->lstat(afio::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, llfio::path path)
+data_store::data_store(size_t flags, afio::path path)
{
// Make a dispatcher for the local filesystem URI, masking out write flags on all operations if not writeable
- _dispatcher=llfio::make_dispatcher("file:///", llfio::file_flags::none, !(flags & writeable) ? llfio::file_flags::write : llfio::file_flags::none).get();
+ _dispatcher=afio::make_dispatcher("file:///", afio::file_flags::none, !(flags & writeable) ? afio::file_flags::write : afio::file_flags::none).get();
// Set the dispatcher for this thread, and create/open a handle to the store directory
- llfio::current_dispatcher_guard h(_dispatcher);
- auto dirh(llfio::dir(std::move(path), llfio::file_flags::create)); // throws if there was an error
+ afio::current_dispatcher_guard h(_dispatcher);
+ auto dirh(afio::dir(std::move(path), afio::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=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
+ _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
// 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=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
+ _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
// Is this store just created?
- if(!_index_store_append->lstat(llfio::metadata_flags::size).st_size)
+ if(!_index_store_append->lstat(afio::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
- llfio::write(_index_store_append, header, 0);
+ afio::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];
- llfio::off_t offset=r.offset+24, length=r.length-24;
+ afio::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);
- llfio::future<> h(llfio::async_read(_small_blob_store, buffer->data(), (size_t) length, offset));
+ afio::future<> h(afio::async_read(_small_blob_store, buffer->data(), (size_t) length, offset));
// When the read completes call this continuation
- return h.then([buffer, length](const llfio::future<> &h) -> shared_future<data_store::istream> {
+ return h.then([buffer, length](const afio::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 f97592f0..225d09b7 100644
--- a/attic/example/workshop_naive.cpp
+++ b/attic/example/workshop_naive.cpp
@@ -1,2 +1,2 @@
-#include "llfio_pch.hpp"
+#include "afio_pch.hpp"
#include "workshop_naive.ipp"
diff --git a/attic/example/workshop_naive_afio.cpp b/attic/example/workshop_naive_afio.cpp
index f4af5eb7..a807b6c8 100644
--- a/attic/example/workshop_naive_afio.cpp
+++ b/attic/example/workshop_naive_afio.cpp
@@ -1,2 +1,2 @@
-#include "llfio_pch.hpp"
-#include "workshop_naive_llfio.ipp"
+#include "afio_pch.hpp"
+#include "workshop_naive_afio.ipp"
diff --git a/attic/example/workshop_naive_afio.ipp b/attic/example/workshop_naive_afio.ipp
index 019fe44c..6100ed96 100644
--- a/attic/example/workshop_naive_afio.ipp
+++ b/attic/example/workshop_naive_afio.ipp
@@ -1,12 +1,12 @@
-//[workshop_naive_llfio_interface
-namespace llfio = BOOST_AFIO_V2_NAMESPACE;
+//[workshop_naive_afio_interface
+namespace afio = BOOST_AFIO_V2_NAMESPACE;
namespace filesystem = BOOST_AFIO_V2_NAMESPACE::filesystem;
using BOOST_OUTCOME_V1_NAMESPACE::outcome;
class data_store
{
- llfio::dispatcher_ptr _dispatcher;
- llfio::handle_ptr _store;
+ afio::dispatcher_ptr _dispatcher;
+ afio::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, llfio::path path = "store");
+ data_store(size_t flags = 0, afio::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_llfio2]
+//[workshop_naive_afio2]
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, llfio::utils::page_allocator<char>>;
+using file_buffer_type = std::vector<char, afio::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
{
- llfio::handle_ptr h; // Holds the file open and therefore mapped
+ afio::handle_ptr h; // Holds the file open and therefore mapped
file_buffer_type buffer;
- llfio::handle::mapped_file_ptr mfp;
- directstreambuf(error_code &ec, llfio::handle_ptr _h) : h(std::move(_h))
+ afio::handle::mapped_file_ptr mfp;
+ directstreambuf(error_code &ec, afio::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(llfio::metadata_flags::size).st_size;
+ size_t length=(size_t) h->lstat(afio::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);
- llfio::read(ec, h, buffer.data(), length, 0);
+ afio::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, llfio::handle_ptr h) : std::istream(new directstreambuf(ec, std::move(h))), buf(static_cast<directstreambuf *>(rdbuf()))
+ idirectstream(error_code &ec, afio::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;
- llfio::future<> lastwrite; // the last async write performed
- llfio::off_t offset; // offset of next write
+ afio::future<> lastwrite; // the last async write performed
+ afio::off_t offset; // offset of next write
file_buffer_type buffer; // a page size on this machine
file_buffer_type lastbuffer;
- directstreambuf(llfio::handle_ptr _h) : lastwrite(std::move(_h)), offset(0), buffer(llfio::utils::page_sizes().front())
+ directstreambuf(afio::handle_ptr _h) : lastwrite(std::move(_h)), offset(0), buffer(afio::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 = llfio::async_write(llfio::async_truncate(lastwrite, offset+thisbuffer), buffer.data(), thisbuffer, offset);
+ lastwrite = afio::async_write(afio::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 = llfio::async_truncate(lastwrite, offset + thisbuffer);
+ lastwrite = afio::async_truncate(lastwrite, offset + thisbuffer);
// Schedule an asynchronous write of the buffer to storage
- lastwrite=llfio::async_write(lastwrite, lastbuffer.data(), thisbuffer, offset);
+ lastwrite=afio::async_write(lastwrite, lastbuffer.data(), thisbuffer, offset);
offset+=thisbuffer;
}
return 0;
}
};
std::unique_ptr<directstreambuf> buf;
- odirectstream(llfio::handle_ptr h) : std::ostream(new directstreambuf(std::move(h))), buf(static_cast<directstreambuf *>(rdbuf()))
+ odirectstream(afio::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_llfio1]
+//[workshop_naive_afio1]
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, llfio::path path)
+data_store::data_store(size_t flags, afio::path path)
{
// Make a dispatcher for the local filesystem URI, masking out write flags on all operations if not writeable
- _dispatcher=llfio::make_dispatcher("file:///", llfio::file_flags::none, !(flags & writeable) ? llfio::file_flags::write : llfio::file_flags::none).get();
+ _dispatcher=afio::make_dispatcher("file:///", afio::file_flags::none, !(flags & writeable) ? afio::file_flags::write : afio::file_flags::none).get();
// Set the dispatcher for this thread, and open a handle to the store directory
- llfio::current_dispatcher_guard h(_dispatcher);
- _store=llfio::dir(std::move(path), llfio::file_flags::create); // throws if there was an error
+ afio::current_dispatcher_guard h(_dispatcher);
+ _store=afio::dir(std::move(path), afio::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.
- llfio::handle_ptr h(llfio::file(ec, _store, name, llfio::file_flags::read));
+ afio::handle_ptr h(afio::file(ec, _store, name, afio::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.
- llfio::handle_ptr h(llfio::file(ec, _store, name, llfio::file_flags::create | llfio::file_flags::write
- /*| llfio::file_flags::os_direct*/));
+ afio::handle_ptr h(afio::file(ec, _store, name, afio::file_flags::create | afio::file_flags::write
+ /*| afio::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 92197aba..86cb8052 100644
--- a/attic/example/workshop_naive_async_afio.cpp
+++ b/attic/example/workshop_naive_async_afio.cpp
@@ -1,2 +1,2 @@
-#include "llfio_pch.hpp"
-#include "workshop_naive_async_llfio.ipp"
+#include "afio_pch.hpp"
+#include "workshop_naive_async_afio.ipp"
diff --git a/attic/example/workshop_naive_async_afio.ipp b/attic/example/workshop_naive_async_afio.ipp
index bfa61111..651d2a4e 100644
--- a/attic/example/workshop_naive_async_afio.ipp
+++ b/attic/example/workshop_naive_async_afio.ipp
@@ -1,12 +1,12 @@
-//[workshop_naive_async_llfio_interface
-namespace llfio = BOOST_AFIO_V2_NAMESPACE;
+//[workshop_naive_async_afio_interface
+namespace afio = BOOST_AFIO_V2_NAMESPACE;
namespace filesystem = BOOST_AFIO_V2_NAMESPACE::filesystem;
using BOOST_OUTCOME_V1_NAMESPACE::lightweight_futures::shared_future;
class data_store
{
- llfio::dispatcher_ptr _dispatcher;
- llfio::handle_ptr _store;
+ afio::dispatcher_ptr _dispatcher;
+ afio::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, llfio::path path = "store");
+ data_store(size_t flags = 0, afio::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_llfio3]
+//[workshop_naive_async_afio3]
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, llfio::utils::page_allocator<char>>;
+using file_buffer_type = std::vector<char, afio::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
{
- llfio::handle_ptr h; // Holds the file open
+ afio::handle_ptr h; // Holds the file open
std::shared_ptr<file_buffer_type> buffer;
- llfio::handle::mapped_file_ptr mfp;
+ afio::handle::mapped_file_ptr mfp;
// From a mmap
- directstreambuf(llfio::handle_ptr _h, llfio::handle::mapped_file_ptr _mfp, size_t length) : h(std::move(_h)), mfp(std::move(_mfp))
+ directstreambuf(afio::handle_ptr _h, afio::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(llfio::handle_ptr _h, std::shared_ptr<file_buffer_type> _buffer, size_t length) : h(std::move(_h)), buffer(std::move(_buffer))
+ directstreambuf(afio::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(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()))
+ 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()))
{
}
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;
- llfio::future<> lastwrite; // the last async write performed
- llfio::off_t offset; // offset of next write
+ afio::future<> lastwrite; // the last async write performed
+ afio::off_t offset; // offset of next write
file_buffer_type buffer; // a page size on this machine
file_buffer_type lastbuffer;
- directstreambuf(llfio::handle_ptr _h) : lastwrite(std::move(_h)), offset(0), buffer(llfio::utils::page_sizes().front())
+ directstreambuf(afio::handle_ptr _h) : lastwrite(std::move(_h)), offset(0), buffer(afio::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 = llfio::async_write(llfio::async_truncate(lastwrite, offset+thisbuffer), buffer.data(), thisbuffer, offset);
+ lastwrite = afio::async_write(afio::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 = llfio::async_truncate(lastwrite, offset + thisbuffer);
+ lastwrite = afio::async_truncate(lastwrite, offset + thisbuffer);
// Schedule an asynchronous write of the buffer to storage
- lastwrite=llfio::async_write(lastwrite, lastbuffer.data(), thisbuffer, offset);
+ lastwrite=afio::async_write(lastwrite, lastbuffer.data(), thisbuffer, offset);
offset+=thisbuffer;
}
return 0;
}
};
std::unique_ptr<directstreambuf> buf;
- odirectstream(llfio::handle_ptr h) : std::ostream(new directstreambuf(std::move(h))), buf(static_cast<directstreambuf *>(rdbuf()))
+ odirectstream(afio::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, llfio::path path)
+data_store::data_store(size_t flags, afio::path path)
{
// Make a dispatcher for the local filesystem URI, masking out write flags on all operations if not writeable
- _dispatcher=llfio::make_dispatcher("file:///", llfio::file_flags::none, !(flags & writeable) ? llfio::file_flags::write : llfio::file_flags::none).get();
+ _dispatcher=afio::make_dispatcher("file:///", afio::file_flags::none, !(flags & writeable) ? afio::file_flags::write : afio::file_flags::none).get();
// Set the dispatcher for this thread, and open a handle to the store directory
- llfio::current_dispatcher_guard h(_dispatcher);
- _store=llfio::dir(std::move(path), llfio::file_flags::create); // throws if there was an error
+ afio::current_dispatcher_guard h(_dispatcher);
+ _store=afio::dir(std::move(path), afio::file_flags::create); // throws if there was an error
}
-//[workshop_naive_async_llfio2]
+//[workshop_naive_async_afio2]
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
- llfio::future<> h(llfio::async_file(_store, name, llfio::file_flags::read));
+ afio::future<> h(afio::async_file(_store, name, afio::file_flags::read));
// When it completes, call this continuation
- return h.then([](llfio::future<> &_h) -> shared_future<data_store::istream> {
+ return h.then([](afio::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(llfio::metadata_flags::size).st_size;
+ size_t length=(size_t) _h->lstat(afio::metadata_flags::size).st_size;
// Is a memory map more appropriate?
if(length>=128*1024)
{
- llfio::handle::mapped_file_ptr mfp;
+ afio::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);
- llfio::future<> h(llfio::async_read(_h, buffer->data(), length, 0));
+ afio::future<> h(afio::async_read(_h, buffer->data(), length, 0));
// When the read completes call this continuation
- return h.then([buffer, length](const llfio::future<> &h) -> shared_future<data_store::istream> {
+ return h.then([buffer, length](const afio::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_llfio1]
+//[workshop_naive_async_afio1]
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
- llfio::future<> h(llfio::async_file(_store, name, llfio::file_flags::create | llfio::file_flags::write));
+ afio::future<> h(afio::async_file(_store, name, afio::file_flags::create | afio::file_flags::write));
// When it completes, call this continuation
- return h.then([](const llfio::future<> &h) -> shared_future<data_store::ostream> {
+ return h.then([](const afio::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 fc5fa1e9..acba7071 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::llfio
-#define BOOST_AFIO_V2_NAMESPACE_BEGIN namespace boost { namespace llfio {
+#define BOOST_AFIO_V2_NAMESPACE boost::afio
+#define BOOST_AFIO_V2_NAMESPACE_BEGIN namespace boost { namespace afio {
#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 llfio.hpp
+/*! \file afio.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::llfio::std_thread_pool worker");
+ detail::set_threadname("boost::afio::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 __llfio_stat_t__ for explanation of meaning.
+See __afio_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 `__llfio_stat_t__` for explanations of the fields.
+See `__afio_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: `__llfio_directory_entry__`, `__llfio_stat_t__`
+ Related types: `__afio_directory_entry__`, `__afio_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: `__llfio_directory_entry__`, `__llfio_stat_t__`
+ Related types: `__afio_directory_entry__`, `__afio_stat_t__`
*/
stat_t lstat(metadata_flags wanted=directory_entry::metadata_fastpath())
{
@@ -1273,7 +1273,7 @@ public:
\ntkernelnamespacenote
- Related types: `__llfio_path_req__`
+ Related types: `__afio_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 .llfiodXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX where
+ 1. It tries to atomically rename the item to the root of the mounted volume it lives in with a .afiodXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 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: `__llfio_path_req__`
+ Related types: `__afio_path_req__`
\ingroup async_io_handle__ops
\raceguarantees{
@@ -1335,7 +1335,7 @@ public:
\ntkernelnamespacenote
- Related types: `__llfio_path_req__`
+ Related types: `__afio_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 llfio::future<T>
+//! Trait for determining if a type is an afio::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_llfio_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_afio_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::llfio::make_dispatcher()` function.
+Construct an instance using the `boost::afio::make_dispatcher()` function.
\qbk{
-[/ link llfio.reference.functions.async_file_io_dispatcher `async_file_io_dispatcher()`]
+[/ link afio.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 __llfio_dispatcher__.
+ A particularly useful combination with this allocator is with the page_sizes() member function of __afio_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/llfio.ipp"
+#include "detail/impl/afio.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 9d925c4d..35dda16d 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), (llfio), (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), (afio), (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), (llfio), (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), (afio), (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_llfio
+#define BOOST_LIB_NAME boost_afio
// 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 89464685..ea8acdf2 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 llfio { namespace fatal_exception_throw {
+namespace boost { namespace afio { 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_llfio_do_throw_fatal_exception(std::function<void()> impl) noexcept{ impl(); }
+ extern "C" inline void boost_afio_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_llfio_do_throw_fatal_exception(doer);
+ boost_afio_do_throw_fatal_exception(doer);
}
catch(...)
{
@@ -132,7 +132,7 @@ namespace boost { namespace llfio { namespace fatal_exception_throw {
}
}
} } }
-#define BOOST_AFIO_THROW_FATAL(x) boost::llfio::fatal_exception_throw::throw_fatal_exception(x)
+#define BOOST_AFIO_THROW_FATAL(x) boost::afio::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 e45c0bf1..28c319b0 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 "../../llfio.hpp"
+#include "../../afio.hpp"
#include <locale>
#include <cstring>
@@ -16,12 +16,12 @@ namespace detail {
#ifdef BOOST_AFIO_OP_STACKBACKTRACEDEPTH
try
{
- if(!llfio_exception_stack())
- llfio_exception_stack()=new llfio_exception_stack_t;
- llfio_exception_stack_entry se;
+ if(!afio_exception_stack())
+ afio_exception_stack()=new afio_exception_stack_t;
+ afio_exception_stack_entry se;
se.name=std::move(name);
collect_stack(se.stack);
- llfio_exception_stack()->push_back(std::move(se));
+ afio_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 28dc3a6a..744f2dac 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 "../../llfio.hpp"
+#include "../../afio.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::llfio;
+ using namespace boost::afio;
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 llfio_exception_stack_entry
+struct afio_exception_stack_entry
{
std::string name;
stack_type stack;
};
-typedef std::vector<llfio_exception_stack_entry> llfio_exception_stack_t;
-inline llfio_exception_stack_t *&llfio_exception_stack()
+typedef std::vector<afio_exception_stack_entry> afio_exception_stack_t;
+inline afio_exception_stack_t *&afio_exception_stack()
{
- static BOOST_AFIO_THREAD_LOCAL llfio_exception_stack_t *s;
+ static BOOST_AFIO_THREAD_LOCAL afio_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+=".llfiolockfile";
+ lockfilepath+=".afiolockfile";
}
public:
~actual_lock_file()
@@ -1336,7 +1336,7 @@ update_path:
if(it->second.expired())
{
#ifndef NDEBUG
- std::cout << "llfio: directory cached handle pruned stale " << it->first << std::endl;
+ std::cout << "afio: 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 << "llfio: directory cached handle created for " << req.path << " (" << dirh.get() << ")" << std::endl;
+ std::cout << "afio: 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 << "llfio: directory cached handle we relocate from " << oldpath << " to " << newpath << " (" << h.get() << ")" << std::endl;
+ std::cout << "afio: 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 llfio_exception_stack();
- llfio_exception_stack()=nullptr;
+ delete afio_exception_stack();
+ afio_exception_stack()=nullptr;
});
- if(llfio_exception_stack() && !(p->testing_flags & detail::unit_testing_flags::no_symbol_lookup))
+ if(afio_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 : *llfio_exception_stack())
+ for(auto &i : *afio_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 "llfio_iocp.ipp"
+#include "afio_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 << "llfio: Large page allocation successful" << std::endl;
+ std::cout << "afio: 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 << "llfio: Large page allocation successful" << std::endl;
+ std::cout << "afio: 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 8f79a2dc..012d4aaa 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".llfiod"))
+ if(leafname.size()==64+6 && !leafname.compare(0, 6, L".afiod"))
{
- // Could be one of our "deleted" files, is he ".llfiod" + all hex?
+ // Could be one of our "deleted" files, is he ".afiod" + 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 .llfiodXXXXX crypto random name
+ // Then try to rename myself to the closest to the root as possible with a .afiodXXXXX 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(".llfiod"+utils::random_string(32 /* 128 bits */));
+ auto _randomname(".afiod"+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(".llfiod"+utils::random_string(32 /* 128 bits */));
+ auto randompath(".afiod"+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 1da37d83..1c976a8a 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::llfio;
+ using namespace boost::afio;
#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 4e65dab3..61fb13cf 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/llfio/llfio.hpp"
+#include "boost/afio/afio.hpp"
#if BOOST_AFIO_LATEST_VERSION != 2
-# error Mismatched llfio.cpp to latest version
+# error Mismatched afio.cpp to latest version
#endif
-#include "boost/llfio/v2/detail/impl/llfio.ipp"
+#include "boost/afio/v2/detail/impl/afio.ipp"
diff --git a/attic/test/afio_pch.hpp b/attic/test/afio_pch.hpp
index 2c6ec1b5..9a908b9f 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/llfio/llfio.hpp"
+# include "boost/afio/afio.hpp"
# include <iostream>
# include <fstream>
#endif
diff --git a/attic/test/test_functions.hpp b/attic/test/test_functions.hpp
index 8b56d2df..7606f6a8 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/llfio/llfio.hpp"
+#include "boost/afio/afio.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/llfio/v2/detail/valgrind/valgrind.h"
+#include "boost/afio/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/llfio/bindlib/include/boost/test/unit_test.hpp"
+# include "../include/boost/afio/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::llfio;
+ using namespace boost::afio;
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::llfio;
+ using namespace boost::afio;
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 533f731c..e5cb8fad 100644
--- a/attic/test/test_inline_linkage1.cpp
+++ b/attic/test/test_inline_linkage1.cpp
@@ -1,11 +1,11 @@
-#include "boost/llfio/llfio.hpp"
+#include "boost/afio/afio.hpp"
void test_inline_linkage1()
{
- using namespace boost::llfio;
+ using namespace boost::afio;
using namespace std;
vector<char> buffer(64, 'n');
- auto dispatcher = boost::llfio::make_dispatcher("file:///", boost::llfio::file_flags::always_sync).get();
+ auto dispatcher = boost::afio::make_dispatcher("file:///", boost::afio::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 4358bbca..c627fb1f 100644
--- a/attic/test/test_inline_linkage2.cpp
+++ b/attic/test/test_inline_linkage2.cpp
@@ -1,11 +1,11 @@
-#include "boost/llfio/llfio.hpp"
+#include "boost/afio/afio.hpp"
void test_inline_linkage2()
{
- using namespace boost::llfio;
+ using namespace boost::afio;
using namespace std;
vector<char> buffer(64, 'n');
- auto dispatcher = boost::llfio::make_dispatcher("file:///", boost::llfio::file_flags::always_sync).get();
+ auto dispatcher = boost::afio::make_dispatcher("file:///", boost::afio::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 eb4e3b84..a9bcdaf2 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 llfio = BOOST_AFIO_V2_NAMESPACE;
+namespace afio = BOOST_AFIO_V2_NAMESPACE;
struct test_handle : handle
{
@@ -20,11 +20,11 @@ struct test_handle : handle
return nullptr;
}
using handle::path;
- virtual llfio::path path(bool refresh=false) override final
+ virtual afio::path path(bool refresh=false) override final
{
return "foo";
}
- virtual llfio::path path() const override final
+ virtual afio::path path() const override final
{
return "foo";
}
@@ -32,9 +32,9 @@ struct test_handle : handle
{
return directory_entry();
}
- virtual llfio::path target() override final
+ virtual afio::path target() override final
{
- return llfio::path();
+ return afio::path();
}
virtual void link(const path_req &req) override final
{