Moving code out of vfs/ that doesn't need to be there.
Progress on #294.
This commit is contained in:
@@ -31,6 +31,14 @@ class DiscImageDevice : public Device {
|
||||
|
||||
std::unique_ptr<Entry> ResolvePath(const char* path) override;
|
||||
|
||||
uint32_t total_allocation_units() const override {
|
||||
return uint32_t(mmap_->size() / sectors_per_allocation_unit() /
|
||||
bytes_per_sector());
|
||||
}
|
||||
uint32_t available_allocation_units() const override { return 0; }
|
||||
uint32_t sectors_per_allocation_unit() const override { return 1; }
|
||||
uint32_t bytes_per_sector() const override { return 2 * 1024; }
|
||||
|
||||
private:
|
||||
std::wstring local_path_;
|
||||
std::unique_ptr<MappedMemory> mmap_;
|
||||
|
||||
@@ -27,6 +27,11 @@ class HostPathDevice : public Device {
|
||||
|
||||
std::unique_ptr<Entry> ResolvePath(const char* path) override;
|
||||
|
||||
uint32_t total_allocation_units() const override { return 128 * 1024; }
|
||||
uint32_t available_allocation_units() const override { return 128 * 1024; }
|
||||
uint32_t sectors_per_allocation_unit() const override { return 1; }
|
||||
uint32_t bytes_per_sector() const override { return 2 * 1024; }
|
||||
|
||||
private:
|
||||
std::wstring local_path_;
|
||||
bool read_only_;
|
||||
|
||||
@@ -31,6 +31,14 @@ class STFSContainerDevice : public Device {
|
||||
|
||||
std::unique_ptr<Entry> ResolvePath(const char* path) override;
|
||||
|
||||
uint32_t total_allocation_units() const override {
|
||||
return uint32_t(mmap_->size() / sectors_per_allocation_unit() /
|
||||
bytes_per_sector());
|
||||
}
|
||||
uint32_t available_allocation_units() const override { return 0; }
|
||||
uint32_t sectors_per_allocation_unit() const override { return 1; }
|
||||
uint32_t bytes_per_sector() const override { return 4 * 1024; }
|
||||
|
||||
private:
|
||||
std::wstring local_path_;
|
||||
std::unique_ptr<MappedMemory> mmap_;
|
||||
|
||||
Reference in New Issue
Block a user