diff --git a/rpcs3/Emu/Cell/Modules/cellSysCache.cpp b/rpcs3/Emu/Cell/Modules/cellSysCache.cpp index d14d8d70ef..576805d6b8 100644 --- a/rpcs3/Emu/Cell/Modules/cellSysCache.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSysCache.cpp @@ -81,7 +81,7 @@ struct syscache_info { idm::select([](u32 /*id*/, lv2_file& file) { - if (file.file && std::memcmp("/dev_hdd1/", file.name.data(), 10) == 0) + if (file.file && file.mp->flags & lv2_mp_flag::cache) { file.lock = 2; } diff --git a/rpcs3/Emu/Cell/lv2/sys_fs.cpp b/rpcs3/Emu/Cell/lv2/sys_fs.cpp index d3b887bae7..afd754a6fd 100644 --- a/rpcs3/Emu/Cell/lv2/sys_fs.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_fs.cpp @@ -14,7 +14,7 @@ LOG_CHANNEL(sys_fs); lv2_fs_mount_point g_mp_sys_dev_root; lv2_fs_mount_point g_mp_sys_no_device; lv2_fs_mount_point g_mp_sys_dev_hdd0{"/dev_hdd0"}; -lv2_fs_mount_point g_mp_sys_dev_hdd1{"/dev_hdd1", 512, 32768, lv2_mp_flag::no_uid_gid}; +lv2_fs_mount_point g_mp_sys_dev_hdd1{"/dev_hdd1", 512, 32768, lv2_mp_flag::no_uid_gid + lv2_mp_flag::cache}; lv2_fs_mount_point g_mp_sys_dev_usb{"", 512, 4096, lv2_mp_flag::no_uid_gid}; lv2_fs_mount_point g_mp_sys_dev_bdvd{"", 2048, 65536, lv2_mp_flag::read_only + lv2_mp_flag::no_uid_gid}; lv2_fs_mount_point g_mp_sys_host_root{"", 512, 512, lv2_mp_flag::strict_get_block_size + lv2_mp_flag::no_uid_gid}; @@ -702,8 +702,7 @@ error_code sys_fs_close(ppu_thread& ppu, u32 fd) return CELL_EBADF; } - if (std::memcmp(file->name.data(), "/dev_hdd1/", 10) != 0 - && !(file->mp->flags & lv2_mp_flag::read_only) && file->flags & CELL_FS_O_ACCMODE) + if (!(file->mp->flags & (lv2_mp_flag::read_only + lv2_mp_flag::cache)) && file->flags & CELL_FS_O_ACCMODE) { // Special: Ensure temporary directory for gamedata writes will remain on disk before final gamedata commitment file->file.sync(); // For cellGameContentPermit atomicity diff --git a/rpcs3/Emu/Cell/lv2/sys_fs.h b/rpcs3/Emu/Cell/lv2/sys_fs.h index 3e1a014b6d..7ad2da538a 100644 --- a/rpcs3/Emu/Cell/lv2/sys_fs.h +++ b/rpcs3/Emu/Cell/lv2/sys_fs.h @@ -127,6 +127,7 @@ enum class lv2_mp_flag read_only, no_uid_gid, strict_get_block_size, + cache, __bitset_enum_max }; diff --git a/rpcs3/Emu/VFS.cpp b/rpcs3/Emu/VFS.cpp index 904852afbe..9975d46e4e 100644 --- a/rpcs3/Emu/VFS.cpp +++ b/rpcs3/Emu/VFS.cpp @@ -758,8 +758,7 @@ bool vfs::host::rename(const std::string& from, const std::string& to, const lv2 file.restore_data.seek_pos = file.file.pos(); - if (std::memcmp(file.name.data(), "/dev_hdd1/", 10) != 0 - && !(file.mp->flags & lv2_mp_flag::read_only) && file.flags & CELL_FS_O_ACCMODE) + if (!(file.mp->flags & (lv2_mp_flag::read_only + lv2_mp_flag::cache)) && file.flags & CELL_FS_O_ACCMODE) { file.file.sync(); // For cellGameContentPermit atomicity }