Remount all references in Remount func.

This commit is contained in:
shenweip 2013-11-24 18:46:24 +08:00 committed by Henrik Rydgård
parent 5ef34e37b4
commit a611ed3930
3 changed files with 8 additions and 8 deletions

View File

@ -255,9 +255,12 @@ void MetaFileSystem::Unmount(std::string prefix, IFileSystem *system)
fileSystems.erase(std::remove(fileSystems.begin(), fileSystems.end(), x), fileSystems.end());
}
void MetaFileSystem::Remount(std::string prefix, IFileSystem *oldSystem, IFileSystem *newSystem) {
Unmount(prefix, oldSystem);
Mount(prefix, newSystem);
void MetaFileSystem::Remount(IFileSystem *oldSystem, IFileSystem *newSystem) {
for (auto it = fileSystems.begin(); it != fileSystems.end(); ++it) {
if (it->system == oldSystem) {
it->system = newSystem;
}
}
}
IFileSystem *MetaFileSystem::GetSystem(const std::string &prefix) {

View File

@ -51,7 +51,7 @@ public:
void Mount(std::string prefix, IFileSystem *system);
void Unmount(std::string prefix, IFileSystem *system);
void Remount(std::string prefix, IFileSystem *oldSystem, IFileSystem *newSystem);
void Remount(IFileSystem *oldSystem, IFileSystem *newSystem);
IFileSystem *GetSystem(const std::string &prefix);

View File

@ -463,10 +463,7 @@ void __UmdReplace(std::string filepath) {
return;
umd2 = new ISOFileSystem(&pspFileSystem, bd);
pspFileSystem.Remount("umd0:", currentUMD, umd2);
pspFileSystem.Remount("umd1:", currentUMD, umd2);
pspFileSystem.Remount("disc0:", currentUMD, umd2);
pspFileSystem.Remount("umd:", currentUMD, umd2);
pspFileSystem.Remount(currentUMD, umd2);
}
delete currentUMD;