MemStick screen: Call free_disk_space from async tasks

See #19522
This commit is contained in:
Henrik Rydgård
2024-10-11 11:55:27 +02:00
parent 3f3fd5bf64
commit 8a5be21140
13 changed files with 69 additions and 30 deletions

View File

@@ -606,20 +606,18 @@ int MetaFileSystem::ReadEntireFile(const std::string &filename, std::vector<u8>
return 0;
}
u64 MetaFileSystem::FreeSpace(const std::string &path)
{
u64 MetaFileSystem::FreeDiskSpace(const std::string &path) {
std::lock_guard<std::recursive_mutex> guard(lock);
std::string of;
IFileSystem *system;
int error = MapFilePath(path, of, &system);
if (error == 0)
return system->FreeSpace(of);
return system->FreeDiskSpace(of);
else
return 0;
}
void MetaFileSystem::DoState(PointerWrap &p)
{
void MetaFileSystem::DoState(PointerWrap &p) {
std::lock_guard<std::recursive_mutex> guard(lock);
auto s = p.Section("MetaFileSystem", 1);
@@ -634,8 +632,7 @@ void MetaFileSystem::DoState(PointerWrap &p)
u32 n = (u32) fileSystems.size();
Do(p, n);
bool skipPfat0 = false;
if (n != (u32) fileSystems.size())
{
if (n != (u32) fileSystems.size()) {
if (n == (u32) fileSystems.size() - 1) {
skipPfat0 = true;
} else {