Apache Lucene open-source search software
LUCENE-2787: disable atime for DirectIOLinuxDirectory
Robert Muir8ec36c3f5676
diff --git a/lucene/contrib/misc/src/java/org/apache/lucene/store/NativePosixUtil.cpp b/lucene/contrib/misc/src/java/org/apache/lucene/store/NativePosixUtil.cppindex ced785fff6d..7ccf7e7b445 100644--- a/lucene/contrib/misc/src/java/org/apache/lucene/store/NativePosixUtil.cpp+++ b/lucene/contrib/misc/src/java/org/apache/lucene/store/NativePosixUtil.cpp@@ -97,9 +97,9 @@ JNIEXPORT jobject JNICALL Java_org_apache_lucene_store_NativePosixUtil_open_1dirfname = (char *) env->GetStringUTFChars(filename, NULL);if (readOnly) {- fd = open(fname, O_RDONLY | O_DIRECT);+ fd = open(fname, O_RDONLY | O_DIRECT | O_NOATIME);} else {- fd = open(fname, O_RDWR | O_CREAT | O_DIRECT, 0666);+ fd = open(fname, O_RDWR | O_CREAT | O_DIRECT | O_NOATIME, 0666);}//printf("open %s -> %d; ro %d\n", fname, fd, readOnly); fflush(stdout);