Use O_NOATIME while scanning (if available) to avoid updating file access times.
This commit is contained in:
parent
778c397d48
commit
0082db13fa
|
@ -133,7 +133,7 @@ void cFile::Open( const TSTRING& sFileNameC, uint32 flags )
|
||||||
Close();
|
Close();
|
||||||
|
|
||||||
//
|
//
|
||||||
// set up the sopen permissions
|
// set up the open permissions
|
||||||
//
|
//
|
||||||
int perm = 0;
|
int perm = 0;
|
||||||
|
|
||||||
|
@ -173,6 +173,11 @@ void cFile::Open( const TSTRING& sFileNameC, uint32 flags )
|
||||||
perm |= O_NONBLOCK;
|
perm |= O_NONBLOCK;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef O_NOATIME
|
||||||
|
if (flags & OPEN_SCANNING)
|
||||||
|
perm |= O_NOATIME;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef O_DIRECT
|
#ifdef O_DIRECT
|
||||||
//Only use O_DIRECT for scanning, since cfg/policy/report reads
|
//Only use O_DIRECT for scanning, since cfg/policy/report reads
|
||||||
// don't happen w/ a nice round block size.
|
// don't happen w/ a nice round block size.
|
||||||
|
|
Loading…
Reference in New Issue