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>2020-01-09 13:17:56 +0300
committerNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2020-01-09 13:17:56 +0300
commit0b956868ebf3e31e38197342f7cd6f2f4a431b5d (patch)
tree8199765097ffce60007ce4d373157a608c08d974 /include
parent379075e89b5a51473e063952967467b4cb4ac952 (diff)
Rename random_*() handle constructors to uniquely_named_*(), as per LEWG-I feedback.
Diffstat (limited to 'include')
-rw-r--r--include/llfio/v2.0/algorithm/shared_fs_mutex/memory_map.hpp2
-rw-r--r--include/llfio/v2.0/async_file_handle.hpp14
-rw-r--r--include/llfio/v2.0/detail/impl/path_discovery.ipp2
-rw-r--r--include/llfio/v2.0/detail/impl/posix/directory_handle.ipp2
-rw-r--r--include/llfio/v2.0/detail/impl/posix/file_handle.ipp2
-rw-r--r--include/llfio/v2.0/directory_handle.hpp14
-rw-r--r--include/llfio/v2.0/file_handle.hpp14
-rw-r--r--include/llfio/v2.0/mapped_file_handle.hpp14
-rw-r--r--include/llfio/v2.0/symlink_handle.hpp4
9 files changed, 34 insertions, 34 deletions
diff --git a/include/llfio/v2.0/algorithm/shared_fs_mutex/memory_map.hpp b/include/llfio/v2.0/algorithm/shared_fs_mutex/memory_map.hpp
index 5821bfce..8044b434 100644
--- a/include/llfio/v2.0/algorithm/shared_fs_mutex/memory_map.hpp
+++ b/include/llfio/v2.0/algorithm/shared_fs_mutex/memory_map.hpp
@@ -239,7 +239,7 @@ namespace algorithm
// I am the first person to be using this (stale?) file, so create a new hash index file in /tmp
auto &tempdirh = path_discovery::memory_backed_temporary_files_directory().is_valid() ? path_discovery::memory_backed_temporary_files_directory() : path_discovery::storage_backed_temporary_files_directory();
- OUTCOME_TRY(_temph, file_handle::random_file(tempdirh));
+ OUTCOME_TRY(_temph, file_handle::uniquely_named_file(tempdirh));
temph = std::move(_temph);
// Truncate it out to the hash index size, and map it into memory for read/write access
OUTCOME_TRYV(temph.truncate(HashIndexSize));
diff --git a/include/llfio/v2.0/async_file_handle.hpp b/include/llfio/v2.0/async_file_handle.hpp
index b35b1850..7ce93782 100644
--- a/include/llfio/v2.0/async_file_handle.hpp
+++ b/include/llfio/v2.0/async_file_handle.hpp
@@ -144,14 +144,14 @@ public:
return {std::move(ret)};
}
- /*! Create an async file handle creating a randomly named file on a path.
+ /*! Create an async file handle creating a uniquely named file on a path.
The file is opened exclusively with `creation::only_if_not_exist` so it
will never collide with nor overwrite any existing file.
\errors Any of the values POSIX open() or CreateFile() can return.
*/
LLFIO_MAKE_FREE_FUNCTION
- static inline result<async_file_handle> async_random_file(io_service &service, const path_handle &dirpath, mode _mode = mode::write, caching _caching = caching::only_metadata, flag flags = flag::none) noexcept
+ static inline result<async_file_handle> async_uniquely_named_file(io_service &service, const path_handle &dirpath, mode _mode = mode::write, caching _caching = caching::only_metadata, flag flags = flag::none) noexcept
{
try
{
@@ -177,7 +177,7 @@ public:
Note the default flags are to have the newly created file deleted
on first handle close.
Note also that an empty name is equivalent to calling
- `async_random_file(path_discovery::storage_backed_temporary_files_directory())` and the creation
+ `async_uniquely_named_file(path_discovery::storage_backed_temporary_files_directory())` and the creation
parameter is ignored.
\note If the temporary file you are creating is not going to have its
@@ -190,7 +190,7 @@ public:
static inline result<async_file_handle> async_temp_file(io_service &service, path_view_type name = path_view_type(), mode _mode = mode::write, creation _creation = creation::if_needed, caching _caching = caching::only_metadata, flag flags = flag::unlink_on_first_close) noexcept
{
auto &tempdirh = path_discovery::storage_backed_temporary_files_directory();
- return name.empty() ? async_random_file(service, tempdirh, _mode, _caching, flags) : async_file(service, tempdirh, name, _mode, _creation, _caching, flags);
+ return name.empty() ? async_uniquely_named_file(service, tempdirh, _mode, _caching, flags) : async_file(service, tempdirh, name, _mode, _creation, _caching, flags);
}
/*! \em Securely create an async file handle creating a temporary anonymous inode in
the filesystem referred to by \em dirpath. The inode created has
@@ -655,9 +655,9 @@ will never collide with nor overwrite any existing file.
\errors Any of the values POSIX open() or CreateFile() can return.
*/
-inline result<async_file_handle> async_random_file(io_service &service, const path_handle &dirpath, async_file_handle::mode _mode = async_file_handle::mode::write, async_file_handle::caching _caching = async_file_handle::caching::only_metadata, async_file_handle::flag flags = async_file_handle::flag::none) noexcept
+inline result<async_file_handle> async_uniquely_named_file(io_service &service, const path_handle &dirpath, async_file_handle::mode _mode = async_file_handle::mode::write, async_file_handle::caching _caching = async_file_handle::caching::only_metadata, async_file_handle::flag flags = async_file_handle::flag::none) noexcept
{
- return async_file_handle::async_random_file(std::forward<decltype(service)>(service), std::forward<decltype(dirpath)>(dirpath), std::forward<decltype(_mode)>(_mode), std::forward<decltype(_caching)>(_caching), std::forward<decltype(flags)>(flags));
+ return async_file_handle::async_uniquely_named_file(std::forward<decltype(service)>(service), std::forward<decltype(dirpath)>(dirpath), std::forward<decltype(_mode)>(_mode), std::forward<decltype(_caching)>(_caching), std::forward<decltype(flags)>(flags));
}
/*! Create an async file handle creating the named file on some path which
the OS declares to be suitable for temporary files. Most OSs are
@@ -665,7 +665,7 @@ very lazy about flushing changes made to these temporary files.
Note the default flags are to have the newly created file deleted
on first handle close.
Note also that an empty name is equivalent to calling
-`async_random_file(path_discovery::storage_backed_temporary_files_directory())` and the creation
+`async_uniquely_named_file(path_discovery::storage_backed_temporary_files_directory())` and the creation
parameter is ignored.
\note If the temporary file you are creating is not going to have its
diff --git a/include/llfio/v2.0/detail/impl/path_discovery.ipp b/include/llfio/v2.0/detail/impl/path_discovery.ipp
index fed19c71..2f43ed24 100644
--- a/include/llfio/v2.0/detail/impl/path_discovery.ipp
+++ b/include/llfio/v2.0/detail/impl/path_discovery.ipp
@@ -154,7 +154,7 @@ namespace path_discovery
ps._all[n].h = std::move(_h).value();
}
// Try to create a small file in that directory
- auto _fh = file_handle::random_file(ps._all[n].h, file_handle::mode::write, file_handle::caching::temporary, file_handle::flag::unlink_on_first_close);
+ auto _fh = file_handle::uniquely_named_file(ps._all[n].h, file_handle::mode::write, file_handle::caching::temporary, file_handle::flag::unlink_on_first_close);
if(!_fh)
{
#if LLFIO_LOGGING_LEVEL >= 3
diff --git a/include/llfio/v2.0/detail/impl/posix/directory_handle.ipp b/include/llfio/v2.0/detail/impl/posix/directory_handle.ipp
index 7ed68548..6d7a9129 100644
--- a/include/llfio/v2.0/detail/impl/posix/directory_handle.ipp
+++ b/include/llfio/v2.0/detail/impl/posix/directory_handle.ipp
@@ -95,7 +95,7 @@ result<directory_handle> directory_handle::directory(const path_handle &base, pa
dirh = std::move(dh);
}
// Create a randomly named directory, and rename it over
- OUTCOME_TRY(rfh, random_directory(dirh, _mode, _caching, flags));
+ OUTCOME_TRY(rfh, uniquely_named_directory(dirh, _mode, _caching, flags));
auto r = rfh.relink(dirh, path.filename());
if(r)
{
diff --git a/include/llfio/v2.0/detail/impl/posix/file_handle.ipp b/include/llfio/v2.0/detail/impl/posix/file_handle.ipp
index 070fef1c..a75c1ab9 100644
--- a/include/llfio/v2.0/detail/impl/posix/file_handle.ipp
+++ b/include/llfio/v2.0/detail/impl/posix/file_handle.ipp
@@ -64,7 +64,7 @@ result<file_handle> file_handle::file(const path_handle &base, file_handle::path
dirh = std::move(dh);
}
// Create a randomly named file, and rename it over
- OUTCOME_TRY(rfh, random_file(dirh, _mode, _caching, flags));
+ OUTCOME_TRY(rfh, uniquely_named_file(dirh, _mode, _caching, flags));
auto r = rfh.relink(dirh, path.filename());
if(r)
{
diff --git a/include/llfio/v2.0/directory_handle.hpp b/include/llfio/v2.0/directory_handle.hpp
index f3f746ef..6609e3eb 100644
--- a/include/llfio/v2.0/directory_handle.hpp
+++ b/include/llfio/v2.0/directory_handle.hpp
@@ -202,14 +202,14 @@ public:
*/
LLFIO_MAKE_FREE_FUNCTION
static LLFIO_HEADERS_ONLY_MEMFUNC_SPEC result<directory_handle> directory(const path_handle &base, path_view_type path, mode _mode = mode::read, creation _creation = creation::open_existing, caching _caching = caching::all, flag flags = flag::none) noexcept;
- /*! Create a directory handle creating a randomly named file on a path.
+ /*! Create a directory handle creating a uniquely named file on a path.
The file is opened exclusively with `creation::only_if_not_exist` so it
will never collide with nor overwrite any existing entry.
\errors Any of the values POSIX open() or CreateFile() can return.
*/
LLFIO_MAKE_FREE_FUNCTION
- static inline result<directory_handle> random_directory(const path_handle &dirpath, mode _mode = mode::write, caching _caching = caching::temporary, flag flags = flag::none) noexcept
+ static inline result<directory_handle> uniquely_named_directory(const path_handle &dirpath, mode _mode = mode::write, caching _caching = caching::temporary, flag flags = flag::none) noexcept
{
try
{
@@ -231,7 +231,7 @@ public:
/*! Create a directory handle creating the named directory on some path which
the OS declares to be suitable for temporary files.
Note also that an empty name is equivalent to calling
- `random_file(path_discovery::storage_backed_temporary_files_directory())` and the creation
+ `uniquely_named_file(path_discovery::storage_backed_temporary_files_directory())` and the creation
parameter is ignored.
\errors Any of the values POSIX open() or CreateFile() can return.
@@ -240,7 +240,7 @@ public:
static inline result<directory_handle> temp_directory(path_view_type name = path_view_type(), mode _mode = mode::write, creation _creation = creation::if_needed, caching _caching = caching::all, flag flags = flag::none) noexcept
{
auto &tempdirh = path_discovery::storage_backed_temporary_files_directory();
- return name.empty() ? random_directory(tempdirh, _mode, _caching, flags) : directory(tempdirh, name, _mode, _creation, _caching, flags);
+ return name.empty() ? uniquely_named_directory(tempdirh, _mode, _caching, flags) : directory(tempdirh, name, _mode, _creation, _caching, flags);
}
LLFIO_HEADERS_ONLY_VIRTUAL_SPEC ~directory_handle() override
@@ -355,14 +355,14 @@ will never collide with nor overwrite any existing entry.
\errors Any of the values POSIX open() or CreateFile() can return.
*/
-inline result<directory_handle> random_directory(const path_handle &dirpath, directory_handle::mode _mode = directory_handle::mode::write, directory_handle::caching _caching = directory_handle::caching::temporary, directory_handle::flag flags = directory_handle::flag::none) noexcept
+inline result<directory_handle> uniquely_named_directory(const path_handle &dirpath, directory_handle::mode _mode = directory_handle::mode::write, directory_handle::caching _caching = directory_handle::caching::temporary, directory_handle::flag flags = directory_handle::flag::none) noexcept
{
- return directory_handle::random_directory(std::forward<decltype(dirpath)>(dirpath), std::forward<decltype(_mode)>(_mode), std::forward<decltype(_caching)>(_caching), std::forward<decltype(flags)>(flags));
+ return directory_handle::uniquely_named_directory(std::forward<decltype(dirpath)>(dirpath), std::forward<decltype(_mode)>(_mode), std::forward<decltype(_caching)>(_caching), std::forward<decltype(flags)>(flags));
}
/*! Create a directory handle creating the named directory on some path which
the OS declares to be suitable for temporary files.
Note also that an empty name is equivalent to calling
-`random_file(path_discovery::storage_backed_temporary_files_directory())` and the creation
+`uniquely_named_file(path_discovery::storage_backed_temporary_files_directory())` and the creation
parameter is ignored.
\errors Any of the values POSIX open() or CreateFile() can return.
diff --git a/include/llfio/v2.0/file_handle.hpp b/include/llfio/v2.0/file_handle.hpp
index f2290f71..4f6c8a97 100644
--- a/include/llfio/v2.0/file_handle.hpp
+++ b/include/llfio/v2.0/file_handle.hpp
@@ -134,7 +134,7 @@ public:
*/
LLFIO_MAKE_FREE_FUNCTION
static LLFIO_HEADERS_ONLY_MEMFUNC_SPEC result<file_handle> file(const path_handle &base, path_view_type path, mode _mode = mode::read, creation _creation = creation::open_existing, caching _caching = caching::all, flag flags = flag::none) noexcept;
- /*! Create a file handle creating a randomly named file on a path.
+ /*! Create a file handle creating a uniquely named file on a path.
The file is opened exclusively with `creation::only_if_not_exist` so it
will never collide with nor overwrite any existing file. Note also
that caching defaults to temporary which hints to the OS to only
@@ -143,7 +143,7 @@ public:
\errors Any of the values POSIX open() or CreateFile() can return.
*/
LLFIO_MAKE_FREE_FUNCTION
- static inline result<file_handle> random_file(const path_handle &dirpath, mode _mode = mode::write, caching _caching = caching::temporary, flag flags = flag::none) noexcept
+ static inline result<file_handle> uniquely_named_file(const path_handle &dirpath, mode _mode = mode::write, caching _caching = caching::temporary, flag flags = flag::none) noexcept
{
try
{
@@ -169,7 +169,7 @@ public:
Note the default flags are to have the newly created file deleted
on first handle close.
Note also that an empty name is equivalent to calling
- `random_file(path_discovery::storage_backed_temporary_files_directory())` and the creation
+ `uniquely_named_file(path_discovery::storage_backed_temporary_files_directory())` and the creation
parameter is ignored.
\note If the temporary file you are creating is not going to have its
@@ -182,7 +182,7 @@ public:
static inline result<file_handle> temp_file(path_view_type name = path_view_type(), mode _mode = mode::write, creation _creation = creation::if_needed, caching _caching = caching::temporary, flag flags = flag::unlink_on_first_close) noexcept
{
auto &tempdirh = path_discovery::storage_backed_temporary_files_directory();
- return name.empty() ? random_file(tempdirh, _mode, _caching, flags) : file(tempdirh, name, _mode, _creation, _caching, flags);
+ return name.empty() ? uniquely_named_file(tempdirh, _mode, _caching, flags) : file(tempdirh, name, _mode, _creation, _caching, flags);
}
/*! \em Securely create a file handle creating a temporary anonymous inode in
the filesystem referred to by \em dirpath. The inode created has
@@ -378,9 +378,9 @@ flush changes to physical storage as lately as possible.
\errors Any of the values POSIX open() or CreateFile() can return.
*/
-inline result<file_handle> random_file(const path_handle &dirpath, file_handle::mode _mode = file_handle::mode::write, file_handle::caching _caching = file_handle::caching::temporary, file_handle::flag flags = file_handle::flag::none) noexcept
+inline result<file_handle> uniquely_named_file(const path_handle &dirpath, file_handle::mode _mode = file_handle::mode::write, file_handle::caching _caching = file_handle::caching::temporary, file_handle::flag flags = file_handle::flag::none) noexcept
{
- return file_handle::random_file(std::forward<decltype(dirpath)>(dirpath), std::forward<decltype(_mode)>(_mode), std::forward<decltype(_caching)>(_caching), std::forward<decltype(flags)>(flags));
+ return file_handle::uniquely_named_file(std::forward<decltype(dirpath)>(dirpath), std::forward<decltype(_mode)>(_mode), std::forward<decltype(_caching)>(_caching), std::forward<decltype(flags)>(flags));
}
/*! Create a file handle creating the named file on some path which
the OS declares to be suitable for temporary files. Most OSs are
@@ -388,7 +388,7 @@ very lazy about flushing changes made to these temporary files.
Note the default flags are to have the newly created file deleted
on first handle close.
Note also that an empty name is equivalent to calling
-`random_file(path_discovery::storage_backed_temporary_files_directory())` and the creation
+`uniquely_named_file(path_discovery::storage_backed_temporary_files_directory())` and the creation
parameter is ignored.
\note If the temporary file you are creating is not going to have its
diff --git a/include/llfio/v2.0/mapped_file_handle.hpp b/include/llfio/v2.0/mapped_file_handle.hpp
index f9349d3d..7324f217 100644
--- a/include/llfio/v2.0/mapped_file_handle.hpp
+++ b/include/llfio/v2.0/mapped_file_handle.hpp
@@ -216,7 +216,7 @@ public:
LLFIO_MAKE_FREE_FUNCTION
static inline result<mapped_file_handle> mapped_file(const path_handle &base, path_view_type _path, mode _mode = mode::read, creation _creation = creation::open_existing, caching _caching = caching::all, flag flags = flag::none) noexcept { return mapped_file(0, base, _path, _mode, _creation, _caching, flags); }
- /*! Create an mapped file handle creating a randomly named file on a path.
+ /*! Create an mapped file handle creating a uniquely named file on a path.
The file is opened exclusively with `creation::only_if_not_exist` so it
will never collide with nor overwrite any existing file. Note also
that caching defaults to temporary which hints to the OS to only
@@ -225,7 +225,7 @@ public:
\errors Any of the values POSIX open() or CreateFile() can return.
*/
LLFIO_MAKE_FREE_FUNCTION
- static inline result<mapped_file_handle> mapped_random_file(size_type reservation, const path_handle &dirpath, mode _mode = mode::write, caching _caching = caching::temporary, flag flags = flag::none) noexcept
+ static inline result<mapped_file_handle> mapped_uniquely_named_file(size_type reservation, const path_handle &dirpath, mode _mode = mode::write, caching _caching = caching::temporary, flag flags = flag::none) noexcept
{
try
{
@@ -251,7 +251,7 @@ public:
Note the default flags are to have the newly created file deleted
on first handle close.
Note also that an empty name is equivalent to calling
- `mapped_random_file(path_discovery::storage_backed_temporary_files_directory())` and the creation
+ `mapped_uniquely_named_file(path_discovery::storage_backed_temporary_files_directory())` and the creation
parameter is ignored.
\note If the temporary file you are creating is not going to have its
@@ -264,7 +264,7 @@ public:
static inline result<mapped_file_handle> mapped_temp_file(size_type reservation, path_view_type name = path_view_type(), mode _mode = mode::write, creation _creation = creation::if_needed, caching _caching = caching::temporary, flag flags = flag::unlink_on_first_close) noexcept
{
auto &tempdirh = path_discovery::storage_backed_temporary_files_directory();
- return name.empty() ? mapped_random_file(reservation, tempdirh, _mode, _caching, flags) : mapped_file(reservation, tempdirh, name, _mode, _creation, _caching, flags);
+ return name.empty() ? mapped_uniquely_named_file(reservation, tempdirh, _mode, _caching, flags) : mapped_file(reservation, tempdirh, name, _mode, _creation, _caching, flags);
}
/*! \em Securely create a mapped file handle creating a temporary anonymous inode in
the filesystem referred to by \em dirpath. The inode created has
@@ -488,10 +488,10 @@ flush changes to physical storage as lately as possible.
\errors Any of the values POSIX open() or CreateFile() can return.
*/
-inline result<mapped_file_handle> mapped_random_file(mapped_file_handle::size_type reservation, const path_handle &dirpath, mapped_file_handle::mode _mode = mapped_file_handle::mode::write, mapped_file_handle::caching _caching = mapped_file_handle::caching::temporary,
+inline result<mapped_file_handle> mapped_uniquely_named_file(mapped_file_handle::size_type reservation, const path_handle &dirpath, mapped_file_handle::mode _mode = mapped_file_handle::mode::write, mapped_file_handle::caching _caching = mapped_file_handle::caching::temporary,
mapped_file_handle::flag flags = mapped_file_handle::flag::none) noexcept
{
- return mapped_file_handle::mapped_random_file(std::forward<decltype(reservation)>(reservation), std::forward<decltype(dirpath)>(dirpath), std::forward<decltype(_mode)>(_mode), std::forward<decltype(_caching)>(_caching), std::forward<decltype(flags)>(flags));
+ return mapped_file_handle::mapped_uniquely_named_file(std::forward<decltype(reservation)>(reservation), std::forward<decltype(dirpath)>(dirpath), std::forward<decltype(_mode)>(_mode), std::forward<decltype(_caching)>(_caching), std::forward<decltype(flags)>(flags));
}
/*! Create a mapped file handle creating the named file on some path which
the OS declares to be suitable for temporary files. Most OSs are
@@ -499,7 +499,7 @@ very lazy about flushing changes made to these temporary files.
Note the default flags are to have the newly created file deleted
on first handle close.
Note also that an empty name is equivalent to calling
-`mapped_random_file(path_discovery::storage_backed_temporary_files_directory())` and the creation
+`mapped_uniquely_named_file(path_discovery::storage_backed_temporary_files_directory())` and the creation
parameter is ignored.
\note If the temporary file you are creating is not going to have its
diff --git a/include/llfio/v2.0/symlink_handle.hpp b/include/llfio/v2.0/symlink_handle.hpp
index f7bf57c4..722eca4c 100644
--- a/include/llfio/v2.0/symlink_handle.hpp
+++ b/include/llfio/v2.0/symlink_handle.hpp
@@ -404,7 +404,7 @@ public:
*/
LLFIO_MAKE_FREE_FUNCTION
static LLFIO_HEADERS_ONLY_MEMFUNC_SPEC result<symlink_handle> symlink(const path_handle &base, path_view_type path, mode _mode = mode::read, creation _creation = creation::open_existing, flag flags = flag::none) noexcept;
- /*! Create a symlink handle creating a randomly named symlink on a path.
+ /*! Create a symlink handle creating a uniquely named symlink on a path.
The symlink is opened exclusively with `creation::only_if_not_exist` so it
will never collide with nor overwrite any existing symlink.
@@ -412,7 +412,7 @@ public:
or failure to allocate memory.
*/
LLFIO_MAKE_FREE_FUNCTION
- static inline result<symlink_handle> random_symlink(const path_handle &dirpath, mode _mode = mode::write, flag flags = flag::none) noexcept
+ static inline result<symlink_handle> uniquely_named_symlink(const path_handle &dirpath, mode _mode = mode::write, flag flags = flag::none) noexcept
{
try
{