Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve vfs::host::rename #14703

Merged
merged 1 commit into from
Oct 3, 2023
Merged

Improve vfs::host::rename #14703

merged 1 commit into from
Oct 3, 2023

Conversation

elad335
Copy link
Contributor

@elad335 elad335 commented Oct 3, 2023

Avoid flushing files to disk when not needed.

@elad335 elad335 added Filesystem Optimization Optimizes existing code Gamedata labels Oct 3, 2023
@@ -929,9 +929,20 @@ std::string vfs::host::hash_path(const std::string& path, const std::string& dev

bool vfs::host::rename(const std::string& from, const std::string& to, const lv2_fs_mount_point* mp, bool overwrite, bool lock)
{
if (fs::rename(from, to, overwrite))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this is safe to do...

Copy link
Contributor Author

@elad335 elad335 Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workaround that closes and reopens file handles was added for Windows because sometimes it won't allow to move a directory with opened files in it. If it succeeds once, it should be safe.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved it to lock scope.

@elad335 elad335 force-pushed the bps branch 3 times, most recently from 7e9f46e to 37cbb82 Compare October 3, 2023 10:34
@elad335 elad335 merged commit c3f1d39 into RPCS3:master Oct 3, 2023
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants