disable hdd->hdd threading. only open log write on write to allow for reads. log fw/ams version.

hdd->hdd threading is disabled due to a bug in libusbhsfs which causes a deadlock if 2 fs calls happen at the same time.
This commit is contained in:
ITotalJustice
2025-06-17 00:57:46 +01:00
parent 6b099de63c
commit 99c1db3655
11 changed files with 133 additions and 79 deletions

View File

@@ -12,10 +12,14 @@ namespace fs {
struct FsPath {
FsPath() = default;
constexpr FsPath(const auto& str) { From(str); }
constexpr FsPath(const FsPath& p) { From(p); }
constexpr FsPath(const char* str) { From(str); }
constexpr FsPath(const std::string& str) { From(str); }
constexpr FsPath(const std::string_view& str) { From(str); }
constexpr void From(const FsPath& p) {
*this = p;
From(p.s);
}
constexpr void From(const char* str) {
@@ -40,6 +44,10 @@ struct FsPath {
return s;
}
constexpr auto starts_with(std::string_view str) const -> bool {
return !strncasecmp(s, str.data(), str.length());
}
constexpr auto empty() const {
return s[0] == '\0';
}
@@ -65,6 +73,11 @@ struct FsPath {
constexpr char& operator[](std::size_t idx) { return s[idx]; }
constexpr const char& operator[](std::size_t idx) const { return s[idx]; }
constexpr FsPath& operator=(const FsPath& p) noexcept {
From(p.s);
return *this;
}
constexpr FsPath operator+(const FsPath& v) const noexcept {
FsPath r{*this};
return r += v;
@@ -186,9 +199,6 @@ struct File {
FsFile m_native{};
std::FILE* m_stdio{};
s64 m_stdio_off{};
// sadly, fatfs doesn't support fstat, so we have to manually
// stat the file to get it's size.
FsPath m_path{};
};
struct Dir {