Linux: enable direct IO for verify

Linux has huge buffer cache (all free memory)
So make sure we are reading data back from the actual card instead
of cache.
This commit is contained in:
Floris Bos 2020-05-23 21:40:52 +02:00
parent eef90c2adb
commit b08ed20e5f

View file

@ -603,6 +603,11 @@ bool DownloadThread::_verify()
QElapsedTimer t1;
t1.start();
#ifdef Q_OS_LINUX
/* Make sure we are reading from the drive and not from cache */
fcntl(_file.handle(), F_SETFL, O_DIRECT | fcntl(_file.handle(), F_GETFL));
#endif
if (!_firstBlock)
{
_file.seek(0);