fs: for my sanity, begin tracking version where code was last checked for accuracy

This commit is contained in:
Michael Scire
2022-03-24 08:43:40 -07:00
parent b69fa13576
commit 4646581e93
133 changed files with 195 additions and 66 deletions

View File

@@ -26,6 +26,7 @@ namespace ams::fssystem::buffers {
}
/* ACCURATE_TO_VERSION: Unknown */
template<typename F, typename OnFailure>
Result DoContinuouslyUntilBufferIsAllocated(F f, OnFailure on_failure, const char *function_name) {
constexpr auto BufferAllocationRetryLogCountMax = 10;
@@ -55,6 +56,7 @@ namespace ams::fssystem::buffers {
return ResultSuccess();
}
/* ACCURATE_TO_VERSION: Unknown */
class BufferManagerContext {
private:
bool m_needs_blocking;
@@ -70,6 +72,7 @@ namespace ams::fssystem::buffers {
BufferManagerContext *GetBufferManagerContext();
void EnableBlockingBufferManagerAllocation();
/* ACCURATE_TO_VERSION: Unknown */
class ScopedBufferManagerContextRegistration {
private:
BufferManagerContext m_cur_context;
@@ -88,6 +91,7 @@ namespace ams::fssystem::buffers {
}
};
/* ACCURATE_TO_VERSION: Unknown */
template<typename IsValidBufferFunction>
Result AllocateBufferUsingBufferManagerContext(fs::IBufferManager::MemoryRange *out, fs::IBufferManager *buffer_manager, size_t size, const fs::IBufferManager::BufferAttribute attribute, IsValidBufferFunction is_valid_buffer, const char *func_name) {
AMS_ASSERT(out != nullptr);

View File

@@ -20,6 +20,7 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: Unknown */
class FileSystemBuddyHeap {
NON_COPYABLE(FileSystemBuddyHeap);
NON_MOVEABLE(FileSystemBuddyHeap);

View File

@@ -22,6 +22,7 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: Unknown */
class FileSystemBufferManager : public fs::IBufferManager {
NON_COPYABLE(FileSystemBufferManager);
NON_MOVEABLE(FileSystemBufferManager);

View File

@@ -20,6 +20,7 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: Unknown */
class AesCtrCounterExtendedStorage : public ::ams::fs::IStorage, public ::ams::fs::impl::Newable {
NON_COPYABLE(AesCtrCounterExtendedStorage);
NON_MOVEABLE(AesCtrCounterExtendedStorage);

View File

@@ -20,6 +20,7 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: Unknown */
template<typename BasePointer>
class AesCtrStorage : public ::ams::fs::IStorage, public ::ams::fs::impl::Newable {
NON_COPYABLE(AesCtrStorage);

View File

@@ -21,6 +21,7 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: Unknown */
template<typename BasePointer>
class AesXtsStorage : public ::ams::fs::IStorage, public ::ams::fs::impl::Newable {
NON_COPYABLE(AesXtsStorage);

View File

@@ -22,6 +22,7 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: Unknown */
template<size_t _DataAlign, size_t _BufferAlign>
class AlignmentMatchingStorage : public ::ams::fs::IStorage, public ::ams::fs::impl::Newable {
NON_COPYABLE(AlignmentMatchingStorage);
@@ -131,6 +132,7 @@ namespace ams::fssystem {
}
};
/* ACCURATE_TO_VERSION: Unknown */
template<typename BaseStorageType, size_t _BufferAlign>
class AlignmentMatchingStoragePooledBuffer : public ::ams::fs::IStorage, public ::ams::fs::impl::Newable {
NON_COPYABLE(AlignmentMatchingStoragePooledBuffer);
@@ -232,6 +234,7 @@ namespace ams::fssystem {
}
};
/* ACCURATE_TO_VERSION: Unknown */
template<size_t _BufferAlign>
class AlignmentMatchingStorageInBulkRead : public ::ams::fs::IStorage, public ::ams::fs::impl::Newable {
NON_COPYABLE(AlignmentMatchingStorageInBulkRead);

View File

@@ -19,6 +19,7 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: Unknown */
class AlignmentMatchingStorageImpl {
public:
static Result Read(fs::IStorage *base_storage, char *work_buf, size_t work_buf_size, size_t data_alignment, size_t buffer_alignment, s64 offset, char *buffer, size_t size);

View File

@@ -26,6 +26,7 @@ namespace ams::fs::impl {
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: Unknown */
using AllocateFunction = void *(*)(size_t size);
using DeallocateFunction = void (*)(void *ptr, size_t size);

View File

@@ -18,6 +18,7 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class IAsynchronousAccessSplitter {
public:
static IAsynchronousAccessSplitter *GetDefaultAsynchronousAccessSplitter();
@@ -31,6 +32,7 @@ namespace ams::fssystem {
virtual Result QueryInvocationCount(s64 *out, s64 start_offset, s64 end_offset, s64 access_size, s64 alignment_size) { AMS_UNUSED(out, start_offset, end_offset, access_size, alignment_size); AMS_ABORT("TODO"); }
};
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class DefaultAsynchronousAccessSplitter final : public IAsynchronousAccessSplitter {
public:
constexpr DefaultAsynchronousAccessSplitter() = default;
@@ -48,6 +50,7 @@ namespace ams::fssystem {
}
};
/* ACCURATE_TO_VERSION: 13.4.0.0 */
inline IAsynchronousAccessSplitter *IAsynchronousAccessSplitter::GetDefaultAsynchronousAccessSplitter() {
static constinit DefaultAsynchronousAccessSplitter s_default_access_splitter;
return std::addressof(s_default_access_splitter);

View File

@@ -18,6 +18,8 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
constexpr inline s32 CountLeadingZeros(u32 val) {
return util::CountLeadingZeros(val);
}

View File

@@ -34,6 +34,7 @@ namespace ams::fssystem {
};
static_assert(util::is_pod<FileSystemBufferManagerSet>::value);
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class BlockCacheBufferedStorage : public ::ams::fs::IStorage {
NON_COPYABLE(BlockCacheBufferedStorage);
NON_MOVEABLE(BlockCacheBufferedStorage);

View File

@@ -19,6 +19,7 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: Unknown */
class BucketTree {
NON_COPYABLE(BucketTree);
NON_MOVEABLE(BucketTree);
@@ -286,6 +287,7 @@ namespace ams::fssystem {
Result EnsureOffsetCache();
};
/* ACCURATE_TO_VERSION: Unknown */
class BucketTree::Visitor {
NON_COPYABLE(Visitor);
NON_MOVEABLE(Visitor);

View File

@@ -20,6 +20,7 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
template<typename EntryType>
Result BucketTree::ScanContinuousReading(ContinuousReadingInfo *out_info, const ContinuousReadingParam<EntryType> &param) const {
static_assert(util::is_pod<ContinuousReadingParam<EntryType>>::value);

View File

@@ -18,6 +18,7 @@
namespace ams::fssystem::impl {
/* ACCURATE_TO_VERSION: Unknown */
class SafeValue {
public:
static ALWAYS_INLINE s64 GetInt64(const void *ptr) {
@@ -47,6 +48,7 @@ namespace ams::fssystem::impl {
}
};
/* ACCURATE_TO_VERSION: Unknown */
template<typename IteratorType>
struct BucketTreeNode {
using Header = BucketTree::NodeHeader;

View File

@@ -22,6 +22,7 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: Unknown */
class BufferedStorage : public ::ams::fs::IStorage {
NON_COPYABLE(BufferedStorage);
NON_MOVEABLE(BufferedStorage);

View File

@@ -23,6 +23,7 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class CompressedStorage : public ::ams::fs::IStorage, public ::ams::fssystem::IAsynchronousAccessSplitter, public ::ams::fs::impl::Newable {
NON_COPYABLE(CompressedStorage);
NON_MOVEABLE(CompressedStorage);
@@ -366,7 +367,7 @@ namespace ams::fssystem {
/* Operate on the range. */
s64 required_access_physical_offset = 0;
s64 required_access_physical_size = 0;
s64 required_access_physical_end;
s64 required_access_physical_end = 0;
s64 appropriate_virtual_offset = offset;
R_TRY(this->OperatePerEntry(offset, table_offsets.end_offset - offset, [&] (bool *out_continuous, const Entry &entry, s64 virtual_data_size, s64 data_offset, s64 read_size) -> Result {

View File

@@ -18,6 +18,7 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
enum CompressionType : u8 {
CompressionType_None = 0,
CompressionType_Zeros = 1,

View File

@@ -22,6 +22,7 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class DirectorySaveDataFileSystem : public fs::fsa::IFileSystem, public fs::impl::Newable {
NON_COPYABLE(DirectorySaveDataFileSystem);
private:

View File

@@ -23,6 +23,7 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class ForwardingFile final : public ::ams::fs::fsa::IFile, public ::ams::fs::impl::Newable {
NON_COPYABLE(ForwardingFile);
NON_MOVEABLE(ForwardingFile);
@@ -62,6 +63,7 @@ namespace ams::fssystem {
}
};
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class ForwardingDirectory final : public ::ams::fs::fsa::IDirectory, public ::ams::fs::impl::Newable {
NON_COPYABLE(ForwardingDirectory);
NON_MOVEABLE(ForwardingDirectory);
@@ -85,6 +87,7 @@ namespace ams::fssystem {
}
};
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class ForwardingFileSystem final : public ::ams::fs::fsa::IFileSystem, public ::ams::fs::impl::Newable {
NON_COPYABLE(ForwardingFileSystem);
NON_MOVEABLE(ForwardingFileSystem);

View File

@@ -24,6 +24,8 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: Unknown */
struct HierarchicalIntegrityVerificationLevelInformation {
fs::Int64 offset;
fs::Int64 size;
@@ -66,7 +68,7 @@ namespace ams::fssystem {
struct HierarchicalIntegrityVerificationSizeSet {
s64 control_size;
s64 master_hash_size;
s64 layered_hash_sizes[IntegrityMaxLayerCount - 1];
s64 layered_hash_sizes[IntegrityMaxLayerCount - 2];
};
static_assert(util::is_pod<HierarchicalIntegrityVerificationSizeSet>::value);

View File

@@ -18,6 +18,7 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class IHash256Generator {
public:
static constexpr size_t HashSize = 256 / BITSIZEOF(u8);
@@ -48,6 +49,7 @@ namespace ams::fssystem {
virtual void DoGetHash(void *dst, size_t dst_size) = 0;
};
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class IHash256GeneratorFactory {
public:
constexpr IHash256GeneratorFactory() = default;
@@ -70,6 +72,7 @@ namespace ams::fssystem {
virtual void DoGenerateHash(void *dst, size_t dst_size, const void *src, size_t src_size) = 0;
};
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class IHash256GeneratorFactorySelector {
public:
constexpr IHash256GeneratorFactorySelector() = default;

View File

@@ -19,6 +19,7 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: Unknown */
class IndirectStorage : public ::ams::fs::IStorage, public ::ams::fs::impl::Newable {
NON_COPYABLE(IndirectStorage);
NON_MOVEABLE(IndirectStorage);

View File

@@ -18,6 +18,7 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
template<bool ContinuousCheck, bool RangeCheck, typename F>
Result IndirectStorage::OperatePerEntry(s64 offset, s64 size, F func) {
/* Validate preconditions. */

View File

@@ -23,6 +23,8 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: Unknown */
constexpr inline size_t IntegrityLayerCountRomFs = 7;
constexpr inline size_t IntegrityHashLayerBlockSize = 16_KB;

View File

@@ -23,6 +23,8 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: Unknown */
class IntegrityVerificationStorage : public ::ams::fs::IStorage {
NON_COPYABLE(IntegrityVerificationStorage);
NON_MOVEABLE(IntegrityVerificationStorage);

View File

@@ -27,7 +27,7 @@ namespace ams::fssystem {
PathCaseSensitiveMode_CaseSensitive = 1,
};
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class LocalFileSystem : public fs::fsa::IFileSystem, public fs::impl::Newable {
NON_COPYABLE(LocalFileSystem);
NON_MOVEABLE(LocalFileSystem);

View File

@@ -25,6 +25,8 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class CompressedStorage;
class AesCtrCounterExtendedStorage;
class IndirectStorage;

View File

@@ -18,6 +18,8 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
struct Hash {
static constexpr size_t Size = crypto::Sha256Generator::HashSize;
u8 value[Size];

View File

@@ -21,6 +21,8 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: Unknown */
template<typename MetaType>
class PartitionFileSystemCore : public fs::impl::Newable, public fs::fsa::IFileSystem {
NON_COPYABLE(PartitionFileSystemCore);

View File

@@ -19,6 +19,8 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: Unknown */
namespace impl {
struct PartitionFileSystemFormat {

View File

@@ -18,6 +18,8 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
namespace impl {
template<typename T, size_t Size>

View File

@@ -19,6 +19,8 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: Unknown */
constexpr inline size_t BufferPoolAlignment = 4_KB;
constexpr inline size_t BufferPoolWorkSize = 320;

View File

@@ -22,6 +22,8 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: Unknown */
class RomFsFileSystem : public fs::fsa::IFileSystem, public fs::impl::Newable {
NON_COPYABLE(RomFsFileSystem);
public:

View File

@@ -19,6 +19,8 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class ServiceContext {
private:
struct DeferredProcessContextForDeviceError {

View File

@@ -19,6 +19,8 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class Sha256HashGenerator final : public ::ams::fssystem::IHash256Generator, public ::ams::fs::impl::Newable {
NON_COPYABLE(Sha256HashGenerator);
NON_MOVEABLE(Sha256HashGenerator);

View File

@@ -19,6 +19,8 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: Unknown */
class SparseStorage : public IndirectStorage {
NON_COPYABLE(SparseStorage);
NON_MOVEABLE(SparseStorage);

View File

@@ -19,6 +19,8 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: Unknown */
class SpeedEmulationConfiguration {
public:
static void SetSpeedEmulationMode(::ams::fs::SpeedEmulationMode mode);

View File

@@ -22,6 +22,8 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class SubDirectoryFileSystem : public fs::fsa::IFileSystem, public fs::impl::Newable {
NON_COPYABLE(SubDirectoryFileSystem);
private:

View File

@@ -19,6 +19,8 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: Unknown */
class ScopedThreadPriorityChanger {
public:
enum class Mode {

View File

@@ -22,6 +22,8 @@
namespace ams::fssystem {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
namespace impl {
template<typename F>

View File

@@ -19,6 +19,7 @@
namespace ams::fssystem::impl {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
template<typename CacheEntryType, typename AllocatorType>
class BlockCacheManager {
NON_COPYABLE(BlockCacheManager);