unit tests and fixes
This commit is contained in:
@ -189,13 +189,13 @@ auto file_manager::evict_file(const std::string &api_path) -> bool {
|
|||||||
open_file_lookup_.erase(api_path);
|
open_file_lookup_.erase(api_path);
|
||||||
|
|
||||||
auto allocated = closeable_file ? closeable_file->get_allocated() : true;
|
auto allocated = closeable_file ? closeable_file->get_allocated() : true;
|
||||||
|
|
||||||
auto removed = remove_source_and_shrink_cache(api_path, source_path, fsi.size,
|
|
||||||
allocated);
|
|
||||||
open_lock.unlock();
|
open_lock.unlock();
|
||||||
|
|
||||||
closeable_file.reset();
|
closeable_file.reset();
|
||||||
|
|
||||||
|
auto removed = remove_source_and_shrink_cache(api_path, source_path, fsi.size,
|
||||||
|
allocated);
|
||||||
|
|
||||||
if (removed) {
|
if (removed) {
|
||||||
event_system::instance().raise<filesystem_item_evicted>(api_path,
|
event_system::instance().raise<filesystem_item_evicted>(api_path,
|
||||||
source_path);
|
source_path);
|
||||||
@ -387,10 +387,11 @@ auto file_manager::open(const std::string &api_path, bool directory,
|
|||||||
return open(api_path, directory, ofd, handle, file, nullptr);
|
return open(api_path, directory, ofd, handle, file, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto file_manager::open(
|
auto file_manager::open(const std::string &api_path, bool directory,
|
||||||
const std::string &api_path, bool directory, const open_file_data &ofd,
|
const open_file_data &ofd, std::uint64_t &handle,
|
||||||
std::uint64_t &handle, std::shared_ptr<i_open_file> &file,
|
std::shared_ptr<i_open_file> &file,
|
||||||
std::shared_ptr<i_closeable_open_file> closeable_file) -> api_error {
|
std::shared_ptr<i_closeable_open_file> closeable_file)
|
||||||
|
-> api_error {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
const auto create_and_add_handle =
|
const auto create_and_add_handle =
|
||||||
@ -754,8 +755,8 @@ auto file_manager::rename_directory(const std::string &from_api_path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto file_manager::rename_file(const std::string &from_api_path,
|
auto file_manager::rename_file(const std::string &from_api_path,
|
||||||
const std::string &to_api_path,
|
const std::string &to_api_path, bool overwrite)
|
||||||
bool overwrite) -> api_error {
|
-> api_error {
|
||||||
if (not provider_.is_rename_supported()) {
|
if (not provider_.is_rename_supported()) {
|
||||||
return api_error::not_implemented;
|
return api_error::not_implemented;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user