Added knob to disable O_DIRECT
This commit is contained in:
parent
f41f19b5f6
commit
7ad0e20e48
|
@ -248,7 +248,7 @@ private:
|
|||
if( flags & OPEN_READWRITE ) oflags |= O_RDWR;
|
||||
if( flags & OPEN_ATOMIC_WRITE_AND_CREATE ) oflags |= O_TRUNC;
|
||||
#if defined(__linux__)
|
||||
if ( flags & OPEN_UNBUFFERED ) oflags |= O_DIRECT;
|
||||
if ( flags & OPEN_UNBUFFERED && !FLOW_KNOBS->DISABLE_ODIRECT ) oflags |= O_DIRECT;
|
||||
#endif
|
||||
return oflags;
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ Future< Reference<class IAsyncFile> > Net2FileSystem::open( std::string filename
|
|||
// cases, DISABLE_POSIX_KERNEL_AIO knob can be enabled to fallback to EIO instead
|
||||
// of Kernel AIO.
|
||||
if ((flags & IAsyncFile::OPEN_UNBUFFERED) && !(flags & IAsyncFile::OPEN_NO_AIO) &&
|
||||
!FLOW_KNOBS->DISABLE_POSIX_KERNEL_AIO)
|
||||
!FLOW_KNOBS->DISABLE_POSIX_KERNEL_AIO && !FLOW_KNOBS->DISABLE_ODIRECT)
|
||||
f = AsyncFileKAIO::open(filename, flags, mode, NULL);
|
||||
else
|
||||
#endif
|
||||
|
|
|
@ -87,6 +87,7 @@ FlowKnobs::FlowKnobs(bool randomize, bool isSimulated) {
|
|||
|
||||
//AsyncFileEIO
|
||||
init( EIO_MAX_PARALLELISM, 4 );
|
||||
init( DISABLE_ODIRECT, 0 );
|
||||
|
||||
//AsyncFileKAIO
|
||||
init( MAX_OUTSTANDING, 64 );
|
||||
|
|
|
@ -107,6 +107,7 @@ public:
|
|||
|
||||
//AsyncFileEIO
|
||||
int EIO_MAX_PARALLELISM;
|
||||
int DISABLE_ODIRECT;
|
||||
|
||||
//AsyncFileKAIO
|
||||
int MAX_OUTSTANDING;
|
||||
|
|
Loading…
Reference in New Issue