199 LLFIO_LOG_FUNCTION_CALL(0);
206 if(lockinuse.has_error())
208 if(lockinuse.error() != errc::timed_out)
210 return std::move(lockinuse).error();
216 return std::move(lockinuse).error();
219 memset(buffer, 0,
sizeof(buffer));
220 OUTCOME_TRYV(ret.read(0, {{buffer, 65535}}));
221 path_view temphpath(reinterpret_cast<filesystem::path::value_type *>(buffer));
222 result<file_handle> _temph(in_place_type<file_handle>);
228 return errc::no_lock_available;
230 temph = std::move(_temph.value());
237 return memory_map(std::move(ret), std::move(temph), std::move(lockinuse.value()), std::move(hmap), std::move(temphmap));
243 temph = std::move(_temph);
245 OUTCOME_TRYV(temph.truncate(HashIndexSize));
250 OUTCOME_TRY(temppath, temph.current_path());
252 memset(buffer, 0,
sizeof(buffer));
253 size_t bytes = temppath.native().size() *
sizeof(*temppath.c_str());
254 file_handle::const_buffer_type buffers[] = {{
reinterpret_cast<const byte *
>(temppath.c_str()), bytes}, {
reinterpret_cast<const byte *
>(buffer), 4096 - (bytes % 4096)}};
255 OUTCOME_TRYV(ret.truncate(65536));
256 OUTCOME_TRYV(ret.write({buffers, 0}));
265 lockinuse = std::move(lockinuse2);
266 return memory_map(std::move(ret), std::move(temph), std::move(lockinuse.value()), std::move(hmap), std::move(temphmap));
270 return error_from_exception();
Exclude only those requesting an exclusive lock on the same inode.
file_handle::io_result< file_handle::size_type > read(file_handle &self, file_handle::extent_type offset, std::initializer_list< file_handle::buffer_type > lst, deadline d=deadline()) noexcept
Definition: file_handle.hpp:553
static 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
Exclude those requesting any kind of lock on the same inode.
Ability to read and write (READ_CONTROL|FILE_READ_DATA|FILE_READ_ATTRIBUTES|FILE_READ_EA|FILE_WRITE_D...
static result< map_handle > map(size_type bytes, bool zeroed=false, section_handle::flag _flag=section_handle::flag::readwrite) noexcept
static result< file_handle > random_file(const path_handle &dirpath, mode _mode=mode::write, caching _caching=caching::temporary, flag flags=flag::none) noexcept
Definition: file_handle.hpp:143
bool is_valid() const noexcept
True if the handle is valid (and usually open)
Definition: handle.hpp:285
static result< section_handle > section(file_handle &backing, extent_type maximum_size, flag _flag) noexcept
Create a memory section backed by a file.
Cache reads and writes of data and metadata so they complete immediately, only sending any updates to...
Cache reads only. Writes of data and metadata do not complete until reaching storage (O_SYNC)...
If filesystem entry exists that is used, else one is created.
const path_handle & storage_backed_temporary_files_directory() noexcept
Returns a reference to an open handle to a verified temporary directory where files created are store...
const path_handle & memory_backed_temporary_files_directory() noexcept
Returns a reference to an open handle to a verified temporary directory where files created are store...
Filesystem entry must already exist.