strat: use m_ for member variables

This commit is contained in:
Michael Scire
2021-10-10 00:14:06 -07:00
parent ce28591ab2
commit a595c232b9
425 changed files with 8531 additions and 8484 deletions

View File

@@ -61,19 +61,19 @@ namespace ams::fssystem::save {
Flag_RealData = (1 << 10),
};
private:
IBufferManager *buffer_manager;
os::SdkRecursiveMutex *mutex;
std::unique_ptr<CacheEntry[], ::ams::fs::impl::Deleter> entries;
IStorage *data_storage;
Result last_result;
s64 data_size;
size_t verification_block_size;
size_t verification_block_shift;
CacheIndex invalidate_index;
s32 max_cache_entry_count;
s32 flags;
s32 buffer_level;
fs::StorageType storage_type;
IBufferManager *m_buffer_manager;
os::SdkRecursiveMutex *m_mutex;
std::unique_ptr<CacheEntry[], ::ams::fs::impl::Deleter> m_entries;
IStorage *m_data_storage;
Result m_last_result;
s64 m_data_size;
size_t m_verification_block_size;
size_t m_verification_block_shift;
CacheIndex m_invalidate_index;
s32 m_max_cache_entry_count;
s32 m_flags;
s32 m_buffer_level;
fs::StorageType m_storage_type;
public:
BlockCacheBufferedStorage();
virtual ~BlockCacheBufferedStorage() override;
@@ -96,31 +96,31 @@ namespace ams::fssystem::save {
Result OnRollback();
bool IsEnabledKeepBurstMode() const {
return (this->flags & Flag_KeepBurstMode) != 0;
return (m_flags & Flag_KeepBurstMode) != 0;
}
bool IsRealDataCache() const {
return (this->flags & Flag_RealData) != 0;
return (m_flags & Flag_RealData) != 0;
}
void SetKeepBurstMode(bool en) {
if (en) {
this->flags |= Flag_KeepBurstMode;
m_flags |= Flag_KeepBurstMode;
} else {
this->flags &= ~Flag_KeepBurstMode;
m_flags &= ~Flag_KeepBurstMode;
}
}
void SetRealDataCache(bool en) {
if (en) {
this->flags |= Flag_RealData;
m_flags |= Flag_RealData;
} else {
this->flags &= ~Flag_RealData;
m_flags &= ~Flag_RealData;
}
}
private:
s32 GetMaxCacheEntryCount() const {
return this->max_cache_entry_count;
return m_max_cache_entry_count;
}
Result ClearImpl(s64 offset, s64 size);

View File

@@ -30,16 +30,16 @@ namespace ams::fssystem::save {
class UniqueCache;
class SharedCache;
private:
fs::SubStorage base_storage;
IBufferManager *buffer_manager;
size_t block_size;
s64 base_storage_size;
std::unique_ptr<Cache[]> caches;
s32 cache_count;
Cache *next_acquire_cache;
Cache *next_fetch_cache;
os::SdkMutex mutex;
bool bulk_read_enabled;
fs::SubStorage m_base_storage;
IBufferManager *m_buffer_manager;
size_t m_block_size;
s64 m_base_storage_size;
std::unique_ptr<Cache[]> m_caches;
s32 m_cache_count;
Cache *m_next_acquire_cache;
Cache *m_next_fetch_cache;
os::SdkMutex m_mutex;
bool m_bulk_read_enabled;
public:
BufferedStorage();
virtual ~BufferedStorage();
@@ -47,7 +47,7 @@ namespace ams::fssystem::save {
Result Initialize(fs::SubStorage base_storage, IBufferManager *buffer_manager, size_t block_size, s32 buffer_count);
void Finalize();
bool IsInitialized() const { return this->caches != nullptr; }
bool IsInitialized() const { return m_caches != nullptr; }
virtual Result Read(s64 offset, void *buffer, size_t size) override;
virtual Result Write(s64 offset, const void *buffer, size_t size) override;
@@ -61,9 +61,9 @@ namespace ams::fssystem::save {
void InvalidateCaches();
IBufferManager *GetBufferManager() const { return this->buffer_manager; }
IBufferManager *GetBufferManager() const { return m_buffer_manager; }
void EnableBulkRead() { this->bulk_read_enabled = true; }
void EnableBulkRead() { m_bulk_read_enabled = true; }
private:
Result PrepareAllocation();
Result ControlDirtiness();

View File

@@ -82,8 +82,8 @@ namespace ams::fssystem::save {
};
static_assert(util::is_pod<InputParam>::value);
private:
fs::SubStorage storage;
HierarchicalIntegrityVerificationMetaInformation meta;
fs::SubStorage m_storage;
HierarchicalIntegrityVerificationMetaInformation m_meta;
public:
static Result QuerySize(HierarchicalIntegrityVerificationSizeSet *out, const InputParam &input_param, s32 layer_count, s64 data_size);
/* TODO Format */
@@ -94,10 +94,10 @@ namespace ams::fssystem::save {
Result Initialize(fs::SubStorage meta_storage);
void Finalize();
u32 GetMasterHashSize() const { return this->meta.master_hash_size; }
u32 GetMasterHashSize() const { return m_meta.master_hash_size; }
void GetLevelHashInfo(HierarchicalIntegrityVerificationInformation *out) {
AMS_ASSERT(out != nullptr);
*out = this->meta.level_hash_info;
*out = m_meta.level_hash_info;
}
};
@@ -124,19 +124,19 @@ namespace ams::fssystem::save {
DataStorage = 6,
};
private:
fs::SubStorage storages[DataStorage + 1];
fs::SubStorage m_storages[DataStorage + 1];
public:
void SetMasterHashStorage(fs::SubStorage s) { this->storages[MasterStorage] = s; }
void SetLayer1HashStorage(fs::SubStorage s) { this->storages[Layer1Storage] = s; }
void SetLayer2HashStorage(fs::SubStorage s) { this->storages[Layer2Storage] = s; }
void SetLayer3HashStorage(fs::SubStorage s) { this->storages[Layer3Storage] = s; }
void SetLayer4HashStorage(fs::SubStorage s) { this->storages[Layer4Storage] = s; }
void SetLayer5HashStorage(fs::SubStorage s) { this->storages[Layer5Storage] = s; }
void SetDataStorage(fs::SubStorage s) { this->storages[DataStorage] = s; }
void SetMasterHashStorage(fs::SubStorage s) { m_storages[MasterStorage] = s; }
void SetLayer1HashStorage(fs::SubStorage s) { m_storages[Layer1Storage] = s; }
void SetLayer2HashStorage(fs::SubStorage s) { m_storages[Layer2Storage] = s; }
void SetLayer3HashStorage(fs::SubStorage s) { m_storages[Layer3Storage] = s; }
void SetLayer4HashStorage(fs::SubStorage s) { m_storages[Layer4Storage] = s; }
void SetLayer5HashStorage(fs::SubStorage s) { m_storages[Layer5Storage] = s; }
void SetDataStorage(fs::SubStorage s) { m_storages[DataStorage] = s; }
fs::SubStorage &operator[](s32 index) {
AMS_ASSERT(MasterStorage <= index && index <= DataStorage);
return this->storages[index];
return m_storages[index];
}
};
private:
@@ -146,15 +146,15 @@ namespace ams::fssystem::save {
s_generate_random = func;
}
private:
FileSystemBufferManagerSet *buffers;
os::SdkRecursiveMutex *mutex;
IntegrityVerificationStorage verify_storages[MaxLayers - 1];
BlockCacheBufferedStorage buffer_storages[MaxLayers - 1];
s64 data_size;
s32 max_layers;
bool is_written_for_rollback;
FileSystemBufferManagerSet *m_buffers;
os::SdkRecursiveMutex *m_mutex;
IntegrityVerificationStorage m_verify_storages[MaxLayers - 1];
BlockCacheBufferedStorage m_buffer_storages[MaxLayers - 1];
s64 m_data_size;
s32 m_max_layers;
bool m_is_written_for_rollback;
public:
HierarchicalIntegrityVerificationStorage() : buffers(nullptr), mutex(nullptr), data_size(-1), is_written_for_rollback(false) { /* ... */ }
HierarchicalIntegrityVerificationStorage() : m_buffers(nullptr), m_mutex(nullptr), m_data_size(-1), m_is_written_for_rollback(false) { /* ... */ }
virtual ~HierarchicalIntegrityVerificationStorage() override { this->Finalize(); }
Result Initialize(const HierarchicalIntegrityVerificationInformation &info, HierarchicalStorageInformation storage, FileSystemBufferManagerSet *bufs, os::SdkRecursiveMutex *mtx, fs::StorageType storage_type);
@@ -175,30 +175,30 @@ namespace ams::fssystem::save {
Result OnRollback();
bool IsInitialized() const {
return this->data_size >= 0;
return m_data_size >= 0;
}
bool IsWrittenForRollback() const {
return this->is_written_for_rollback;
return m_is_written_for_rollback;
}
FileSystemBufferManagerSet *GetBuffers() {
return this->buffers;
return m_buffers;
}
void GetParameters(HierarchicalIntegrityVerificationStorageControlArea::InputParam *out) const {
AMS_ASSERT(out != nullptr);
for (auto level = 0; level <= this->max_layers - 2; ++level) {
out->level_block_size[level] = static_cast<size_t>(this->verify_storages[level].GetBlockSize());
for (auto level = 0; level <= m_max_layers - 2; ++level) {
out->level_block_size[level] = static_cast<size_t>(m_verify_storages[level].GetBlockSize());
}
}
s64 GetL1HashVerificationBlockSize() const {
return this->verify_storages[this->max_layers - 2].GetBlockSize();
return m_verify_storages[m_max_layers - 2].GetBlockSize();
}
fs::SubStorage GetL1HashStorage() {
return fs::SubStorage(std::addressof(this->buffer_storages[this->max_layers - 3]), 0, util::DivideUp(this->data_size, this->GetL1HashVerificationBlockSize()));
return fs::SubStorage(std::addressof(m_buffer_storages[m_max_layers - 3]), 0, util::DivideUp(m_data_size, this->GetL1HashVerificationBlockSize()));
}
};

View File

@@ -37,18 +37,18 @@ namespace ams::fssystem::save {
};
static_assert(util::is_pod<BlockHash>::value);
private:
fs::SubStorage hash_storage;
fs::SubStorage data_storage;
s64 verification_block_size;
s64 verification_block_order;
s64 upper_layer_verification_block_size;
s64 upper_layer_verification_block_order;
IBufferManager *buffer_manager;
fs::HashSalt salt;
bool is_real_data;
fs::StorageType storage_type;
fs::SubStorage m_hash_storage;
fs::SubStorage m_data_storage;
s64 m_verification_block_size;
s64 m_verification_block_order;
s64 m_upper_layer_verification_block_size;
s64 m_upper_layer_verification_block_order;
IBufferManager *m_buffer_manager;
fs::HashSalt m_salt;
bool m_is_real_data;
fs::StorageType m_storage_type;
public:
IntegrityVerificationStorage() : verification_block_size(0), verification_block_order(0), upper_layer_verification_block_size(0), upper_layer_verification_block_order(0), buffer_manager(nullptr) { /* ... */ }
IntegrityVerificationStorage() : m_verification_block_size(0), m_verification_block_order(0), m_upper_layer_verification_block_size(0), m_upper_layer_verification_block_order(0), m_buffer_manager(nullptr) { /* ... */ }
virtual ~IntegrityVerificationStorage() override { this->Finalize(); }
Result Initialize(fs::SubStorage hs, fs::SubStorage ds, s64 verif_block_size, s64 upper_layer_verif_block_size, IBufferManager *bm, const fs::HashSalt &salt, bool is_real_data, fs::StorageType storage_type);
@@ -68,7 +68,7 @@ namespace ams::fssystem::save {
void CalcBlockHash(BlockHash *out, const void *buffer, size_t block_size) const;
s64 GetBlockSize() const {
return this->verification_block_size;
return m_verification_block_size;
}
private:
Result ReadBlockSignature(void *dst, size_t dst_size, s64 offset, size_t size);
@@ -76,7 +76,7 @@ namespace ams::fssystem::save {
Result VerifyHash(const void *buf, BlockHash *hash);
void CalcBlockHash(BlockHash *out, const void *buffer) const {
return this->CalcBlockHash(out, buffer, static_cast<size_t>(this->verification_block_size));
return this->CalcBlockHash(out, buffer, static_cast<size_t>(m_verification_block_size));
}
Result IsCleared(bool *is_cleared, const BlockHash &hash);