mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-05-02 14:58:03 +03:00
IOS/FS: Move /tmp clearing back to the IPC interface
Prevents /tmp from being cleared unnecessarily; clearing /tmp is normally only done once every time IOS is reloaded.
This commit is contained in:
parent
f743f100b1
commit
0543598574
4 changed files with 6 additions and 10 deletions
|
@ -84,12 +84,6 @@ Result<FileStatus> FileHandle::GetStatus() const
|
||||||
return m_fs->GetFileStatus(*m_fd);
|
return m_fs->GetFileStatus(*m_fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileSystem::Init()
|
|
||||||
{
|
|
||||||
if (Delete(0, 0, "/tmp") == ResultCode::Success)
|
|
||||||
CreateDirectory(0, 0, "/tmp", 0, {Mode::ReadWrite, Mode::ReadWrite, Mode::ReadWrite});
|
|
||||||
}
|
|
||||||
|
|
||||||
Result<FileHandle> FileSystem::CreateAndOpenFile(Uid uid, Gid gid, const std::string& path,
|
Result<FileHandle> FileSystem::CreateAndOpenFile(Uid uid, Gid gid, const std::string& path,
|
||||||
Modes modes)
|
Modes modes)
|
||||||
{
|
{
|
||||||
|
|
|
@ -216,9 +216,6 @@ public:
|
||||||
virtual Result<NandStats> GetNandStats() = 0;
|
virtual Result<NandStats> GetNandStats() = 0;
|
||||||
/// Get usage information about a directory (used cluster and inode counts).
|
/// Get usage information about a directory (used cluster and inode counts).
|
||||||
virtual Result<DirectoryStats> GetDirectoryStats(const std::string& path) = 0;
|
virtual Result<DirectoryStats> GetDirectoryStats(const std::string& path) = 0;
|
||||||
|
|
||||||
protected:
|
|
||||||
void Init();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include "Core/HW/Memmap.h"
|
#include "Core/HW/Memmap.h"
|
||||||
#include "Core/HW/SystemTimers.h"
|
#include "Core/HW/SystemTimers.h"
|
||||||
#include "Core/IOS/FS/FileSystem.h"
|
#include "Core/IOS/FS/FileSystem.h"
|
||||||
|
#include "Core/IOS/Uids.h"
|
||||||
|
|
||||||
namespace IOS::HLE::Device
|
namespace IOS::HLE::Device
|
||||||
{
|
{
|
||||||
|
@ -37,6 +38,11 @@ constexpr size_t CLUSTER_DATA_SIZE = 0x4000;
|
||||||
|
|
||||||
FS::FS(Kernel& ios, const std::string& device_name) : Device(ios, device_name)
|
FS::FS(Kernel& ios, const std::string& device_name) : Device(ios, device_name)
|
||||||
{
|
{
|
||||||
|
if (ios.GetFS()->Delete(PID_KERNEL, PID_KERNEL, "/tmp") == ResultCode::Success)
|
||||||
|
{
|
||||||
|
ios.GetFS()->CreateDirectory(PID_KERNEL, PID_KERNEL, "/tmp", 0,
|
||||||
|
{Mode::ReadWrite, Mode::ReadWrite, Mode::ReadWrite});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FS::DoState(PointerWrap& p)
|
void FS::DoState(PointerWrap& p)
|
||||||
|
|
|
@ -103,7 +103,6 @@ bool HostFileSystem::FstEntry::CheckPermission(Uid caller_uid, Gid caller_gid,
|
||||||
|
|
||||||
HostFileSystem::HostFileSystem(const std::string& root_path) : m_root_path{root_path}
|
HostFileSystem::HostFileSystem(const std::string& root_path) : m_root_path{root_path}
|
||||||
{
|
{
|
||||||
Init();
|
|
||||||
ResetFst();
|
ResetFst();
|
||||||
LoadFst();
|
LoadFst();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue