Removed O_DIRECT since it breaks on 2.4 kernels. Need to figure out how to

detect this in the build script so that systems that support O_DIRECT can use it.

(Note:  RedHat kernels silently fail on O_DIRECT)
This commit is contained in:
Sears Russell 2005-01-24 19:58:09 +00:00
parent 5a2d2bde31
commit 05934d296a
2 changed files with 5 additions and 3 deletions

View file

@ -147,7 +147,9 @@ void pageInit() {
for(int i = 0; i < MAX_BUFFER_SIZE+1; i++) { for(int i = 0; i < MAX_BUFFER_SIZE+1; i++) {
pool[i].rwlatch = initlock(); pool[i].rwlatch = initlock();
pool[i].loadlatch = initlock(); pool[i].loadlatch = initlock();
assert(!posix_memalign((void*)(&(pool[i].memAddr)), PAGE_SIZE, PAGE_SIZE)); int ret = posix_memalign((void*)(&(pool[i].memAddr)), PAGE_SIZE, PAGE_SIZE);
assert(!ret);
} }
pthread_mutex_init(&lastAllocedPage_mutex , NULL); pthread_mutex_init(&lastAllocedPage_mutex , NULL);

View file

@ -116,12 +116,12 @@ void pageWrite(Page * ret) {
} }
pthread_mutex_unlock(&stable_mutex); pthread_mutex_unlock(&stable_mutex);
} }
/** @todo O_DIRECT is broken on old (pre 2.6.2ish?) linux, so it's disabled until the build script can be improved. :( */
void openPageFile() { void openPageFile() {
DEBUG("Opening storefile.\n"); DEBUG("Opening storefile.\n");
stable = open (STORE_FILE, O_CREAT | O_RDWR | O_DIRECT, S_IRWXU | S_IRWXG | S_IRWXO); stable = open (STORE_FILE, O_CREAT | O_RDWR /*| O_DIRECT*/, S_IRWXU | S_IRWXG | S_IRWXO);
if(stable == -1) { if(stable == -1) {
perror("couldn't open storefile"); perror("couldn't open storefile");