Adding locks and parents to vfs.

Progress on #305.
This commit is contained in:
Ben Vanik
2015-06-29 05:07:29 -07:00
parent 9a80b5e5be
commit 0104a2290f
16 changed files with 65 additions and 40 deletions

View File

@@ -89,7 +89,7 @@ bool DiscImageDevice::VerifyMagic(ParseState& state, size_t offset) {
DiscImageDevice::Error DiscImageDevice::ReadAllEntries(
ParseState& state, const uint8_t* root_buffer) {
auto root_entry = new DiscImageEntry(this, "", mmap_.get());
auto root_entry = new DiscImageEntry(this, nullptr, "", mmap_.get());
root_entry->attributes_ = kFileAttributeDirectory;
root_entry_ = std::unique_ptr<Entry>(root_entry);
@@ -117,8 +117,8 @@ bool DiscImageDevice::ReadEntry(ParseState& state, const uint8_t* buffer,
return false;
}
auto entry =
new DiscImageEntry(this, std::string(name, name_length), mmap_.get());
auto entry = new DiscImageEntry(this, parent, std::string(name, name_length),
mmap_.get());
entry->attributes_ = attributes | kFileAttributeReadOnly;
entry->size_ = length;
entry->allocation_size_ = xe::round_up(length, bytes_per_sector());