strat: revise fs unsupported operation results, add overflow utils

This commit is contained in:
Michael Scire
2022-03-13 01:32:34 -08:00
parent 46f2d34f25
commit b7ed9c58bb
31 changed files with 265 additions and 142 deletions

View File

@@ -64,7 +64,7 @@ namespace ams::fs {
virtual Result SetSize(s64 size) override {
AMS_UNUSED(size);
return fs::ResultUnsupportedOperationInMemoryStorageA();
return fs::ResultUnsupportedSetSizeForMemoryStorage();
}
virtual Result OperateRange(void *dst, size_t dst_size, OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override {
@@ -79,7 +79,7 @@ namespace ams::fs {
reinterpret_cast<QueryRangeInfo *>(dst)->Clear();
return ResultSuccess();
default:
return fs::ResultUnsupportedOperationInMemoryStorageB();
return fs::ResultUnsupportedOperateRangeForMemoryStorage();
}
}
};

View File

@@ -52,12 +52,12 @@ namespace ams::fs {
AMS_ASSERT(!need_append);
AMS_UNUSED(buffer);
return fs::ResultUnsupportedOperationInReadOnlyFileA();
return fs::ResultUnsupportedWriteForReadOnlyFile();
}
virtual Result DoSetSize(s64 size) override final {
R_TRY(this->DrySetSize(size, fs::OpenMode_Read));
return fs::ResultUnsupportedOperationInReadOnlyFileA();
return fs::ResultUnsupportedWriteForReadOnlyFile();
}
virtual Result DoOperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override final {
@@ -66,7 +66,7 @@ namespace ams::fs {
case OperationId::QueryRange:
return m_base_file->OperateRange(dst, dst_size, op_id, offset, size, src, src_size);
default:
return fs::ResultUnsupportedOperationInReadOnlyFileB();
return fs::ResultUnsupportedOperateRangeForReadOnlyFile();
}
}
public:
@@ -115,57 +115,57 @@ namespace ams::fs {
virtual Result DoCreateFile(const fs::Path &path, s64 size, int flags) override final {
AMS_UNUSED(path, size, flags);
return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA();
return fs::ResultUnsupportedWriteForReadOnlyFileSystem();
}
virtual Result DoDeleteFile(const fs::Path &path) override final {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA();
return fs::ResultUnsupportedWriteForReadOnlyFileSystem();
}
virtual Result DoCreateDirectory(const fs::Path &path) override final {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA();
return fs::ResultUnsupportedWriteForReadOnlyFileSystem();
}
virtual Result DoDeleteDirectory(const fs::Path &path) override final {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA();
return fs::ResultUnsupportedWriteForReadOnlyFileSystem();
}
virtual Result DoDeleteDirectoryRecursively(const fs::Path &path) override final {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA();
return fs::ResultUnsupportedWriteForReadOnlyFileSystem();
}
virtual Result DoRenameFile(const fs::Path &old_path, const fs::Path &new_path) override final {
AMS_UNUSED(old_path, new_path);
return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA();
return fs::ResultUnsupportedWriteForReadOnlyFileSystem();
}
virtual Result DoRenameDirectory(const fs::Path &old_path, const fs::Path &new_path) override final {
AMS_UNUSED(old_path, new_path);
return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA();
return fs::ResultUnsupportedWriteForReadOnlyFileSystem();
}
virtual Result DoCleanDirectoryRecursively(const fs::Path &path) override final {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA();
return fs::ResultUnsupportedWriteForReadOnlyFileSystem();
}
virtual Result DoGetFreeSpaceSize(s64 *out, const fs::Path &path) override final {
AMS_UNUSED(out, path);
return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateB();
return fs::ResultUnsupportedCommitProvisionallyForReadOnlyFileSystem();
}
virtual Result DoGetTotalSpaceSize(s64 *out, const fs::Path &path) override final {
AMS_UNUSED(out, path);
return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateB();
return fs::ResultUnsupportedCommitProvisionallyForReadOnlyFileSystem();
}
virtual Result DoCommitProvisionally(s64 counter) override final {
AMS_UNUSED(counter);
return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateC();
return fs::ResultUnsupportedGetTotalSpaceSizeForReadOnlyFileSystem();
}
};

View File

@@ -57,7 +57,7 @@ namespace ams::fs {
virtual Result DoOperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override final {
AMS_UNUSED(src, src_size);
R_UNLESS(op_id == OperationId::QueryRange, fs::ResultUnsupportedOperationInFileServiceObjectAdapterA());
R_UNLESS(op_id == OperationId::QueryRange, fs::ResultUnsupportedOperateRangeForFileServiceObjectAdapter());
R_UNLESS(dst_size == sizeof(FileQueryRangeInfo), fs::ResultInvalidSize());
return fsFileOperateRange(std::addressof(m_base_file), static_cast<::FsOperationId>(op_id), offset, size, reinterpret_cast<::FsRangeInfo *>(dst));

View File

@@ -107,13 +107,13 @@ namespace ams::fs {
virtual Result SetSize(s64 size) override {
/* Ensure we're initialized and validate arguments. */
R_UNLESS(this->IsValid(), fs::ResultNotInitialized());
R_UNLESS(m_resizable, fs::ResultUnsupportedOperationInSubStorageA());
R_UNLESS(m_resizable, fs::ResultUnsupportedSetSizeForNotResizableSubStorage());
R_UNLESS(IStorage::CheckOffsetAndSize(m_offset, size), fs::ResultInvalidSize());
/* Ensure that we're allowed to set size. */
s64 cur_size;
R_TRY(m_base_storage->GetSize(std::addressof(cur_size)));
R_UNLESS(cur_size == m_offset + m_size, fs::ResultUnsupportedOperationInSubStorageB());
R_UNLESS(cur_size == m_offset + m_size, fs::ResultUnsupportedSetSizeForResizableSubStorage());
/* Set the size. */
R_TRY(m_base_storage->SetSize(m_offset + size));
@@ -132,7 +132,7 @@ namespace ams::fs {
virtual Result OperateRange(void *dst, size_t dst_size, OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override {
/* Ensure we're initialized. */
R_UNLESS(this->IsValid(), fs::ResultNotInitialized());
R_UNLESS(this->IsValid(), fs::ResultNotInitialized());
/* Succeed immediately on zero-sized operation. */
R_SUCCEED_IF(size == 0);

View File

@@ -109,12 +109,12 @@ namespace ams::fssystem {
virtual Result Write(s64 offset, const void *buffer, size_t size) override {
AMS_UNUSED(offset, buffer, size);
R_THROW(fs::ResultUnsupportedOperationInAesCtrCounterExtendedStorageA());
R_THROW(fs::ResultUnsupportedWriteForAesCtrCounterExtendedStorage());
}
virtual Result SetSize(s64 size) override {
AMS_UNUSED(size);
R_THROW(fs::ResultUnsupportedOperationInAesCtrCounterExtendedStorageB());
R_THROW(fs::ResultUnsupportedSetSizeForAesCtrCounterExtendedStorage());
}
private:
Result Initialize(IAllocator *allocator, const void *key, size_t key_size, u32 secure_value, fs::SubStorage data_storage, fs::SubStorage table_storage);

View File

@@ -110,7 +110,7 @@ namespace ams::fssystem {
virtual Result Read(s64 offset, void *buffer, size_t size) override;
virtual Result Write(s64 offset, const void *buffer, size_t size) override;
virtual Result SetSize(s64) override { R_THROW(fs::ResultUnsupportedOperationInBlockCacheBufferedStorageA()); }
virtual Result SetSize(s64) override { R_THROW(fs::ResultUnsupportedSetSizeForBlockCacheBufferedStorage()); }
virtual Result GetSize(s64 *out) override;
virtual Result Flush() override;

View File

@@ -1424,7 +1424,7 @@ namespace ams::fssystem {
R_TRY(m_core.QueryRange(dst, dst_size, offset, size));
break;
default:
R_THROW(fs::ResultUnsupportedOperationInCompressedStorageB());
R_THROW(fs::ResultUnsupportedOperateRangeForCompressedStorage());
}
R_SUCCEED();
@@ -1440,13 +1440,13 @@ namespace ams::fssystem {
virtual Result Write(s64 offset, const void *buffer, size_t size) override {
AMS_UNUSED(offset, buffer, size);
R_THROW(fs::ResultUnsupportedOperationInCompressedStorageA());
R_THROW(fs::ResultUnsupportedWriteForCompressedStorage());
}
virtual Result SetSize(s64 size) override {
AMS_UNUSED(size);
/* NOTE: Is Nintendo returning the wrong result here? */
R_THROW(fs::ResultUnsupportedOperationInIndirectStorageB());
R_THROW(fs::ResultUnsupportedSetSizeForIndirectStorage());
}
};

View File

@@ -162,7 +162,7 @@ namespace ams::fssystem {
virtual Result Read(s64 offset, void *buffer, size_t size) override;
virtual Result Write(s64 offset, const void *buffer, size_t size) override;
virtual Result SetSize(s64 size) override { AMS_UNUSED(size); return fs::ResultUnsupportedOperationInHierarchicalIntegrityVerificationStorageA(); }
virtual Result SetSize(s64 size) override { AMS_UNUSED(size); return fs::ResultUnsupportedSetSizeForHierarchicalIntegrityVerificationStorage(); }
virtual Result GetSize(s64 *out) override;
virtual Result Flush() override;

View File

@@ -147,12 +147,12 @@ namespace ams::fssystem {
virtual Result Write(s64 offset, const void *buffer, size_t size) override {
AMS_UNUSED(offset, buffer, size);
R_THROW(fs::ResultUnsupportedOperationInIndirectStorageA());
R_THROW(fs::ResultUnsupportedWriteForIndirectStorage());
}
virtual Result SetSize(s64 size) override {
AMS_UNUSED(size);
R_THROW(fs::ResultUnsupportedOperationInIndirectStorageB());
R_THROW(fs::ResultUnsupportedSetSizeForIndirectStorage());
}
protected:
BucketTree &GetEntryTable() { return m_table; }

View File

@@ -48,7 +48,7 @@ namespace ams::fssystem {
return m_integrity_storage.Write(offset, buffer, size);
}
virtual Result SetSize(s64 size) override { AMS_UNUSED(size); return fs::ResultUnsupportedOperationInIntegrityRomFsStorageA(); }
virtual Result SetSize(s64 size) override { AMS_UNUSED(size); return fs::ResultUnsupportedSetSizeForIntegrityRomFsStorage(); }
virtual Result GetSize(s64 *out) override {
return m_integrity_storage.GetSize(out);

View File

@@ -55,7 +55,7 @@ namespace ams::fssystem {
virtual Result Read(s64 offset, void *buffer, size_t size) override;
virtual Result Write(s64 offset, const void *buffer, size_t size) override;
virtual Result SetSize(s64 size) override { AMS_UNUSED(size); return fs::ResultUnsupportedOperationInIntegrityVerificationStorageA(); }
virtual Result SetSize(s64 size) override { AMS_UNUSED(size); return fs::ResultUnsupportedSetSizeForIntegrityVerificationStorage(); }
virtual Result GetSize(s64 *out) override;
virtual Result Flush() override;

View File

@@ -56,12 +56,12 @@ namespace ams::fssystem {
virtual Result Write(s64 offset, const void *buffer, size_t size) override {
AMS_UNUSED(offset, buffer, size);
R_THROW(fs::ResultUnsupportedOperationInZeroStorageA());
R_THROW(fs::ResultUnsupportedWriteForZeroStorage());
}
virtual Result SetSize(s64 size) override {
AMS_UNUSED(size);
R_THROW(fs::ResultUnsupportedOperationInZeroStorageB());
R_THROW(fs::ResultUnsupportedSetSizeForZeroStorage());
}
};
private:

View File

@@ -86,7 +86,7 @@ namespace ams::fs {
R_UNLESS(IStorage::CheckOffsetAndSize(offset, size), fs::ResultOutOfRange());
return m_base_file->OperateRange(dst, dst_size, op_id, offset, size, src, src_size);
default:
return fs::ResultUnsupportedOperationInFileStorageA();
return fs::ResultUnsupportedOperateRangeForFileStorage();
}
}
@@ -171,7 +171,7 @@ namespace ams::fs {
return QueryRange(static_cast<QueryRangeInfo *>(dst), m_handle, offset, size);
default:
return fs::ResultUnsupportedOperationInFileStorageB();
return fs::ResultUnsupportedOperateRangeForFileHandleStorage();
}
}

View File

@@ -221,12 +221,12 @@ namespace ams::fs {
virtual Result DoWrite(s64 offset, const void *buffer, size_t size, const fs::WriteOption &option) override {
AMS_UNUSED(offset, buffer, size, option);
return fs::ResultUnsupportedOperationInRomFsFileA();
return fs::ResultUnsupportedWriteForRomFsFile();
}
virtual Result DoSetSize(s64 size) override {
AMS_UNUSED(size);
return fs::ResultUnsupportedOperationInRomFsFileA();
return fs::ResultUnsupportedWriteForRomFsFile();
}
virtual Result DoOperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override {
@@ -245,7 +245,7 @@ namespace ams::fs {
return this->GetStorage()->OperateRange(dst, dst_size, op_id, m_start + offset, operate_size, src, src_size);
}
default:
return fs::ResultUnsupportedOperationInRomFsFileB();
return fs::ResultUnsupportedOperateRangeForRomFsFile();
}
}
public:
@@ -447,37 +447,37 @@ namespace ams::fs {
Result RomFsFileSystem::DoCreateFile(const fs::Path &path, s64 size, int flags) {
AMS_UNUSED(path, size, flags);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
return fs::ResultUnsupportedWriteForRomFsFileSystem();
}
Result RomFsFileSystem::DoDeleteFile(const fs::Path &path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
return fs::ResultUnsupportedWriteForRomFsFileSystem();
}
Result RomFsFileSystem::DoCreateDirectory(const fs::Path &path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
return fs::ResultUnsupportedWriteForRomFsFileSystem();
}
Result RomFsFileSystem::DoDeleteDirectory(const fs::Path &path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
return fs::ResultUnsupportedWriteForRomFsFileSystem();
}
Result RomFsFileSystem::DoDeleteDirectoryRecursively(const fs::Path &path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
return fs::ResultUnsupportedWriteForRomFsFileSystem();
}
Result RomFsFileSystem::DoRenameFile(const fs::Path &old_path, const fs::Path &new_path) {
AMS_UNUSED(old_path, new_path);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
return fs::ResultUnsupportedWriteForRomFsFileSystem();
}
Result RomFsFileSystem::DoRenameDirectory(const fs::Path &old_path, const fs::Path &new_path) {
AMS_UNUSED(old_path, new_path);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
return fs::ResultUnsupportedWriteForRomFsFileSystem();
}
Result RomFsFileSystem::DoGetEntryType(fs::DirectoryEntryType *out, const fs::Path &path) {
@@ -540,17 +540,17 @@ namespace ams::fs {
Result RomFsFileSystem::DoGetTotalSpaceSize(s64 *out, const fs::Path &path) {
AMS_UNUSED(out, path);
return fs::ResultUnsupportedOperationInRomFsFileSystemC();
return fs::ResultUnsupportedGetTotalSpaceSizeForRomFsFileSystem();
}
Result RomFsFileSystem::DoCleanDirectoryRecursively(const fs::Path &path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
return fs::ResultUnsupportedWriteForRomFsFileSystem();
}
Result RomFsFileSystem::DoCommitProvisionally(s64 counter) {
AMS_UNUSED(counter);
return fs::ResultUnsupportedOperationInRomFsFileSystemB();
return fs::ResultUnsupportedCommitProvisionallyForRomFsFileSystem();
}
Result RomFsFileSystem::DoRollback() {

View File

@@ -64,7 +64,7 @@ namespace ams::fs::impl {
}
default:
{
R_THROW(fs::ResultUnsupportedOperationInStorageServiceObjectAdapterA());
R_THROW(fs::ResultUnsupportedOperateRangeForStorageServiceObjectAdapter());
}
}
}

View File

@@ -245,7 +245,7 @@ namespace ams::fssystem {
return ResultSuccess();
}
default:
return fs::ResultUnsupportedOperationInAesCtrCounterExtendedStorageC();
return fs::ResultUnsupportedOperateRangeForAesCtrCounterExtendedStorage();
}
}

View File

@@ -135,7 +135,7 @@ namespace ams::fssystem {
template<typename BasePointer>
Result AesCtrStorage<BasePointer>::SetSize(s64 size) {
AMS_UNUSED(size);
return fs::ResultUnsupportedOperationInAesCtrStorageA();
return fs::ResultUnsupportedSetSizeForAesCtrStorage();
}
template<typename BasePointer>

View File

@@ -395,7 +395,7 @@ namespace ams::fssystem {
}
case fs::OperationId::Invalidate:
{
R_UNLESS(m_storage_type != fs::StorageType_SaveData, fs::ResultUnsupportedOperationInBlockCacheBufferedStorageB());
R_UNLESS(m_storage_type != fs::StorageType_SaveData, fs::ResultUnsupportedOperateRangeForNonSaveDataBlockCacheBufferedStorage());
R_TRY(this->InvalidateImpl());
R_SUCCEED();
}
@@ -405,7 +405,7 @@ namespace ams::fssystem {
R_SUCCEED();
}
default:
R_THROW(fs::ResultUnsupportedOperationInBlockCacheBufferedStorageC());
R_THROW(fs::ResultUnsupportedOperateRangeForBlockCacheBufferedStorage());
}
}

View File

@@ -348,7 +348,7 @@ namespace ams::fssystem {
Result DirectorySaveDataFileSystem::DoCommitProvisionally(s64 counter) {
/* Check that we support multi-commit. */
R_UNLESS(m_is_multi_commit_supported, fs::ResultUnsupportedOperationInDirectorySaveDataFileSystemA());
R_UNLESS(m_is_multi_commit_supported, fs::ResultUnsupportedCommitProvisionallyForDirectorySaveDataFileSystem());
/* Do nothing. */
AMS_UNUSED(counter);

View File

@@ -330,7 +330,7 @@ namespace ams::fssystem {
return ResultSuccess();
}
default:
return fs::ResultUnsupportedOperationInHierarchicalIntegrityVerificationStorageB();
return fs::ResultUnsupportedOperateRangeForHierarchicalIntegrityVerificationStorage();
}
}

View File

@@ -53,7 +53,7 @@ namespace ams::fssystem {
virtual Result SetSize(s64 size) override {
AMS_UNUSED(size);
return fs::ResultUnsupportedOperationInHierarchicalSha256StorageA();
return fs::ResultUnsupportedSetSizeForHierarchicalSha256Storage();
}
};

View File

@@ -171,7 +171,7 @@ namespace ams::fssystem {
R_SUCCEED();
}
default:
return fs::ResultUnsupportedOperationInIndirectStorageC();
return fs::ResultUnsupportedOperateRangeForIndirectStorage();
}
R_SUCCEED();

View File

@@ -332,7 +332,7 @@ namespace ams::fssystem {
case fs::OperationId::Invalidate:
{
/* Only allow cache invalidation for RomFs. */
R_UNLESS(m_storage_type != fs::StorageType_SaveData, fs::ResultUnsupportedOperationInIntegrityVerificationStorageB());
R_UNLESS(m_storage_type != fs::StorageType_SaveData, fs::ResultUnsupportedOperateRangeForNonSaveDataIntegrityVerificationStorage());
/* Operate on our storages. */
@@ -357,7 +357,7 @@ namespace ams::fssystem {
return ResultSuccess();
}
default:
return fs::ResultUnsupportedOperationInIntegrityVerificationStorageC();
return fs::ResultUnsupportedOperateRangeForIntegrityVerificationStorage();
}
}

View File

@@ -303,7 +303,7 @@ namespace ams::fssystem {
static_cast<fs::QueryRangeInfo *>(dst)->Clear();
R_SUCCEED();
default:
R_THROW(fs::ResultUnsupportedOperationInLocalFileA());
R_THROW(fs::ResultUnsupportedOperateRangeForTmFileSystemFile());
}
}
public:
@@ -619,7 +619,7 @@ namespace ams::fssystem {
static_cast<fs::QueryRangeInfo *>(dst)->Clear();
R_SUCCEED();
default:
R_THROW(fs::ResultUnsupportedOperationInLocalFileA());
R_THROW(fs::ResultUnsupportedOperateRangeForTmFileSystemFile());
}
}
public:

View File

@@ -212,12 +212,12 @@ namespace ams::fssystem {
virtual Result Write(s64 offset, const void *buffer, size_t size) override {
AMS_UNUSED(offset, buffer, size);
return fs::ResultUnsupportedOperationInAesCtrStorageExternalA();
return fs::ResultUnsupportedWriteForAesCtrStorageExternal();
}
virtual Result SetSize(s64 size) override {
AMS_UNUSED(size);
return fs::ResultUnsupportedOperationInAesCtrStorageExternalB();
return fs::ResultUnsupportedSetSizeForAesCtrStorageExternal();
}
};
@@ -254,7 +254,7 @@ namespace ams::fssystem {
return ResultSuccess();
}
default:
return fs::ResultUnsupportedOperationInSwitchStorageA();
return fs::ResultUnsupportedOperateRangeForSwitchStorage();
}
}

View File

@@ -70,7 +70,7 @@ namespace ams::fssystem {
/* Ensure appending is not required. */
bool needs_append;
R_TRY(this->DryWrite(std::addressof(needs_append), offset, size, option, m_mode));
R_UNLESS(!needs_append, fs::ResultUnsupportedOperationInPartitionFileA());
R_UNLESS(!needs_append, fs::ResultUnsupportedWriteForPartitionFile());
/* Appending is prohibited. */
AMS_ASSERT((m_mode & fs::OpenMode_AllowAppend) == 0);
@@ -85,7 +85,7 @@ namespace ams::fssystem {
virtual Result DoSetSize(s64 size) override final {
R_TRY(this->DrySetSize(size, m_mode));
R_RETURN(fs::ResultUnsupportedOperationInPartitionFileA());
R_RETURN(fs::ResultUnsupportedWriteForPartitionFile());
}
virtual Result DoOperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override final {
@@ -93,12 +93,12 @@ namespace ams::fssystem {
switch (op_id) {
case fs::OperationId::Invalidate:
R_UNLESS((m_mode & fs::OpenMode_Read) != 0, fs::ResultReadNotPermitted());
R_UNLESS((m_mode & fs::OpenMode_Write) == 0, fs::ResultUnsupportedOperationInPartitionFileB());
R_UNLESS((m_mode & fs::OpenMode_Write) == 0, fs::ResultUnsupportedOperateRangeForPartitionFile());
break;
case fs::OperationId::QueryRange:
break;
default:
R_THROW(fs::ResultUnsupportedOperationInPartitionFileB());
R_THROW(fs::ResultUnsupportedOperateRangeForPartitionFile());
}
/* Validate offset and size. */
@@ -408,55 +408,55 @@ namespace ams::fssystem {
template <typename MetaType>
Result PartitionFileSystemCore<MetaType>::DoCleanDirectoryRecursively(const fs::Path &path) {
AMS_UNUSED(path);
R_THROW(fs::ResultUnsupportedOperationInPartitionFileSystemA());
R_THROW(fs::ResultUnsupportedWriteForPartitionFileSystem());
}
template <typename MetaType>
Result PartitionFileSystemCore<MetaType>::DoCreateDirectory(const fs::Path &path) {
AMS_UNUSED(path);
R_THROW(fs::ResultUnsupportedOperationInPartitionFileSystemA());
R_THROW(fs::ResultUnsupportedWriteForPartitionFileSystem());
}
template <typename MetaType>
Result PartitionFileSystemCore<MetaType>::DoCreateFile(const fs::Path &path, s64 size, int option) {
AMS_UNUSED(path, size, option);
R_THROW(fs::ResultUnsupportedOperationInPartitionFileSystemA());
R_THROW(fs::ResultUnsupportedWriteForPartitionFileSystem());
}
template <typename MetaType>
Result PartitionFileSystemCore<MetaType>::DoDeleteDirectory(const fs::Path &path) {
AMS_UNUSED(path);
R_THROW(fs::ResultUnsupportedOperationInPartitionFileSystemA());
R_THROW(fs::ResultUnsupportedWriteForPartitionFileSystem());
}
template <typename MetaType>
Result PartitionFileSystemCore<MetaType>::DoDeleteDirectoryRecursively(const fs::Path &path) {
AMS_UNUSED(path);
R_THROW(fs::ResultUnsupportedOperationInPartitionFileSystemA());
R_THROW(fs::ResultUnsupportedWriteForPartitionFileSystem());
}
template <typename MetaType>
Result PartitionFileSystemCore<MetaType>::DoDeleteFile(const fs::Path &path) {
AMS_UNUSED(path);
R_THROW(fs::ResultUnsupportedOperationInPartitionFileSystemA());
R_THROW(fs::ResultUnsupportedWriteForPartitionFileSystem());
}
template <typename MetaType>
Result PartitionFileSystemCore<MetaType>::DoRenameDirectory(const fs::Path &old_path, const fs::Path &new_path) {
AMS_UNUSED(old_path, new_path);
R_THROW(fs::ResultUnsupportedOperationInPartitionFileSystemA());
R_THROW(fs::ResultUnsupportedWriteForPartitionFileSystem());
}
template <typename MetaType>
Result PartitionFileSystemCore<MetaType>::DoRenameFile(const fs::Path &old_path, const fs::Path &new_path) {
AMS_UNUSED(old_path, new_path);
R_THROW(fs::ResultUnsupportedOperationInPartitionFileSystemA());
R_THROW(fs::ResultUnsupportedWriteForPartitionFileSystem());
}
template <typename MetaType>
Result PartitionFileSystemCore<MetaType>::DoCommitProvisionally(s64 counter) {
AMS_UNUSED(counter);
R_THROW(fs::ResultUnsupportedOperationInPartitionFileSystemB());
R_THROW(fs::ResultUnsupportedCommitProvisionallyForPartitionFileSystem());
}
template class PartitionFileSystemCore<PartitionFileSystemMeta>;

View File

@@ -119,12 +119,12 @@ namespace ams::fssystem {
virtual Result Write(s64 offset, const void *buffer, size_t size) override {
AMS_UNUSED(offset, buffer, size);
return fs::ResultUnsupportedOperationInReadOnlyBlockCacheStorageA();
return fs::ResultUnsupportedWriteForReadOnlyBlockCacheStorage();
}
virtual Result SetSize(s64 size) override {
AMS_UNUSED(size);
return fs::ResultUnsupportedOperationInReadOnlyBlockCacheStorageB();
return fs::ResultUnsupportedSetSizeForReadOnlyBlockCacheStorage();
}
};

View File

@@ -66,12 +66,12 @@ namespace ams::fssystem {
R_TRY(this->DryWrite(std::addressof(needs_append), offset, size, option, fs::OpenMode_Read));
AMS_ASSERT(needs_append == false);
R_THROW(fs::ResultUnsupportedOperationInRomFsFileA());
R_THROW(fs::ResultUnsupportedWriteForRomFsFile());
}
virtual Result DoSetSize(s64 size) override {
R_TRY(this->DrySetSize(size, fs::OpenMode_Read));
R_THROW(fs::ResultUnsupportedOperationInRomFsFileA());
R_THROW(fs::ResultUnsupportedWriteForRomFsFile());
}
virtual Result DoOperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override {
@@ -94,7 +94,7 @@ namespace ams::fssystem {
R_SUCCEED();
}
default:
R_THROW(fs::ResultUnsupportedOperationInRomFsFileB());
R_THROW(fs::ResultUnsupportedOperateRangeForRomFsFile());
}
}
public:
@@ -303,37 +303,37 @@ namespace ams::fssystem {
Result RomFsFileSystem::DoCreateFile(const fs::Path &path, s64 size, int flags) {
AMS_UNUSED(path, size, flags);
R_THROW(fs::ResultUnsupportedOperationInRomFsFileSystemA());
R_THROW(fs::ResultUnsupportedWriteForRomFsFileSystem());
}
Result RomFsFileSystem::DoDeleteFile(const fs::Path &path) {
AMS_UNUSED(path);
R_THROW(fs::ResultUnsupportedOperationInRomFsFileSystemA());
R_THROW(fs::ResultUnsupportedWriteForRomFsFileSystem());
}
Result RomFsFileSystem::DoCreateDirectory(const fs::Path &path) {
AMS_UNUSED(path);
R_THROW(fs::ResultUnsupportedOperationInRomFsFileSystemA());
R_THROW(fs::ResultUnsupportedWriteForRomFsFileSystem());
}
Result RomFsFileSystem::DoDeleteDirectory(const fs::Path &path) {
AMS_UNUSED(path);
R_THROW(fs::ResultUnsupportedOperationInRomFsFileSystemA());
R_THROW(fs::ResultUnsupportedWriteForRomFsFileSystem());
}
Result RomFsFileSystem::DoDeleteDirectoryRecursively(const fs::Path &path) {
AMS_UNUSED(path);
R_THROW(fs::ResultUnsupportedOperationInRomFsFileSystemA());
R_THROW(fs::ResultUnsupportedWriteForRomFsFileSystem());
}
Result RomFsFileSystem::DoRenameFile(const fs::Path &old_path, const fs::Path &new_path) {
AMS_UNUSED(old_path, new_path);
R_THROW(fs::ResultUnsupportedOperationInRomFsFileSystemA());
R_THROW(fs::ResultUnsupportedWriteForRomFsFileSystem());
}
Result RomFsFileSystem::DoRenameDirectory(const fs::Path &old_path, const fs::Path &new_path) {
AMS_UNUSED(old_path, new_path);
R_THROW(fs::ResultUnsupportedOperationInRomFsFileSystemA());
R_THROW(fs::ResultUnsupportedWriteForRomFsFileSystem());
}
Result RomFsFileSystem::DoGetEntryType(fs::DirectoryEntryType *out, const fs::Path &path) {
@@ -407,12 +407,12 @@ namespace ams::fssystem {
Result RomFsFileSystem::DoCleanDirectoryRecursively(const fs::Path &path) {
AMS_UNUSED(path);
R_THROW(fs::ResultUnsupportedOperationInRomFsFileSystemA());
R_THROW(fs::ResultUnsupportedWriteForRomFsFileSystem());
}
Result RomFsFileSystem::DoCommitProvisionally(s64 counter) {
AMS_UNUSED(counter);
R_THROW(fs::ResultUnsupportedOperationInRomFsFileSystemB());
R_THROW(fs::ResultUnsupportedCommitProvisionallyForRomFsFileSystem());
}
}