void FileInvalidate(File file) { Assert(FileIsValid(file)); if (!FileIsNotOpen(file)) LruDelete(file); }
/* * Called when we get a shared invalidation message on some relation. */ void FileInvalidate(File file) { if (!FileIsNotOpen(file)) { LruDelete(file); } }
void closeAllVfds() { int i; for (i=0; i<SizeVfdCache; i++) { if (!FileIsNotOpen(i)) LruDelete(i); } }
static void AssertLruRoom() { DO_DB(printf("DEBUG: AssertLruRoom (FreeFd = %d)\n", FreeFd)); if (FreeFd <= 0 || nfile >= MAXFILES) { LruDelete(VfdCache[0].lruMoreRecently); } }
/* * closeAllVfds * * Force all VFDs into the physically-closed state, so that the fewest * possible number of kernel file descriptors are in use. There is no * change in the logical state of the VFDs. */ void closeAllVfds(void) { Index i; if (SizeVfdCache > 0) { Assert(FileIsNotOpen(0)); /* Make sure ring not corrupted */ for (i = 1; i < SizeVfdCache; i++) { if (!FileIsNotOpen(i)) LruDelete(i); } } }
static bool ReleaseLruFile(void) { DO_DB(elog(LOG, "ReleaseLruFile. Opened %d", nfile)); if (nfile > 0) { /* * There are opened files and so there should be at least one used vfd * in the ring. */ Assert(VfdCache[0].lruMoreRecently != 0); LruDelete(VfdCache[0].lruMoreRecently); return true; /* freed a file */ } return false; /* no files available to free */ }