MCPcopy Create free account
hub / github.com/apache/cloudberry / FreeFile

Function FreeFile

src/backend/storage/file/fd.c:2702–2723  ·  view source on GitHub ↗

* Close a file returned by AllocateFile. * * Note we do not check fclose's return value --- it is up to the caller * to handle close errors. */

Source from the content-addressed store, hash-verified

2700 * to handle close errors.
2701 */
2702int
2703FreeFile(FILE *file)
2704{
2705 int i;
2706
2707 DO_DB(elog(LOG, "FreeFile: Allocated %d", numAllocatedDescs));
2708
2709 /* Remove file from list of allocated files, if it's present */
2710 for (i = numAllocatedDescs; --i >= 0;)
2711 {
2712 AllocateDesc *desc = &allocatedDescs[i];
2713
2714 if (desc->kind == AllocateDescFile && desc->desc.file == file)
2715 return FreeDesc(desc);
2716 }
2717
2718 /* Only get here if someone passes us a file not in allocatedDescs */
2719 elog(WARNING, "file passed to FreeFile was not obtained from AllocateFile");
2720 Assert(false);
2721
2722 return fclose(file);
2723}
2724
2725/*
2726 * Close a file returned by OpenTransientFile.

Callers 15

pg_file_write_internalFunction · 0.85
apw_load_buffersFunction · 0.85
apw_dump_nowFunction · 0.85
pgss_shmem_startupFunction · 0.85
pgss_shmem_shutdownFunction · 0.85
gc_qtextsFunction · 0.85
entry_resetFunction · 0.85
load_relcache_init_fileFunction · 0.85
write_relcache_init_fileFunction · 0.85
ValidatePgVersionFunction · 0.85
AlterSystemSetConfigFileFunction · 0.85

Calls 1

FreeDescFunction · 0.85

Tested by

no test coverage detected