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:
Léo Lam 2018-03-14 17:11:21 +01:00 committed by Léo Lam
parent f743f100b1
commit 0543598574
4 changed files with 6 additions and 10 deletions

View File

@ -84,12 +84,6 @@ Result<FileStatus> FileHandle::GetStatus() const
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,
Modes modes)
{

View File

@ -216,9 +216,6 @@ public:
virtual Result<NandStats> GetNandStats() = 0;
/// Get usage information about a directory (used cluster and inode counts).
virtual Result<DirectoryStats> GetDirectoryStats(const std::string& path) = 0;
protected:
void Init();
};
template <typename T>

View File

@ -16,6 +16,7 @@
#include "Core/HW/Memmap.h"
#include "Core/HW/SystemTimers.h"
#include "Core/IOS/FS/FileSystem.h"
#include "Core/IOS/Uids.h"
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)
{
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)

View File

@ -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}
{
Init();
ResetFst();
LoadFst();
}