This commit is contained in:
@ -129,7 +129,7 @@ auto open_file::adjust_cache_size(std::uint64_t file_size, bool shrink)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (file_size > fsi_.size) {
|
if (file_size > fsi_.size) {
|
||||||
auto size = file_size - file_size;
|
auto size = file_size - fsi_.size;
|
||||||
auto res = shrink ? cache_size_mgr::instance().shrink(size)
|
auto res = shrink ? cache_size_mgr::instance().shrink(size)
|
||||||
: cache_size_mgr::instance().expand(size);
|
: cache_size_mgr::instance().expand(size);
|
||||||
if (res == api_error::success) {
|
if (res == api_error::success) {
|
||||||
@ -143,7 +143,7 @@ auto open_file::adjust_cache_size(std::uint64_t file_size, bool shrink)
|
|||||||
return set_api_error(res);
|
return set_api_error(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto size = fsi_.size = file_size;
|
auto size = fsi_.size - file_size;
|
||||||
auto res = shrink ? cache_size_mgr::instance().expand(size)
|
auto res = shrink ? cache_size_mgr::instance().expand(size)
|
||||||
: cache_size_mgr::instance().shrink(size);
|
: cache_size_mgr::instance().shrink(size);
|
||||||
if (res == api_error::success) {
|
if (res == api_error::success) {
|
||||||
|
Reference in New Issue
Block a user