| 109 | } |
| 110 | |
| 111 | Net2FileSystem::Net2FileSystem(double ioTimeout, const std::string& fileSystemPath) { |
| 112 | Net2AsyncFile::init(); |
| 113 | #ifdef __linux__ |
| 114 | if (!FLOW_KNOBS->DISABLE_POSIX_KERNEL_AIO) |
| 115 | AsyncFileKAIO::init(Reference<IEventFD>(N2::ASIOReactor::getEventFD()), ioTimeout); |
| 116 | |
| 117 | if (fileSystemPath.empty()) { |
| 118 | checkFileSystem = false; |
| 119 | } else { |
| 120 | checkFileSystem = true; |
| 121 | |
| 122 | try { |
| 123 | this->fileSystemDeviceId = getDeviceId(fileSystemPath); |
| 124 | if (fileSystemPath != "/") { |
| 125 | dev_t fileSystemParentDeviceId = getDeviceId(parentDirectory(fileSystemPath)); |
| 126 | if (this->fileSystemDeviceId == fileSystemParentDeviceId) { |
| 127 | criticalError(FDB_EXIT_ERROR, |
| 128 | "FileSystemError", |
| 129 | format("`%s' is not a mount point", fileSystemPath.c_str()).c_str()); |
| 130 | } |
| 131 | } |
| 132 | } catch (Error&) { |
| 133 | criticalError(FDB_EXIT_ERROR, |
| 134 | "FileSystemError", |
| 135 | format("Could not get device id from `%s'", fileSystemPath.c_str()).c_str()); |
| 136 | } |
| 137 | } |
| 138 | #endif |
| 139 | } |
| 140 | |
| 141 | Future<Void> Net2FileSystem::renameFile(const std::string& from, const std::string& to) { |
| 142 | return Net2AsyncFile::renameFile(from, to); |
nothing calls this directly
no test coverage detected