fs: move bitmap classes out of save::

This commit is contained in:
Michael Scire 2022-03-12 14:08:39 -08:00 committed by SciresM
parent 7a69723021
commit be9338eb33
14 changed files with 52 additions and 85 deletions

View file

@ -15,7 +15,7 @@
*/
#include <stratosphere.hpp>
namespace ams::fssystem::save {
namespace ams::fssystem {
BlockCacheBufferedStorage::BlockCacheBufferedStorage() : m_mutex(), m_data_storage(), m_last_result(ResultSuccess()), m_data_size(), m_verification_block_size(), m_verification_block_shift(), m_flags(), m_buffer_level(-1), m_block_cache_manager()
{

View file

@ -15,7 +15,7 @@
*/
#include <stratosphere.hpp>
namespace ams::fssystem::save {
namespace ams::fssystem {
namespace {

View file

@ -17,7 +17,7 @@
namespace ams::fssystem {
Result IntegrityRomFsStorage::Initialize(save::HierarchicalIntegrityVerificationInformation level_hash_info, Hash master_hash, save::HierarchicalIntegrityVerificationStorage::HierarchicalStorageInformation storage_info, fs::IBufferManager *bm, IHash256GeneratorFactory *hgf) {
Result IntegrityRomFsStorage::Initialize(HierarchicalIntegrityVerificationInformation level_hash_info, Hash master_hash, HierarchicalIntegrityVerificationStorage::HierarchicalStorageInformation storage_info, fs::IBufferManager *bm, IHash256GeneratorFactory *hgf) {
/* Validate preconditions. */
AMS_ASSERT(bm != nullptr);

View file

@ -15,7 +15,7 @@
*/
#include <stratosphere.hpp>
namespace ams::fssystem::save {
namespace ams::fssystem {
Result IntegrityVerificationStorage::Initialize(fs::SubStorage hs, fs::SubStorage ds, s64 verif_block_size, s64 upper_layer_verif_block_size, fs::IBufferManager *bm, fssystem::IHash256GeneratorFactory *hgf, const fs::HashSalt &salt, bool is_real_data, fs::StorageType storage_type) {
/* Validate preconditions. */

View file

@ -549,7 +549,7 @@ namespace ams::fssystem {
R_TRY(base_storage->GetSize(std::addressof(base_size)));
/* Create buffered storage. */
auto buffered_storage = fssystem::AllocateShared<save::BufferedStorage>();
auto buffered_storage = fssystem::AllocateShared<BufferedStorage>();
R_UNLESS(buffered_storage != nullptr, fs::ResultAllocationFailureInAllocateShared());
/* Initialize the buffered storage. */
@ -655,7 +655,7 @@ namespace ams::fssystem {
R_TRY(this->CreateAesCtrStorage(std::addressof(decrypted_storage), std::move(enc_storage), offset + meta_offset, sparse_info.MakeAesCtrUpperIv(upper_iv), AlignmentStorageRequirement_None));
/* Create meta storage. */
auto meta_storage = fssystem::AllocateShared<save::BufferedStorage>();
auto meta_storage = fssystem::AllocateShared<BufferedStorage>();
R_UNLESS(meta_storage != nullptr, fs::ResultAllocationFailureInAllocateShared());
/* Initialize the meta storage. */
@ -789,7 +789,7 @@ namespace ams::fssystem {
R_TRY(this->CreateAesCtrStorage(std::addressof(decrypted_storage), std::move(enc_storage), offset + meta_offset, upper_iv, AlignmentStorageRequirement_None));
/* Create meta storage. */
auto meta_storage = fssystem::AllocateShared<save::BufferedStorage>();
auto meta_storage = fssystem::AllocateShared<BufferedStorage>();
R_UNLESS(meta_storage != nullptr, fs::ResultAllocationFailureInAllocateShared());
/* Initialize the meta storage. */
@ -921,7 +921,7 @@ namespace ams::fssystem {
R_UNLESS(patch_info.indirect_offset + patch_info.indirect_size <= base_size, fs::ResultNcaBaseStorageOutOfRangeE());
/* Allocate the meta storage. */
auto meta_storage = fssystem::AllocateShared<save::BufferedStorage>();
auto meta_storage = fssystem::AllocateShared<BufferedStorage>();
R_UNLESS(meta_storage != nullptr, fs::ResultAllocationFailureInAllocateShared());
/* Initialize the meta storage. */
@ -954,7 +954,7 @@ namespace ams::fssystem {
AMS_ASSERT(util::IsAligned(indirect_data_size, NcaHeader::XtsBlockSize));
/* Create the indirect data storage. */
auto indirect_data_storage = fssystem::AllocateShared<save::BufferedStorage>();
auto indirect_data_storage = fssystem::AllocateShared<BufferedStorage>();
R_UNLESS(indirect_data_storage != nullptr, fs::ResultAllocationFailureInAllocateShared());
/* Initialize the indirect data storage. */
@ -1061,15 +1061,15 @@ namespace ams::fssystem {
AMS_ASSERT(base_storage != nullptr);
/* Define storage types. */
using VerificationStorage = save::HierarchicalIntegrityVerificationStorage;
using VerificationStorage = HierarchicalIntegrityVerificationStorage;
using StorageInfo = VerificationStorage::HierarchicalStorageInformation;
/* Validate the meta info. */
save::HierarchicalIntegrityVerificationInformation level_hash_info;
HierarchicalIntegrityVerificationInformation level_hash_info;
std::memcpy(std::addressof(level_hash_info), std::addressof(meta_info.level_hash_info), sizeof(level_hash_info));
R_UNLESS(save::IntegrityMinLayerCount <= level_hash_info.max_layers, fs::ResultInvalidHierarchicalIntegrityVerificationLayerCount());
R_UNLESS(level_hash_info.max_layers <= save::IntegrityMaxLayerCount, fs::ResultInvalidHierarchicalIntegrityVerificationLayerCount());
R_UNLESS(IntegrityMinLayerCount <= level_hash_info.max_layers, fs::ResultInvalidHierarchicalIntegrityVerificationLayerCount());
R_UNLESS(level_hash_info.max_layers <= IntegrityMaxLayerCount, fs::ResultInvalidHierarchicalIntegrityVerificationLayerCount());
/* Get the base storage size. */
s64 base_storage_size;