diff --git a/fdbrpc/AsyncFileKAIO.actor.h b/fdbrpc/AsyncFileKAIO.actor.h index b38baf5da8..6f9f781862 100644 --- a/fdbrpc/AsyncFileKAIO.actor.h +++ b/fdbrpc/AsyncFileKAIO.actor.h @@ -97,6 +97,7 @@ public: #endif static Future> open( std::string filename, int flags, int mode, void* ignore ) { + ASSERT( !FLOW_KNOBS->DISABLE_POSIX_KERNEL_AIO ); ASSERT( flags & OPEN_UNBUFFERED ); if (flags & OPEN_LOCK) @@ -153,6 +154,7 @@ public: } static void init( Reference ev, double ioTimeout ) { + ASSERT( !FLOW_KNOBS->DISABLE_POSIX_KERNEL_AIO ); if( !g_network->isSimulated() ) { ctx.countAIOSubmit.init(LiteralStringRef("AsyncFile.CountAIOSubmit")); ctx.countAIOCollect.init(LiteralStringRef("AsyncFile.CountAIOCollect")); @@ -578,7 +580,7 @@ private: static Context ctx; explicit AsyncFileKAIO(int fd, int flags, std::string const& filename) : fd(fd), flags(flags), filename(filename), failed(false) { - + ASSERT( !FLOW_KNOBS->DISABLE_POSIX_KERNEL_AIO ); if( !g_network->isSimulated() ) { countFileLogicalWrites.init(LiteralStringRef("AsyncFile.CountFileLogicalWrites"), filename); countFileLogicalReads.init( LiteralStringRef("AsyncFile.CountFileLogicalReads"), filename); diff --git a/fdbrpc/Net2FileSystem.cpp b/fdbrpc/Net2FileSystem.cpp index d348edfa17..0331d6413a 100644 --- a/fdbrpc/Net2FileSystem.cpp +++ b/fdbrpc/Net2FileSystem.cpp @@ -93,6 +93,9 @@ Net2FileSystem::Net2FileSystem(double ioTimeout, std::string fileSystemPath) { Net2AsyncFile::init(); #ifdef __linux__ + if (FLOW_KNOBS->DISABLE_POSIX_KERNEL_AIO) + return; + AsyncFileKAIO::init( Reference(N2::ASIOReactor::getEventFD()), ioTimeout ); if (fileSystemPath.empty()) {