static void Insert(File file) { Vfd *vfdP; DO_DB(printf("DEBUG: Insert %d (%s)\n", file, VfdCache[file].fileName)); DO_DB(_dump_lru()); vfdP = &VfdCache[file]; vfdP->lruMoreRecently = 0; vfdP->lruLessRecently = VfdCache[0].lruLessRecently; VfdCache[0].lruLessRecently = file; VfdCache[vfdP->lruLessRecently].lruMoreRecently = file; DO_DB(_dump_lru()); }
static void Delete(File file) { Vfd *vfdP; Assert(file != 0); DO_DB(elog(LOG, "Delete %d (%s)", file, VfdCache[file].fileName)); DO_DB(_dump_lru()); vfdP = &VfdCache[file]; VfdCache[vfdP->lruLessRecently].lruMoreRecently = vfdP->lruMoreRecently; VfdCache[vfdP->lruMoreRecently].lruLessRecently = vfdP->lruLessRecently; DO_DB(_dump_lru()); }
static void Insert(File file) { Vfd *vfdP; Assert(file != 0); DO_DB(elog(LOG, "Insert %d (%s)", file, VfdCache[file].fileName)); DO_DB(_dump_lru()); vfdP = &VfdCache[file]; vfdP->lruMoreRecently = 0; vfdP->lruLessRecently = VfdCache[0].lruLessRecently; VfdCache[0].lruLessRecently = file; VfdCache[vfdP->lruLessRecently].lruMoreRecently = file; DO_DB(_dump_lru()); }
static void Delete(File file) { Vfd *fileP; DO_DB(printf("DEBUG: Delete %d (%s)\n", file, VfdCache[file].fileName)); DO_DB(_dump_lru()); Assert(file != 0); fileP = &VfdCache[file]; VfdCache[fileP->lruLessRecently].lruMoreRecently = VfdCache[file].lruMoreRecently; VfdCache[fileP->lruMoreRecently].lruLessRecently = VfdCache[file].lruLessRecently; DO_DB(_dump_lru()); }