| 128 | } |
| 129 | |
| 130 | Status MemmappedFileSystem::GetFileSize(const string& filename, uint64* size) { |
| 131 | if (!mapped_memory_) { |
| 132 | return errors::FailedPrecondition("MemmappedEnv is not initialized"); |
| 133 | } |
| 134 | const auto dir_element = directory_.find(filename); |
| 135 | if (dir_element == directory_.end()) { |
| 136 | return errors::NotFound("Region ", filename, " is not found"); |
| 137 | } |
| 138 | *size = dir_element->second.length; |
| 139 | return Status::OK(); |
| 140 | } |
| 141 | |
| 142 | Status MemmappedFileSystem::Stat(const string& fname, FileStatistics* stat) { |
| 143 | uint64 size; |