Use O_NOATIME while scanning (if available) to avoid updating file access times.

This commit is contained in:
Brian Cox 2016-05-24 18:50:00 -07:00
parent 778c397d48
commit 0082db13fa
1 changed files with 19 additions and 14 deletions

View File

@ -133,7 +133,7 @@ void cFile::Open( const TSTRING& sFileNameC, uint32 flags )
Close();
//
// set up the sopen permissions
// set up the open permissions
//
int perm = 0;
@ -173,6 +173,11 @@ void cFile::Open( const TSTRING& sFileNameC, uint32 flags )
perm |= O_NONBLOCK;
#endif
#ifdef O_NOATIME
if (flags & OPEN_SCANNING)
perm |= O_NOATIME;
#endif
#ifdef O_DIRECT
//Only use O_DIRECT for scanning, since cfg/policy/report reads
// don't happen w/ a nice round block size.