mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-19 01:15:08 -04:00
fs: first pass at compressed storage (works on iridium with wip hac2l code)
This commit is contained in:
parent
df631d74f0
commit
d638bbbb62
34 changed files with 2375 additions and 722 deletions
|
@ -29,13 +29,17 @@ namespace ams::fssystem {
|
|||
R_UNLESS(buffer != nullptr, fs::ResultNullptrArgument());
|
||||
|
||||
if (this->GetEntryTable().IsEmpty()) {
|
||||
R_UNLESS(this->GetEntryTable().Includes(offset, size), fs::ResultOutOfRange());
|
||||
BucketTree::Offsets table_offsets;
|
||||
R_TRY(this->GetEntryTable().GetOffsets(std::addressof(table_offsets)));
|
||||
|
||||
R_UNLESS(table_offsets.IsInclude(offset, size), fs::ResultOutOfRange());
|
||||
|
||||
std::memset(buffer, 0, size);
|
||||
} else {
|
||||
R_TRY(this->OperatePerEntry<false>(offset, size, [=](fs::IStorage *storage, s64 data_offset, s64 cur_offset, s64 cur_size) -> Result {
|
||||
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();
|
||||
}));
|
||||
})));
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue