mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-06-05 01:03:43 -04:00
ams: use R_SUCCEED, R_THROW globally
This commit is contained in:
parent
e5b1739f65
commit
dd78ede99f
370 changed files with 2107 additions and 2107 deletions
|
@ -176,7 +176,7 @@ namespace ams::fssystem {
|
|||
} while (m_block_size <= remaining);
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void FileSystemBuddyHeap::Finalize() {
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace ams::fssystem {
|
|||
m_cache_count_min = max_cache_count / 16;
|
||||
m_cache_size_min = m_cache_count_min * 0x100;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void FileSystemBufferManager::CacheHandleTable::Finalize() {
|
||||
|
|
|
@ -49,14 +49,14 @@ namespace ams::fssystem {
|
|||
std::unique_ptr<IDecryptor> decryptor = std::make_unique<ExternalDecryptor>(func, key_index, key_generation);
|
||||
R_UNLESS(decryptor != nullptr, fs::ResultAllocationMemoryFailedInAesCtrCounterExtendedStorageA());
|
||||
*out = std::move(decryptor);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result AesCtrCounterExtendedStorage::CreateSoftwareDecryptor(std::unique_ptr<IDecryptor> *out) {
|
||||
std::unique_ptr<IDecryptor> decryptor = std::make_unique<SoftwareDecryptor>();
|
||||
R_UNLESS(decryptor != nullptr, fs::ResultAllocationMemoryFailedInAesCtrCounterExtendedStorageA());
|
||||
*out = std::move(decryptor);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result AesCtrCounterExtendedStorage::Initialize(IAllocator *allocator, const void *key, size_t key_size, u32 secure_value, fs::SubStorage data_storage, fs::SubStorage table_storage) {
|
||||
|
@ -96,7 +96,7 @@ namespace ams::fssystem {
|
|||
m_counter_offset = counter_offset;
|
||||
m_decryptor = std::move(decryptor);
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void AesCtrCounterExtendedStorage::Finalize() {
|
||||
|
@ -189,7 +189,7 @@ namespace ams::fssystem {
|
|||
cur_offset += cur_size;
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result AesCtrCounterExtendedStorage::OperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) {
|
||||
|
@ -205,7 +205,7 @@ namespace ams::fssystem {
|
|||
/* Operate on our data storage. */
|
||||
R_TRY(m_data_storage.OperateRange(fs::OperationId::Invalidate, 0, std::numeric_limits<s64>::max()));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
case fs::OperationId::QueryRange:
|
||||
{
|
||||
|
@ -220,7 +220,7 @@ namespace ams::fssystem {
|
|||
/* Succeed if there's nothing to operate on. */
|
||||
if (size == 0) {
|
||||
reinterpret_cast<fs::QueryRangeInfo *>(dst)->Clear();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
/* Validate arguments. */
|
||||
|
@ -243,10 +243,10 @@ namespace ams::fssystem {
|
|||
/* Merge in the new info. */
|
||||
reinterpret_cast<fs::QueryRangeInfo *>(dst)->Merge(new_info);
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
default:
|
||||
return fs::ResultUnsupportedOperateRangeForAesCtrCounterExtendedStorage();
|
||||
R_THROW(fs::ResultUnsupportedOperateRangeForAesCtrCounterExtendedStorage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ namespace ams::fssystem {
|
|||
auto dec_size = crypto::DecryptAes128Ctr(buffer, size, m_key, KeySize, ctr, IvSize, buffer, size);
|
||||
R_UNLESS(size == dec_size, fs::ResultUnexpectedInAesCtrStorageA());
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
template<typename BasePointer>
|
||||
|
@ -124,7 +124,7 @@ namespace ams::fssystem {
|
|||
}
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
template<typename BasePointer>
|
||||
|
@ -135,7 +135,7 @@ namespace ams::fssystem {
|
|||
template<typename BasePointer>
|
||||
Result AesCtrStorage<BasePointer>::SetSize(s64 size) {
|
||||
AMS_UNUSED(size);
|
||||
return fs::ResultUnsupportedSetSizeForAesCtrStorage();
|
||||
R_THROW(fs::ResultUnsupportedSetSizeForAesCtrStorage());
|
||||
}
|
||||
|
||||
template<typename BasePointer>
|
||||
|
@ -154,7 +154,7 @@ namespace ams::fssystem {
|
|||
reinterpret_cast<fs::QueryRangeInfo *>(dst)->Clear();
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
/* Ensure alignment. */
|
||||
|
@ -183,7 +183,7 @@ namespace ams::fssystem {
|
|||
break;
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
template class AesCtrStorage<fs::IStorage *>;
|
||||
|
|
|
@ -115,7 +115,7 @@ namespace ams::fssystem {
|
|||
tail_offset += cur_size;
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result AlignmentMatchingStorageImpl::Write(fs::IStorage *base_storage, char *work_buf, size_t work_buf_size, size_t data_alignment, size_t buffer_alignment, s64 offset, const char *buffer, size_t size) {
|
||||
|
@ -186,7 +186,7 @@ namespace ams::fssystem {
|
|||
tail_offset += cur_size;
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
template<>
|
||||
|
@ -216,7 +216,7 @@ namespace ams::fssystem {
|
|||
if (aligned_size <= pooled_buffer.GetSize()) {
|
||||
R_TRY(m_base_storage->Read(aligned_offset, pooled_buffer.GetBuffer(), aligned_size));
|
||||
std::memcpy(buffer, pooled_buffer.GetBuffer() + (offset - aligned_offset), size);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
} else {
|
||||
pooled_buffer.Shrink(m_data_align);
|
||||
}
|
||||
|
@ -255,7 +255,7 @@ namespace ams::fssystem {
|
|||
std::memcpy(tail_buffer, pooled_buffer.GetBuffer(), tail_size);
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ namespace ams::fssystem {
|
|||
}
|
||||
|
||||
m_index = static_cast<s32>(pos - m_start) - 1;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -126,7 +126,7 @@ namespace ams::fssystem {
|
|||
R_UNLESS(this->magic == Magic, fs::ResultInvalidBucketTreeSignature());
|
||||
R_UNLESS(this->entry_count >= 0, fs::ResultInvalidBucketTreeEntryCount());
|
||||
R_UNLESS(this->version <= Version, fs::ResultUnsupportedVersion());
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result BucketTree::NodeHeader::Verify(s32 node_index, size_t node_size, size_t entry_size) const {
|
||||
|
@ -137,7 +137,7 @@ namespace ams::fssystem {
|
|||
R_UNLESS(this->count > 0 && static_cast<size_t>(this->count) <= max_entry_count, fs::ResultInvalidBucketTreeNodeEntryCount());
|
||||
R_UNLESS(this->offset >= 0, fs::ResultInvalidBucketTreeNodeOffset());
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result BucketTree::Initialize(IAllocator *allocator, fs::SubStorage node_storage, fs::SubStorage entry_storage, size_t node_size, size_t entry_size, s32 entry_count) {
|
||||
|
@ -300,7 +300,7 @@ namespace ams::fssystem {
|
|||
m_offsets = offsets;
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result BucketTree::Visitor::MoveNext() {
|
||||
|
@ -336,7 +336,7 @@ namespace ams::fssystem {
|
|||
|
||||
/* Note that we changed index. */
|
||||
m_entry_index = entry_index;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result BucketTree::Visitor::MovePrevious() {
|
||||
|
@ -374,7 +374,7 @@ namespace ams::fssystem {
|
|||
|
||||
/* Note that we changed index. */
|
||||
m_entry_index = entry_index;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result BucketTree::Visitor::Find(s64 virtual_address) {
|
||||
|
@ -421,7 +421,7 @@ namespace ams::fssystem {
|
|||
|
||||
/* Set count. */
|
||||
m_entry_set_count = m_tree->m_entry_set_count;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result BucketTree::Visitor::FindEntrySet(s32 *out_index, s64 virtual_address, s32 node_index) {
|
||||
|
@ -457,7 +457,7 @@ namespace ams::fssystem {
|
|||
|
||||
/* Return the index. */
|
||||
*out_index = m_tree->GetEntrySetIndex(header.index, node.GetIndex());
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result BucketTree::Visitor::FindEntrySetWithoutBuffer(s32 *out_index, s64 virtual_address, s32 node_index) {
|
||||
|
@ -478,7 +478,7 @@ namespace ams::fssystem {
|
|||
|
||||
/* Return the index. */
|
||||
*out_index = m_tree->GetEntrySetIndex(header.index, node.GetIndex());
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result BucketTree::Visitor::FindEntry(s64 virtual_address, s32 entry_set_index) {
|
||||
|
@ -522,7 +522,7 @@ namespace ams::fssystem {
|
|||
m_entry_set = entry_set;
|
||||
m_entry_index = entry_index;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result BucketTree::Visitor::FindEntryWithoutBuffer(s64 virtual_address, s32 entry_set_index) {
|
||||
|
@ -551,7 +551,7 @@ namespace ams::fssystem {
|
|||
m_entry_set = entry_set;
|
||||
m_entry_index = entry_index;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -238,7 +238,7 @@ namespace ams::fssystem {
|
|||
buffers::EnableBlockingBufferManagerAllocation();
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
const std::pair<Result, bool> PrepareFetch() {
|
||||
|
@ -295,7 +295,7 @@ namespace ams::fssystem {
|
|||
m_offset = fetch_param.offset;
|
||||
AMS_ASSERT(this->Hits(offset, 1));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result FetchFromBuffer(s64 offset, const void *buffer, size_t buffer_size) {
|
||||
|
@ -321,7 +321,7 @@ namespace ams::fssystem {
|
|||
m_offset = fetch_param.offset;
|
||||
AMS_ASSERT(this->Hits(offset, 1));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
bool TryAcquireCache() {
|
||||
|
@ -369,7 +369,7 @@ namespace ams::fssystem {
|
|||
}, AMS_CURRENT_FUNCTION_NAME));
|
||||
|
||||
range_guard.Cancel();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void CalcFetchParameter(FetchParameter *out, s64 offset) const {
|
||||
|
@ -579,7 +579,7 @@ namespace ams::fssystem {
|
|||
Result FetchFromBuffer(s64 offset, const void *buffer, size_t buffer_size) {
|
||||
AMS_ASSERT(m_cache != nullptr);
|
||||
R_TRY(m_cache->FetchFromBuffer(offset, buffer, buffer_size));
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -616,7 +616,7 @@ namespace ams::fssystem {
|
|||
}
|
||||
|
||||
m_next_acquire_cache = std::addressof(m_caches[0]);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void BufferedStorage::Finalize() {
|
||||
|
@ -638,7 +638,7 @@ namespace ams::fssystem {
|
|||
|
||||
/* Do the read. */
|
||||
R_TRY(this->ReadCore(offset, buffer, size));
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result BufferedStorage::Write(s64 offset, const void *buffer, size_t size) {
|
||||
|
@ -652,7 +652,7 @@ namespace ams::fssystem {
|
|||
|
||||
/* Do the write. */
|
||||
R_TRY(this->WriteCore(offset, buffer, size));
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result BufferedStorage::GetSize(s64 *out) {
|
||||
|
@ -660,7 +660,7 @@ namespace ams::fssystem {
|
|||
AMS_ASSERT(this->IsInitialized());
|
||||
|
||||
*out = m_base_storage_size;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result BufferedStorage::SetSize(s64 size) {
|
||||
|
@ -700,7 +700,7 @@ namespace ams::fssystem {
|
|||
R_TRY(m_base_storage.GetSize(std::addressof(new_size)));
|
||||
|
||||
m_base_storage_size = new_size;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result BufferedStorage::Flush() {
|
||||
|
@ -714,7 +714,7 @@ namespace ams::fssystem {
|
|||
|
||||
/* Flush the base storage. */
|
||||
R_TRY(m_base_storage.Flush());
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result BufferedStorage::OperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) {
|
||||
|
@ -745,7 +745,7 @@ namespace ams::fssystem {
|
|||
if (m_buffer_manager->GetTotalAllocatableSize() < flush_threshold) {
|
||||
R_TRY(this->Flush());
|
||||
}
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result BufferedStorage::ControlDirtiness() {
|
||||
|
@ -760,7 +760,7 @@ namespace ams::fssystem {
|
|||
}
|
||||
}
|
||||
}
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result BufferedStorage::ReadCore(s64 offset, void *buffer, size_t size) {
|
||||
|
@ -800,7 +800,7 @@ namespace ams::fssystem {
|
|||
}
|
||||
} R_END_TRY_CATCH;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
} while(0);
|
||||
}
|
||||
}
|
||||
|
@ -854,7 +854,7 @@ namespace ams::fssystem {
|
|||
buf_offset += cur_size;
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
bool BufferedStorage::ReadHeadCache(s64 *offset, void *buffer, size_t *size, s64 *buffer_offset) {
|
||||
|
@ -1007,7 +1007,7 @@ namespace ams::fssystem {
|
|||
R_TRY(this->ControlDirtiness());
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result BufferedStorage::WriteCore(s64 offset, const void *buffer, size_t size) {
|
||||
|
@ -1079,7 +1079,7 @@ namespace ams::fssystem {
|
|||
buf_offset += cur_size;
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace ams::fssystem {
|
|||
|
||||
Result DecompressLz4(void *dst, size_t dst_size, const void *src, size_t src_size) {
|
||||
R_UNLESS(util::DecompressLZ4(dst, dst_size, src, src_size) == static_cast<int>(dst_size), fs::ResultUnexpectedInCompressedStorageC());
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
constexpr DecompressorFunction GetNcaDecompressorFunction(CompressionType type) {
|
||||
|
|
|
@ -62,7 +62,7 @@ namespace ams::fssystem {
|
|||
g_hnd_map.Emplace(program_id, client);
|
||||
|
||||
*out = server;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void DestroyExternalCode(ncm::ProgramId program_id) {
|
||||
|
|
|
@ -78,7 +78,7 @@ namespace ams::fssystem {
|
|||
m_hash_generator_factory->GenerateHash(calc_hash, sizeof(calc_hash), m_hash_buffer, static_cast<size_t>(hash_storage_size));
|
||||
R_UNLESS(crypto::IsSameBytes(master_hash, calc_hash, HashSize), fs::ResultHierarchicalSha256HashVerificationFailed());
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
template<typename BaseStorageType>
|
||||
|
@ -126,7 +126,7 @@ namespace ams::fssystem {
|
|||
remaining_size -= cur_size;
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
template<typename BaseStorageType>
|
||||
|
@ -169,7 +169,7 @@ namespace ams::fssystem {
|
|||
remaining_size -= cur_size;
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
template<typename BaseStorageType>
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace ams::fssystem {
|
|||
|
||||
virtual Result SetSize(s64 size) override {
|
||||
AMS_UNUSED(size);
|
||||
return fs::ResultUnsupportedSetSizeForHierarchicalSha256Storage();
|
||||
R_THROW(fs::ResultUnsupportedSetSizeForHierarchicalSha256Storage());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -171,7 +171,7 @@ namespace ams::fssystem {
|
|||
R_SUCCEED();
|
||||
}
|
||||
default:
|
||||
return fs::ResultUnsupportedOperateRangeForIndirectStorage();
|
||||
R_THROW(fs::ResultUnsupportedOperateRangeForIndirectStorage());
|
||||
}
|
||||
|
||||
R_SUCCEED();
|
||||
|
|
|
@ -93,12 +93,12 @@ namespace ams::fssystem {
|
|||
*out = std::move(accessor);
|
||||
|
||||
this->UpdateMru(list, it);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return fs::ResultTargetNotFound();
|
||||
R_THROW(fs::ResultTargetNotFound());
|
||||
}
|
||||
|
||||
void AddEntry(KeySlotCacheEntry *entry) {
|
||||
|
@ -122,7 +122,7 @@ namespace ams::fssystem {
|
|||
src_list.pop_back();
|
||||
dst_list.push_front(*entry);
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void UpdateMru(KeySlotCacheEntryList *list, KeySlotCacheEntryList::iterator it) {
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace ams::fssystem {
|
|||
/* Verify the magic is the current one. */
|
||||
R_UNLESS(magic == NcaHeader::Magic3, fs::ResultInvalidNcaSignature());
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ namespace ams::fssystem {
|
|||
m_header_storage = std::move(work_header_storage);
|
||||
m_body_storage = std::move(base_storage);
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
std::shared_ptr<fs::IStorage> NcaReader::GetSharedBodyStorage() {
|
||||
|
@ -435,7 +435,7 @@ namespace ams::fssystem {
|
|||
|
||||
/* Set our index. */
|
||||
m_fs_index = index;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void NcaFsHeaderReader::GetRawData(void *dst, size_t dst_size) const {
|
||||
|
|
|
@ -75,7 +75,7 @@ namespace ams::fssystem {
|
|||
|
||||
/* Mark as initialized. */
|
||||
m_initialized = true;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
template <typename Format>
|
||||
|
@ -156,7 +156,7 @@ namespace ams::fssystem {
|
|||
|
||||
/* Output size. */
|
||||
*out_size = sizeof(PartitionFileSystemHeader) + header.entry_count * sizeof(typename Format::PartitionEntry) + header.name_table_size;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
template class PartitionFileSystemMetaCore<impl::PartitionFileSystemFormat>;
|
||||
|
@ -213,7 +213,7 @@ namespace ams::fssystem {
|
|||
|
||||
/* We initialized. */
|
||||
m_initialized = true;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -210,7 +210,7 @@ namespace ams::fssystem {
|
|||
g_heap_size = size;
|
||||
g_heap_free_size_peak = size;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result InitializeBufferPool(char *buffer, size_t size, char *work, size_t work_size) {
|
||||
|
@ -227,7 +227,7 @@ namespace ams::fssystem {
|
|||
g_heap_size = size;
|
||||
g_heap_free_size_peak = size;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
bool IsPooledBuffer(const void *buffer) {
|
||||
|
|
|
@ -67,7 +67,7 @@ namespace ams::fssystem {
|
|||
bool found = m_block_cache.FindValueAndUpdateMru(std::addressof(cached_buffer), offset / m_block_size);
|
||||
if (found) {
|
||||
std::memcpy(buffer, cached_buffer, size);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ namespace ams::fssystem {
|
|||
m_block_cache.PushMruNode(std::move(lru), offset / m_block_size);
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
} else {
|
||||
return m_base_storage->Read(offset, buffer, size);
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ namespace ams::fssystem {
|
|||
m_block_cache.PushMruNode(std::move(lru), -1);
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
} else {
|
||||
/* Validate preconditions. */
|
||||
AMS_ASSERT(util::IsAligned(offset, m_block_size));
|
||||
|
@ -114,17 +114,17 @@ namespace ams::fssystem {
|
|||
}
|
||||
|
||||
virtual Result Flush() override {
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
virtual Result Write(s64 offset, const void *buffer, size_t size) override {
|
||||
AMS_UNUSED(offset, buffer, size);
|
||||
return fs::ResultUnsupportedWriteForReadOnlyBlockCacheStorage();
|
||||
R_THROW(fs::ResultUnsupportedWriteForReadOnlyBlockCacheStorage());
|
||||
}
|
||||
|
||||
virtual Result SetSize(s64 size) override {
|
||||
AMS_UNUSED(size);
|
||||
return fs::ResultUnsupportedSetSizeForReadOnlyBlockCacheStorage();
|
||||
R_THROW(fs::ResultUnsupportedSetSizeForReadOnlyBlockCacheStorage());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -38,11 +38,11 @@ namespace ams::fssystem {
|
|||
} else {
|
||||
R_TRY((this->OperatePerEntry<false, true>(offset, size, [=](fs::IStorage *storage, s64 data_offset, s64 cur_offset, s64 cur_size) -> Result {
|
||||
R_TRY(storage->Read(data_offset, reinterpret_cast<u8 *>(buffer) + (cur_offset - offset), static_cast<size_t>(cur_size)));
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
})));
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue