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

@@ -19,15 +19,16 @@ Device::Device(const std::string& mount_path) : mount_path_(mount_path) {}
Device::~Device() = default;
void Device::Dump(StringBuffer* string_buffer) {
std::lock_guard<xe::mutex> lock(mutex_);
root_entry_->Dump(string_buffer, 0);
}
Entry* Device::ResolvePath(const char* path) {
Entry* Device::ResolvePath(std::string path) {
// The filesystem will have stripped our prefix off already, so the path will
// be in the form:
// some\PATH.foo
XELOGFS("Device::ResolvePath(%s)", path);
XELOGFS("Device::ResolvePath(%s)", path.c_str());
// Walk the path, one separator at a time.
auto entry = root_entry_.get();