MCPcopy Create free account
hub / github.com/apple/foundationdb / Net2FileSystem

Method Net2FileSystem

fdbrpc/Net2FileSystem.cpp:111–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111Net2FileSystem::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
141Future<Void> Net2FileSystem::renameFile(const std::string& from, const std::string& to) {
142 return Net2AsyncFile::renameFile(from, to);

Callers

nothing calls this directly

Calls 7

getDeviceIdFunction · 0.85
criticalErrorFunction · 0.85
initFunction · 0.50
parentDirectoryFunction · 0.50
formatFunction · 0.50
emptyMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected