PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <sys/file.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <limits.h>
#include <unistd.h>
#include <fcntl.h>
#include "access/xact.h"
#include "access/xlog.h"
#include "catalog/pg_tablespace.h"
#include "common/file_perm.h"
#include "common/file_utils.h"
#include "miscadmin.h"
#include "pgstat.h"
#include "port/pg_iovec.h"
#include "portability/mem.h"
#include "storage/fd.h"
#include "storage/ipc.h"
#include "utils/guc.h"
#include "utils/resowner_private.h"
Go to the source code of this file.
Data Structures | |
struct | vfd |
struct | AllocateDesc |
Macros | |
#define | NUM_RESERVED_FDS 10 |
#define | FD_MINFREE 48 |
#define | DO_DB(A) ((void) 0) |
#define | VFD_CLOSED (-1) |
#define | FileIsValid(file) ((file) > 0 && (file) < (int) SizeVfdCache && VfdCache[file].fileName != NULL) |
#define | FileIsNotOpen(file) (VfdCache[file].fd == VFD_CLOSED) |
#define | FD_DELETE_AT_CLOSE (1 << 0) /* T = delete when closed */ |
#define | FD_CLOSE_AT_EOXACT (1 << 1) /* T = close at eoXact */ |
#define | FD_TEMP_FILE_LIMIT (1 << 2) /* T = respect temp_file_limit */ |
Typedefs | |
typedef struct vfd | Vfd |
Enumerations | |
enum | AllocateDescKind { AllocateDescFile, AllocateDescPipe, AllocateDescDir, AllocateDescRawFD } |
Functions | |
static void | Delete (File file) |
static void | LruDelete (File file) |
static void | Insert (File file) |
static int | LruInsert (File file) |
static bool | ReleaseLruFile (void) |
static void | ReleaseLruFiles (void) |
static File | AllocateVfd (void) |
static void | FreeVfd (File file) |
static int | FileAccess (File file) |
static File | OpenTemporaryFileInTablespace (Oid tblspcOid, bool rejectError) |
static bool | reserveAllocatedDesc (void) |
static int | FreeDesc (AllocateDesc *desc) |
static void | AtProcExit_Files (int code, Datum arg) |
static void | CleanupTempFiles (bool isCommit, bool isProcExit) |
static void | RemovePgTempRelationFiles (const char *tsdirname) |
static void | RemovePgTempRelationFilesInDbspace (const char *dbspacedirname) |
static void | walkdir (const char *path, void(*action)(const char *fname, bool isdir, int elevel), bool process_symlinks, int elevel) |
static void | datadir_fsync_fname (const char *fname, bool isdir, int elevel) |
static void | unlink_if_exists_fname (const char *fname, bool isdir, int elevel) |
static int | fsync_parent_path (const char *fname, int elevel) |
int | pg_fsync (int fd) |
int | pg_fsync_no_writethrough (int fd) |
int | pg_fsync_writethrough (int fd) |
int | pg_fdatasync (int fd) |
void | pg_flush_data (int fd, off_t offset, off_t nbytes) |
int | pg_truncate (const char *path, off_t length) |
void | fsync_fname (const char *fname, bool isdir) |
int | durable_rename (const char *oldfile, const char *newfile, int elevel) |
int | durable_unlink (const char *fname, int elevel) |
int | durable_rename_excl (const char *oldfile, const char *newfile, int elevel) |
void | InitFileAccess (void) |
static void | count_usable_fds (int max_to_probe, int *usable_fds, int *already_open) |
void | set_max_safe_fds (void) |
int | BasicOpenFile (const char *fileName, int fileFlags) |
int | BasicOpenFilePerm (const char *fileName, int fileFlags, mode_t fileMode) |
bool | AcquireExternalFD (void) |
void | ReserveExternalFD (void) |
void | ReleaseExternalFD (void) |
static void | ReportTemporaryFileUsage (const char *path, off_t size) |
static void | RegisterTemporaryFile (File file) |
File | PathNameOpenFile (const char *fileName, int fileFlags) |
File | PathNameOpenFilePerm (const char *fileName, int fileFlags, mode_t fileMode) |
void | PathNameCreateTemporaryDir (const char *basedir, const char *directory) |
void | PathNameDeleteTemporaryDir (const char *dirname) |
File | OpenTemporaryFile (bool interXact) |
void | TempTablespacePath (char *path, Oid tablespace) |
File | PathNameCreateTemporaryFile (const char *path, bool error_on_failure) |
File | PathNameOpenTemporaryFile (const char *path, int mode) |
bool | PathNameDeleteTemporaryFile (const char *path, bool error_on_failure) |
void | FileClose (File file) |
int | FilePrefetch (File file, off_t offset, int amount, uint32 wait_event_info) |
void | FileWriteback (File file, off_t offset, off_t nbytes, uint32 wait_event_info) |
int | FileRead (File file, char *buffer, int amount, off_t offset, uint32 wait_event_info) |
int | FileWrite (File file, char *buffer, int amount, off_t offset, uint32 wait_event_info) |
int | FileSync (File file, uint32 wait_event_info) |
off_t | FileSize (File file) |
int | FileTruncate (File file, off_t offset, uint32 wait_event_info) |
char * | FilePathName (File file) |
int | FileGetRawDesc (File file) |
int | FileGetRawFlags (File file) |
mode_t | FileGetRawMode (File file) |
FILE * | AllocateFile (const char *name, const char *mode) |
int | OpenTransientFile (const char *fileName, int fileFlags) |
int | OpenTransientFilePerm (const char *fileName, int fileFlags, mode_t fileMode) |
FILE * | OpenPipeStream (const char *command, const char *mode) |
int | FreeFile (FILE *file) |
int | CloseTransientFile (int fd) |
DIR * | AllocateDir (const char *dirname) |
struct dirent * | ReadDir (DIR *dir, const char *dirname) |
struct dirent * | ReadDirExtended (DIR *dir, const char *dirname, int elevel) |
int | FreeDir (DIR *dir) |
int | ClosePipeStream (FILE *file) |
void | closeAllVfds (void) |
void | SetTempTablespaces (Oid *tableSpaces, int numSpaces) |
bool | TempTablespacesAreSet (void) |
int | GetTempTablespaces (Oid *tableSpaces, int numSpaces) |
Oid | GetNextTempTableSpace (void) |
void | AtEOSubXact_Files (bool isCommit, SubTransactionId mySubid, SubTransactionId parentSubid) |
void | AtEOXact_Files (bool isCommit) |
void | RemovePgTempFiles (void) |
void | RemovePgTempFilesInDir (const char *tmpdirname, bool missing_ok, bool unlink_all) |
bool | looks_like_temp_rel_name (const char *name) |
void | SyncDataDirectory (void) |
int | fsync_fname_ext (const char *fname, bool isdir, bool ignore_perm, int elevel) |
int | MakePGDirectory (const char *directoryName) |
int | data_sync_elevel (int elevel) |
ssize_t | pg_pwritev_with_retry (int fd, const struct iovec *iov, int iovcnt, off_t offset) |
Variables | |
int | max_files_per_process = 1000 |
int | max_safe_fds = FD_MINFREE |
bool | data_sync_retry = false |
static Vfd * | VfdCache |
static Size | SizeVfdCache = 0 |
static int | nfile = 0 |
static bool | have_xact_temporary_files = false |
static uint64 | temporary_files_size = 0 |
static int | numAllocatedDescs = 0 |
static int | maxAllocatedDescs = 0 |
static AllocateDesc * | allocatedDescs = NULL |
static int | numExternalFDs = 0 |
static long | tempFileCounter = 0 |
static Oid * | tempTableSpaces = NULL |
static int | numTempTableSpaces = -1 |
static int | nextTempTableSpace = 0 |
#define DO_DB | ( | A | ) | ((void) 0) |
Definition at line 171 of file fd.c.
Referenced by AllocateDir(), AllocateFile(), AllocateVfd(), ClosePipeStream(), CloseTransientFile(), Delete(), FileAccess(), FileClose(), FilePrefetch(), FileRead(), FileSize(), FileSync(), FileTruncate(), FileWrite(), FileWriteback(), FreeDir(), FreeFile(), FreeVfd(), Insert(), LruDelete(), LruInsert(), OpenPipeStream(), OpenTransientFilePerm(), PathNameOpenFilePerm(), and ReleaseLruFile().
Definition at line 184 of file fd.c.
Referenced by CleanupTempFiles(), and RegisterTemporaryFile().
Definition at line 183 of file fd.c.
Referenced by CleanupTempFiles(), FileClose(), and OpenTemporaryFile().
#define FD_MINFREE 48 |
Definition at line 135 of file fd.c.
Referenced by reserveAllocatedDesc(), and set_max_safe_fds().
#define FD_TEMP_FILE_LIMIT (1 << 2) /* T = respect temp_file_limit */ |
Definition at line 185 of file fd.c.
Referenced by FileClose(), FileTruncate(), FileWrite(), LruDelete(), OpenTemporaryFile(), and PathNameCreateTemporaryFile().
#define FileIsNotOpen | ( | file | ) | (VfdCache[file].fd == VFD_CLOSED) |
Definition at line 180 of file fd.c.
Referenced by CleanupTempFiles(), closeAllVfds(), FileAccess(), FileClose(), FileSize(), LruInsert(), and RegisterTemporaryFile().
#define FileIsValid | ( | file | ) | ((file) > 0 && (file) < (int) SizeVfdCache && VfdCache[file].fileName != NULL) |
Definition at line 177 of file fd.c.
Referenced by FileClose(), FileGetRawDesc(), FileGetRawFlags(), FileGetRawMode(), FilePathName(), FilePrefetch(), FileRead(), FileSize(), FileSync(), FileTruncate(), FileWrite(), FileWriteback(), and RegisterTemporaryFile().
#define NUM_RESERVED_FDS 10 |
Definition at line 126 of file fd.c.
Referenced by set_max_safe_fds().
#define VFD_CLOSED (-1) |
Definition at line 175 of file fd.c.
Referenced by AllocateVfd(), FileClose(), InitFileAccess(), and LruDelete().
enum AllocateDescKind |
bool AcquireExternalFD | ( | void | ) |
Definition at line 1076 of file fd.c.
References max_safe_fds, numExternalFDs, and ReserveExternalFD().
Referenced by connect_pg_server(), CreateWaitEventSet(), dblink_connect(), and dblink_get_conn().
DIR* AllocateDir | ( | const char * | dirname | ) |
Definition at line 2615 of file fd.c.
References AllocateDescDir, AllocateDesc::create_subid, AllocateDesc::desc, AllocateDesc::dir, DO_DB, elog, ereport, errcode(), errmsg(), ERROR, GetCurrentSubTransactionId(), AllocateDesc::kind, LOG, maxAllocatedDescs, numAllocatedDescs, opendir(), ReleaseLruFile(), ReleaseLruFiles(), and reserveAllocatedDesc().
Referenced by calculate_database_size(), calculate_tablespace_size(), CheckPointLogicalRewriteHeap(), CheckPointSnapBuild(), CleanupBackupHistory(), copydir(), db_dir_size(), DeleteAllExportedSnapshotFiles(), destroy_tablespace_directories(), directory_is_empty(), do_pg_start_backup(), dsm_cleanup_for_mmap(), extension_file_exists(), get_ext_ver_list(), getInstallationPaths(), movedb(), ParseTzFile(), perform_base_backup(), pg_available_extension_versions(), pg_available_extensions(), pg_logdir_ls_internal(), pg_ls_dir(), pg_ls_dir_files(), pg_tablespace_databases(), pg_tzenumerate_next(), pg_tzenumerate_start(), pgarch_readyXlog(), pgstat_reset_remove_files(), RelationCacheInitFileRemove(), RelationCacheInitFileRemoveInDir(), RemoveNonParentXlogFiles(), RemoveOldXlogFiles(), RemovePgTempFiles(), RemovePgTempFilesInDir(), RemovePgTempRelationFiles(), RemovePgTempRelationFilesInDbspace(), RemoveTempXlogFiles(), ReorderBufferCleanupSerializedTXNs(), ResetUnloggedRelations(), ResetUnloggedRelationsInDbspaceDir(), ResetUnloggedRelationsInTablespaceDir(), restoreTwoPhaseData(), scan_directory_ci(), sendDir(), SlruScanDirectory(), StartupReorderBuffer(), StartupReplicationSlots(), UpdateLogicalMappings(), and walkdir().
FILE* AllocateFile | ( | const char * | name, |
const char * | mode | ||
) |
Definition at line 2354 of file fd.c.
References AllocateDescFile, AllocateDesc::create_subid, AllocateDesc::desc, DO_DB, elog, ereport, errcode(), errmsg(), ERROR, AllocateDesc::file, GetCurrentSubTransactionId(), AllocateDesc::kind, LOG, maxAllocatedDescs, numAllocatedDescs, ReleaseLruFile(), ReleaseLruFiles(), and reserveAllocatedDesc().
Referenced by _ShowOption(), AlterSystemSetConfigFile(), apw_dump_now(), apw_load_buffers(), BackendRun(), BeginCopyFrom(), BeginCopyTo(), checkControlFile(), do_pg_start_backup(), do_pg_stop_backup(), entry_reset(), existsTimeLineHistory(), ExportSnapshot(), fill_hba_view(), gc_qtexts(), ImportSnapshot(), load_dh_file(), load_hba(), load_ident(), load_relcache_init_file(), parse_extension_control_file(), ParseTzFile(), pg_backup_start_time(), pg_current_logfile(), pg_file_write_internal(), pg_promote(), PGSharedMemoryAttach(), pgss_shmem_shutdown(), pgss_shmem_startup(), pgstat_read_db_statsfile(), pgstat_read_db_statsfile_timestamp(), pgstat_read_statsfiles(), pgstat_write_db_statsfile(), pgstat_write_statsfiles(), PostmasterMarkPIDForWorkerNotify(), read_backup_label(), read_binary_file(), read_tablespace_map(), read_whole_file(), readTimeLineHistory(), tokenize_inc_file(), tsearch_readline_begin(), ValidatePgVersion(), write_relcache_init_file(), XLogArchiveForceDone(), and XLogArchiveNotify().
|
static |
Definition at line 1304 of file fd.c.
References Assert, DO_DB, elog, ereport, errcode(), errmsg(), ERROR, vfd::fd, i, LOG, MemSet, vfd::nextFree, realloc, SizeVfdCache, and VFD_CLOSED.
Referenced by PathNameOpenFilePerm().
void AtEOSubXact_Files | ( | bool | isCommit, |
SubTransactionId | mySubid, | ||
SubTransactionId | parentSubid | ||
) |
Definition at line 2903 of file fd.c.
References AllocateDesc::create_subid, FreeDesc(), i, and numAllocatedDescs.
Referenced by AbortSubTransaction(), and CommitSubTransaction().
void AtEOXact_Files | ( | bool | isCommit | ) |
Definition at line 2936 of file fd.c.
References CleanupTempFiles(), numTempTableSpaces, and tempTableSpaces.
Referenced by AbortTransaction(), AutoVacLauncherMain(), BackgroundWriterMain(), CheckpointerMain(), CommitTransaction(), PrepareTransaction(), and WalWriterMain().
|
static |
Definition at line 2950 of file fd.c.
References CleanupTempFiles().
Referenced by InitFileAccess().
int BasicOpenFile | ( | const char * | fileName, |
int | fileFlags | ||
) |
Definition at line 1014 of file fd.c.
References BasicOpenFilePerm(), and pg_file_create_mode.
Referenced by AlterSystemSetConfigFile(), ReadControlFile(), update_controlfile(), wal_segment_open(), WalSndSegmentOpen(), WriteControlFile(), XLogFileInit(), XLogFileOpen(), and XLogFileRead().
int BasicOpenFilePerm | ( | const char * | fileName, |
int | fileFlags, | ||
mode_t | fileMode | ||
) |
Definition at line 1036 of file fd.c.
References ereport, errcode(), errmsg(), vfd::fd, LOG, and ReleaseLruFile().
Referenced by BasicOpenFile(), LruInsert(), OpenTransientFilePerm(), PathNameOpenFilePerm(), and readRecoverySignalFile().
Definition at line 2968 of file fd.c.
References Assert, elog, FD_CLOSE_AT_EOXACT, FD_DELETE_AT_CLOSE, vfd::fdstate, FileClose(), FileIsNotOpen, vfd::fileName, FreeDesc(), have_xact_temporary_files, i, numAllocatedDescs, SizeVfdCache, and WARNING.
Referenced by AtEOXact_Files(), and AtProcExit_Files().
void closeAllVfds | ( | void | ) |
Definition at line 2792 of file fd.c.
References Assert, FileIsNotOpen, i, LruDelete(), and SizeVfdCache.
Referenced by standard_ProcessUtility().
int ClosePipeStream | ( | FILE * | file | ) |
Definition at line 2763 of file fd.c.
References AllocateDescPipe, AllocateDesc::desc, DO_DB, elog, AllocateDesc::file, FreeDesc(), i, AllocateDesc::kind, LOG, numAllocatedDescs, and WARNING.
Referenced by ClosePipeFromProgram(), ClosePipeToProgram(), pg_import_system_collations(), and run_ssl_passphrase_command().
int CloseTransientFile | ( | int | fd | ) |
Definition at line 2581 of file fd.c.
References AllocateDescRawFD, close, AllocateDesc::desc, DO_DB, elog, AllocateDesc::fd, FreeDesc(), i, AllocateDesc::kind, LOG, numAllocatedDescs, and WARNING.
Referenced by ApplyLogicalMappingFile(), be_lo_export(), CheckPointLogicalRewriteHeap(), CheckPointReplicationOrigin(), copy_file(), dsm_impl_mmap(), durable_rename(), fsync_fname_ext(), get_controlfile(), heap_xlog_logical_rewrite(), lo_import_internal(), load_relmap_file(), perform_base_backup(), pg_truncate(), qtext_load_file(), qtext_store(), ReadTwoPhaseFile(), RecreateTwoPhaseFile(), ReorderBufferSerializeChange(), ReorderBufferSerializeTXN(), RestoreSlotFromDisk(), SaveSlotToPath(), sendFile(), SendTimeLineHistory(), SimpleLruDoesPhysicalPageExist(), SimpleLruWriteAll(), SlruInternalWritePage(), SlruPhysicalReadPage(), SlruPhysicalWritePage(), SlruSyncFileTag(), SnapBuildRestore(), SnapBuildSerialize(), StartupReplicationOrigin(), walkdir(), write_relmap_file(), writeTimeLineHistory(), writeTimeLineHistoryFile(), and XLogFileCopy().
|
static |
int data_sync_elevel | ( | int | elevel | ) |
Definition at line 3635 of file fd.c.
References data_sync_retry, elevel, and PANIC.
Referenced by CheckPointLogicalRewriteHeap(), FileClose(), fsync_fname(), heap_xlog_logical_rewrite(), logical_end_heap_rewrite(), LruDelete(), mdimmedsync(), pg_flush_data(), ProcessSyncRequests(), register_dirty_segment(), SlruReportIOError(), write_relmap_file(), writeTimeLineHistory(), writeTimeLineHistoryFile(), and XLogFileCopy().
|
static |
Definition at line 3461 of file fd.c.
References fsync_fname_ext().
Referenced by SyncDataDirectory().
|
static |
Definition at line 1158 of file fd.c.
References Assert, DO_DB, elog, vfd::fileName, LOG, vfd::lruLessRecently, and vfd::lruMoreRecently.
Referenced by FileAccess(), FileClose(), and LruDelete().
int durable_rename | ( | const char * | oldfile, |
const char * | newfile, | ||
int | elevel | ||
) |
Definition at line 687 of file fd.c.
References CloseTransientFile(), ereport, errcode_for_file_access(), errmsg(), vfd::fd, fsync_fname_ext(), fsync_parent_path(), OpenTransientFile(), PG_BINARY, and pg_fsync().
Referenced by AlterSystemSetConfigFile(), apw_dump_now(), BaseBackup(), CancelBackup(), CheckPointReplicationOrigin(), dir_close(), KeepFileRestoredFromArchive(), pgarch_archiveDone(), pgss_shmem_shutdown(), StartupXLOG(), and XLogArchiveForceDone().
int durable_rename_excl | ( | const char * | oldfile, |
const char * | newfile, | ||
int | elevel | ||
) |
Definition at line 814 of file fd.c.
References ereport, errcode_for_file_access(), errmsg(), fsync_fname_ext(), fsync_parent_path(), and link().
Referenced by InstallXLogFileSegment(), writeTimeLineHistory(), and writeTimeLineHistoryFile().
int durable_unlink | ( | const char * | fname, |
int | elevel | ||
) |
Definition at line 777 of file fd.c.
References ereport, errcode_for_file_access(), errmsg(), and fsync_parent_path().
Referenced by do_pg_stop_backup(), exitArchiveRecovery(), InstallXLogFileSegment(), and RemoveXlogFile().
|
static |
Definition at line 1382 of file fd.c.
References Delete(), DO_DB, elog, FileIsNotOpen, vfd::fileName, Insert(), LOG, LruInsert(), and vfd::lruLessRecently.
Referenced by FilePrefetch(), FileRead(), FileSize(), FileSync(), FileTruncate(), FileWrite(), and FileWriteback().
void FileClose | ( | File | file | ) |
Definition at line 1854 of file fd.c.
References Assert, close, data_sync_elevel(), Delete(), DO_DB, elog, ereport, errcode_for_file_access(), errmsg(), vfd::fd, FD_DELETE_AT_CLOSE, FD_TEMP_FILE_LIMIT, vfd::fdstate, FileIsNotOpen, FileIsValid, vfd::fileName, vfd::fileSize, FreeVfd(), LOG, nfile, ReportTemporaryFileUsage(), ResourceOwnerForgetFile(), vfd::resowner, stat::st_size, stat, temporary_files_size, and VFD_CLOSED.
Referenced by BufFileClose(), BufFileTruncateShared(), CleanupTempFiles(), logical_end_heap_rewrite(), mdclose(), mdimmedsync(), mdsyncfiletag(), mdtruncate(), ReorderBufferIterTXNFinish(), ReorderBufferRestoreChanges(), and ResourceOwnerReleaseInternal().
int FileGetRawDesc | ( | File | file | ) |
Definition at line 2248 of file fd.c.
References Assert, vfd::fd, and FileIsValid.
int FileGetRawFlags | ( | File | file | ) |
mode_t FileGetRawMode | ( | File | file | ) |
char* FilePathName | ( | File | file | ) |
Definition at line 2232 of file fd.c.
References Assert, FileIsValid, and vfd::fileName.
Referenced by _mdnblocks(), BufFileDumpBuffer(), BufFileLoadBuffer(), BufFileSeek(), BufFileSize(), BufFileTruncateShared(), mdextend(), mdimmedsync(), mdread(), mdsyncfiletag(), mdtruncate(), mdwrite(), and register_dirty_segment().
Definition at line 1954 of file fd.c.
References Assert, DO_DB, elog, vfd::fd, FileAccess(), FileIsValid, vfd::fileName, INT64_FORMAT, LOG, pgstat_report_wait_end(), and pgstat_report_wait_start().
Referenced by mdprefetch().
Definition at line 2005 of file fd.c.
References _dosmaperr(), Assert, DO_DB, EINTR, elog, error(), vfd::fd, FileAccess(), FileIsValid, vfd::fileName, INT64_FORMAT, LOG, pg_pread(), pg_usleep(), pgstat_report_wait_end(), and pgstat_report_wait_start().
Referenced by BufFileLoadBuffer(), mdread(), and ReorderBufferRestoreChanges().
off_t FileSize | ( | File | file | ) |
Definition at line 2180 of file fd.c.
References Assert, DO_DB, elog, vfd::fd, FileAccess(), FileIsNotOpen, FileIsValid, vfd::fileName, and LOG.
Referenced by _mdnblocks(), BufFileSeek(), and BufFileSize().
Definition at line 2159 of file fd.c.
References Assert, DO_DB, elog, vfd::fd, FileAccess(), FileIsValid, vfd::fileName, LOG, pg_fsync(), pgstat_report_wait_end(), and pgstat_report_wait_start().
Referenced by logical_end_heap_rewrite(), mdimmedsync(), mdsyncfiletag(), and register_dirty_segment().
Definition at line 2197 of file fd.c.
References Assert, DO_DB, elog, vfd::fd, FD_TEMP_FILE_LIMIT, vfd::fdstate, FileAccess(), FileIsValid, vfd::fileName, vfd::fileSize, ftruncate, LOG, pgstat_report_wait_end(), pgstat_report_wait_start(), and temporary_files_size.
Referenced by BufFileTruncateShared(), and mdtruncate().
Definition at line 2061 of file fd.c.
References _dosmaperr(), Assert, DO_DB, EINTR, elog, ereport, errcode(), errmsg(), ERROR, error(), vfd::fd, FD_TEMP_FILE_LIMIT, vfd::fdstate, FileAccess(), FileIsValid, vfd::fileName, vfd::fileSize, INT64_FORMAT, LOG, pg_pwrite(), pg_usleep(), pgstat_report_wait_end(), pgstat_report_wait_start(), temp_file_limit, and temporary_files_size.
Referenced by BufFileDumpBuffer(), logical_heap_rewrite_flush_mappings(), mdextend(), and mdwrite().
Definition at line 1982 of file fd.c.
References Assert, DO_DB, elog, vfd::fd, FileAccess(), FileIsValid, vfd::fileName, INT64_FORMAT, LOG, pg_flush_data(), pgstat_report_wait_end(), and pgstat_report_wait_start().
Referenced by mdwriteback().
|
static |
Definition at line 2514 of file fd.c.
References AllocateDescDir, AllocateDescFile, AllocateDescPipe, AllocateDescRawFD, close, closedir(), AllocateDesc::desc, AllocateDesc::dir, elog, ERROR, AllocateDesc::fd, AllocateDesc::file, AllocateDesc::kind, and numAllocatedDescs.
Referenced by AtEOSubXact_Files(), CleanupTempFiles(), ClosePipeStream(), CloseTransientFile(), FreeDir(), and FreeFile().
int FreeDir | ( | DIR * | dir | ) |
Definition at line 2733 of file fd.c.
References AllocateDescDir, closedir(), AllocateDesc::desc, AllocateDesc::dir, DO_DB, elog, FreeDesc(), i, AllocateDesc::kind, LOG, numAllocatedDescs, and WARNING.
Referenced by calculate_database_size(), calculate_tablespace_size(), CheckPointLogicalRewriteHeap(), CheckPointSnapBuild(), CleanupBackupHistory(), copydir(), db_dir_size(), DeleteAllExportedSnapshotFiles(), destroy_tablespace_directories(), directory_is_empty(), do_pg_start_backup(), dsm_cleanup_for_mmap(), extension_file_exists(), get_ext_ver_list(), getInstallationPaths(), movedb(), ParseTzFile(), perform_base_backup(), pg_available_extension_versions(), pg_available_extensions(), pg_logdir_ls_internal(), pg_ls_dir(), pg_ls_dir_files(), pg_tablespace_databases(), pg_tzenumerate_end(), pg_tzenumerate_next(), pgarch_readyXlog(), pgstat_reset_remove_files(), RelationCacheInitFileRemove(), RelationCacheInitFileRemoveInDir(), RemoveNonParentXlogFiles(), RemoveOldXlogFiles(), RemovePgTempFiles(), RemovePgTempFilesInDir(), RemovePgTempRelationFiles(), RemovePgTempRelationFilesInDbspace(), RemoveTempXlogFiles(), ReorderBufferCleanupSerializedTXNs(), ResetUnloggedRelations(), ResetUnloggedRelationsInDbspaceDir(), ResetUnloggedRelationsInTablespaceDir(), restoreTwoPhaseData(), scan_directory_ci(), sendDir(), SlruScanDirectory(), StartupReorderBuffer(), StartupReplicationSlots(), UpdateLogicalMappings(), and walkdir().
int FreeFile | ( | FILE * | file | ) |
Definition at line 2553 of file fd.c.
References AllocateDescFile, AllocateDesc::desc, DO_DB, elog, AllocateDesc::file, FreeDesc(), i, AllocateDesc::kind, LOG, numAllocatedDescs, and WARNING.
Referenced by _ShowOption(), AlterSystemSetConfigFile(), apw_dump_now(), apw_load_buffers(), BackendRun(), checkControlFile(), do_pg_start_backup(), do_pg_stop_backup(), EndCopy(), EndCopyFrom(), entry_reset(), existsTimeLineHistory(), ExportSnapshot(), fill_hba_view(), gc_qtexts(), ImportSnapshot(), load_dh_file(), load_hba(), load_ident(), load_relcache_init_file(), parse_extension_control_file(), ParseTzFile(), pg_backup_start_time(), pg_current_logfile(), pg_file_write_internal(), pg_promote(), PGSharedMemoryAttach(), pgss_shmem_shutdown(), pgss_shmem_startup(), pgstat_read_db_statsfile(), pgstat_read_db_statsfile_timestamp(), pgstat_read_statsfiles(), pgstat_write_db_statsfile(), pgstat_write_statsfiles(), PostmasterMarkPIDForWorkerNotify(), read_backup_label(), read_binary_file(), read_tablespace_map(), read_whole_file(), readTimeLineHistory(), tokenize_inc_file(), tsearch_readline_end(), ValidatePgVersion(), write_relcache_init_file(), XLogArchiveForceDone(), and XLogArchiveNotify().
|
static |
Definition at line 1362 of file fd.c.
References DO_DB, elog, vfd::fdstate, vfd::fileName, free, LOG, and vfd::nextFree.
Referenced by FileClose(), and PathNameOpenFilePerm().
void fsync_fname | ( | const char * | fname, |
bool | isdir | ||
) |
Definition at line 661 of file fd.c.
References data_sync_elevel(), ERROR, and fsync_fname_ext().
Referenced by _CloseArchive(), CheckPointTwoPhase(), copydir(), CreateSlotOnDisk(), dir_close(), dir_finish(), dir_open_for_write(), main(), ReplicationSlotDropPtr(), ResetUnloggedRelationsInDbspaceDir(), RestoreSlotFromDisk(), SaveSlotToPath(), SimpleLruWriteAll(), SnapBuildRestore(), SnapBuildSerialize(), StartupReplicationSlots(), and tar_finish().
Definition at line 3496 of file fd.c.
References CloseTransientFile(), ereport, errcode_for_file_access(), errmsg(), vfd::fd, OpenTransientFile(), PG_BINARY, and pg_fsync().
Referenced by datadir_fsync_fname(), durable_rename(), durable_rename_excl(), fsync_fname(), fsync_parent_path(), and pg_file_sync().
|
static |
Definition at line 3572 of file fd.c.
References fsync_fname_ext(), get_parent_directory(), MAXPGPATH, and strlcpy().
Referenced by dir_close(), dir_open_for_write(), durable_rename(), durable_rename_excl(), durable_unlink(), and tar_finish().
Oid GetNextTempTableSpace | ( | void | ) |
Definition at line 2882 of file fd.c.
References InvalidOid, nextTempTableSpace, numTempTableSpaces, and tempTableSpaces.
Referenced by GetDefaultTablespace(), and OpenTemporaryFile().
int GetTempTablespaces | ( | Oid * | tableSpaces, |
int | numSpaces | ||
) |
Definition at line 2864 of file fd.c.
References Assert, i, numTempTableSpaces, tempTableSpaces, and TempTablespacesAreSet().
Referenced by SharedFileSetInit().
void InitFileAccess | ( | void | ) |
Definition at line 854 of file fd.c.
References Assert, AtProcExit_Files(), ereport, errcode(), errmsg(), FATAL, vfd::fd, malloc, MemSet, on_proc_exit(), SizeVfdCache, and VFD_CLOSED.
Referenced by BaseInit().
|
static |
Definition at line 1203 of file fd.c.
References Assert, DO_DB, elog, vfd::fileName, LOG, vfd::lruLessRecently, and vfd::lruMoreRecently.
Referenced by AdvanceXLInsertBuffer(), CreateCheckPoint(), FileAccess(), GetXLogInsertRecPtr(), InitXLOGAccess(), LruInsert(), PathNameOpenFilePerm(), ReserveXLogInsertLocation(), ReserveXLogSwitch(), StartupXLOG(), UpdateFullPageWrites(), WaitXLogInsertionsToFinish(), and XLogInsertRecord().
bool looks_like_temp_rel_name | ( | const char * | name | ) |
Definition at line 3219 of file fd.c.
References forkname_chars().
Referenced by RemovePgTempRelationFilesInDbspace(), and sendDir().
|
static |
Definition at line 1177 of file fd.c.
References Assert, close, data_sync_elevel(), Delete(), DO_DB, elog, vfd::fd, FD_TEMP_FILE_LIMIT, vfd::fdstate, vfd::fileName, LOG, nfile, and VFD_CLOSED.
Referenced by closeAllVfds(), RegisterTemporaryFile(), and ReleaseLruFile().
|
static |
Definition at line 1225 of file fd.c.
References Assert, BasicOpenFilePerm(), DO_DB, elog, vfd::fd, vfd::fileFlags, FileIsNotOpen, vfd::fileMode, vfd::fileName, Insert(), LOG, nfile, and ReleaseLruFiles().
Referenced by FileAccess().
int MakePGDirectory | ( | const char * | directoryName | ) |
Definition at line 3612 of file fd.c.
References mkdir, and pg_dir_create_mode.
Referenced by BackendRun(), copydir(), create_tablespace_directories(), CreateSlotOnDisk(), OpenTemporaryFileInTablespace(), PathNameCreateTemporaryDir(), SysLogger_Start(), SysLoggerMain(), TablespaceCreateDbspace(), and ValidateXLOGDirectoryStructure().
FILE* OpenPipeStream | ( | const char * | command, |
const char * | mode | ||
) |
Definition at line 2457 of file fd.c.
References AllocateDescPipe, AllocateDesc::create_subid, AllocateDesc::desc, DO_DB, elog, ereport, errcode(), errmsg(), ERROR, AllocateDesc::file, GetCurrentSubTransactionId(), AllocateDesc::kind, LOG, maxAllocatedDescs, numAllocatedDescs, pqsignal(), ReleaseLruFile(), ReleaseLruFiles(), reserveAllocatedDesc(), SIG_DFL, SIG_IGN, SIGPIPE, and generate_unaccent_rules::stdout.
Referenced by BeginCopyFrom(), BeginCopyTo(), pg_import_system_collations(), and run_ssl_passphrase_command().
Definition at line 1606 of file fd.c.
References CurrentResourceOwner, FD_DELETE_AT_CLOSE, FD_TEMP_FILE_LIMIT, vfd::fdstate, GetNextTempTableSpace(), MyDatabaseTableSpace, numTempTableSpaces, OidIsValid, OpenTemporaryFileInTablespace(), RegisterTemporaryFile(), and ResourceOwnerEnlargeFiles().
Referenced by BufFileCreateTemp(), and extendBufFile().
Definition at line 1684 of file fd.c.
References elog, ERROR, MakePGDirectory(), MAXPGPATH, MyProcPid, PathNameOpenFile(), PG_BINARY, PG_TEMP_FILE_PREFIX, snprintf, tempFileCounter, and TempTablespacePath().
Referenced by OpenTemporaryFile().
int OpenTransientFile | ( | const char * | fileName, |
int | fileFlags | ||
) |
Definition at line 2404 of file fd.c.
References OpenTransientFilePerm(), and pg_file_create_mode.
Referenced by ApplyLogicalMappingFile(), CheckPointLogicalRewriteHeap(), CheckPointReplicationOrigin(), copy_file(), dsm_impl_mmap(), durable_rename(), fsync_fname_ext(), get_controlfile(), heap_xlog_logical_rewrite(), lo_import_internal(), load_relmap_file(), perform_base_backup(), pg_truncate(), qtext_load_file(), qtext_store(), ReadTwoPhaseFile(), RecreateTwoPhaseFile(), ReorderBufferSerializeTXN(), RestoreSlotFromDisk(), SaveSlotToPath(), sendFile(), SendTimeLineHistory(), SimpleLruDoesPhysicalPageExist(), SlruPhysicalReadPage(), SlruPhysicalWritePage(), SlruSyncFileTag(), SnapBuildRestore(), SnapBuildSerialize(), StartupReplicationOrigin(), walkdir(), write_relmap_file(), writeTimeLineHistory(), writeTimeLineHistoryFile(), and XLogFileCopy().
int OpenTransientFilePerm | ( | const char * | fileName, |
int | fileFlags, | ||
mode_t | fileMode | ||
) |
Definition at line 2413 of file fd.c.
References AllocateDescRawFD, BasicOpenFilePerm(), AllocateDesc::create_subid, AllocateDesc::desc, DO_DB, elog, ereport, errcode(), errmsg(), ERROR, vfd::fd, AllocateDesc::fd, GetCurrentSubTransactionId(), AllocateDesc::kind, LOG, maxAllocatedDescs, numAllocatedDescs, ReleaseLruFiles(), and reserveAllocatedDesc().
Referenced by be_lo_export(), and OpenTransientFile().
void PathNameCreateTemporaryDir | ( | const char * | basedir, |
const char * | directory | ||
) |
Definition at line 1542 of file fd.c.
References ereport, errcode_for_file_access(), errmsg(), ERROR, and MakePGDirectory().
Referenced by SharedFileSetCreate().
Definition at line 1741 of file fd.c.
References CurrentResourceOwner, ereport, errcode_for_file_access(), errmsg(), ERROR, FD_TEMP_FILE_LIMIT, vfd::fdstate, PathNameOpenFile(), PG_BINARY, RegisterTemporaryFile(), and ResourceOwnerEnlargeFiles().
Referenced by SharedFileSetCreate().
void PathNameDeleteTemporaryDir | ( | const char * | dirname | ) |
Definition at line 1573 of file fd.c.
References LOG, stat, unlink_if_exists_fname(), and walkdir().
Referenced by SharedFileSetDeleteAll().
Definition at line 1808 of file fd.c.
References ereport, errcode_for_file_access(), errmsg(), ERROR, LOG, ReportTemporaryFileUsage(), stat::st_size, and stat.
Referenced by SharedFileSetDelete(), and unlink_if_exists_fname().
File PathNameOpenFile | ( | const char * | fileName, |
int | fileFlags | ||
) |
Definition at line 1465 of file fd.c.
References PathNameOpenFilePerm(), and pg_file_create_mode.
Referenced by _mdfd_openseg(), logical_rewrite_log_mapping(), mdcreate(), mdopenfork(), mdsyncfiletag(), OpenTemporaryFileInTablespace(), PathNameCreateTemporaryFile(), PathNameOpenTemporaryFile(), and ReorderBufferRestoreChanges().
File PathNameOpenFilePerm | ( | const char * | fileName, |
int | fileFlags, | ||
mode_t | fileMode | ||
) |
Definition at line 1478 of file fd.c.
References AllocateVfd(), BasicOpenFilePerm(), DO_DB, elog, ereport, errcode(), errmsg(), ERROR, vfd::fd, vfd::fdstate, vfd::fileFlags, vfd::fileMode, vfd::fileName, vfd::fileSize, free, FreeVfd(), Insert(), LOG, nfile, ReleaseLruFiles(), and vfd::resowner.
Referenced by PathNameOpenFile().
File PathNameOpenTemporaryFile | ( | const char * | path, |
int | mode | ||
) |
Definition at line 1779 of file fd.c.
References CurrentResourceOwner, ereport, errcode_for_file_access(), errmsg(), ERROR, PathNameOpenFile(), PG_BINARY, RegisterTemporaryFile(), and ResourceOwnerEnlargeFiles().
Referenced by SharedFileSetOpen().
int pg_fdatasync | ( | int | fd | ) |
Definition at line 437 of file fd.c.
References enableFsync, and fsync.
Referenced by issue_xlog_fsync().
void pg_flush_data | ( | int | fd, |
off_t | offset, | ||
off_t | nbytes | ||
) |
Definition at line 457 of file fd.c.
References data_sync_elevel(), elevel, enableFsync, ereport, errcode_for_file_access(), errmsg(), FATAL, MAP_FAILED, and WARNING.
Referenced by copy_file(), FileWriteback(), and walkdir().
int pg_fsync | ( | int | fd | ) |
Definition at line 347 of file fd.c.
References Assert, fstat, pg_fsync_no_writethrough(), pg_fsync_writethrough(), S_ISDIR, stat::st_mode, sync_method, and SYNC_METHOD_FSYNC_WRITETHROUGH.
Referenced by AddToDataDirLockFile(), assign_xlog_sync_method(), BootStrapXLOG(), CheckPointLogicalRewriteHeap(), CreateLockFile(), do_pg_start_backup(), durable_rename(), FileSync(), fsync_fname_ext(), heap_xlog_logical_rewrite(), readRecoverySignalFile(), RecreateTwoPhaseFile(), RestoreSlotFromDisk(), SaveSlotToPath(), SlruPhysicalWritePage(), SlruSyncFileTag(), SnapBuildSerialize(), update_controlfile(), write_auto_conf_file(), write_relmap_file(), WriteControlFile(), writeTimeLineHistory(), writeTimeLineHistoryFile(), XLogFileCopy(), and XLogFileInit().
int pg_fsync_no_writethrough | ( | int | fd | ) |
Definition at line 402 of file fd.c.
References enableFsync, and fsync.
Referenced by issue_xlog_fsync(), and pg_fsync().
int pg_fsync_writethrough | ( | int | fd | ) |
Definition at line 414 of file fd.c.
References enableFsync.
Referenced by issue_xlog_fsync(), pg_fsync(), signal_cleanup(), and test_sync().
ssize_t pg_pwritev_with_retry | ( | int | fd, |
const struct iovec * | iov, | ||
int | iovcnt, | ||
off_t | offset | ||
) |
Definition at line 3645 of file fd.c.
References Assert, iovec::iov_base, iovec::iov_len, Min, and pg_pwritev().
Referenced by XLogFileInit().
int pg_truncate | ( | const char * | path, |
off_t | length | ||
) |
Definition at line 630 of file fd.c.
References CloseTransientFile(), vfd::fd, ftruncate, OpenTransientFile(), and PG_BINARY.
Referenced by do_truncate().
Definition at line 2681 of file fd.c.
References ERROR, and ReadDirExtended().
Referenced by calculate_database_size(), calculate_tablespace_size(), CheckPointLogicalRewriteHeap(), CheckPointSnapBuild(), CleanupBackupHistory(), copydir(), db_dir_size(), destroy_tablespace_directories(), directory_is_empty(), do_pg_start_backup(), dsm_cleanup_for_mmap(), extension_file_exists(), get_ext_ver_list(), movedb(), perform_base_backup(), pg_available_extension_versions(), pg_available_extensions(), pg_logdir_ls_internal(), pg_ls_dir(), pg_ls_dir_files(), pg_tablespace_databases(), pg_tzenumerate_next(), pgarch_readyXlog(), pgstat_reset_remove_files(), RemoveNonParentXlogFiles(), RemoveOldXlogFiles(), RemoveTempXlogFiles(), ResetUnloggedRelations(), ResetUnloggedRelationsInDbspaceDir(), ResetUnloggedRelationsInTablespaceDir(), restoreTwoPhaseData(), sendDir(), SlruScanDirectory(), StartupReorderBuffer(), StartupReplicationSlots(), and UpdateLogicalMappings().
Definition at line 2696 of file fd.c.
References ereport, errcode_for_file_access(), errmsg(), and readdir().
Referenced by DeleteAllExportedSnapshotFiles(), ReadDir(), RelationCacheInitFileRemove(), RelationCacheInitFileRemoveInDir(), RemovePgTempFiles(), RemovePgTempFilesInDir(), RemovePgTempRelationFiles(), RemovePgTempRelationFilesInDbspace(), ReorderBufferCleanupSerializedTXNs(), scan_directory_ci(), and walkdir().
|
static |
Definition at line 1437 of file fd.c.
References Assert, CurrentResourceOwner, FD_CLOSE_AT_EOXACT, vfd::fdstate, FileIsNotOpen, FileIsValid, have_xact_temporary_files, LruDelete(), ResourceOwnerRememberFile(), and vfd::resowner.
Referenced by OpenTemporaryFile(), PathNameCreateTemporaryFile(), and PathNameOpenTemporaryFile().
void ReleaseExternalFD | ( | void | ) |
Definition at line 1129 of file fd.c.
References Assert, buf, elog, LOG, vfd::lruLessRecently, numExternalFDs, and snprintf.
Referenced by ClosePostmasterPorts(), connect_pg_server(), createNewConnection(), CreateWaitEventSet(), dblink_connect(), dblink_disconnect(), dblink_exec(), dblink_get_conn(), dblink_record_internal(), dblink_security_check(), disconnect_pg_server(), dsm_impl_op(), FreeWaitEventSet(), InitializeLatchSupport(), and XLogFileClose().
|
static |
Definition at line 1272 of file fd.c.
References Assert, DO_DB, elog, LOG, LruDelete(), vfd::lruMoreRecently, and nfile.
Referenced by AllocateDir(), AllocateFile(), BasicOpenFilePerm(), OpenPipeStream(), and ReleaseLruFiles().
|
static |
Definition at line 1294 of file fd.c.
References max_safe_fds, nfile, numAllocatedDescs, numExternalFDs, and ReleaseLruFile().
Referenced by AllocateDir(), AllocateFile(), LruInsert(), OpenPipeStream(), OpenTransientFilePerm(), PathNameOpenFilePerm(), and ReserveExternalFD().
void RemovePgTempFiles | ( | void | ) |
Definition at line 3038 of file fd.c.
References AllocateDir(), dirent::d_name, FreeDir(), LOG, MAXPGPATH, PG_TEMP_FILES_DIR, ReadDirExtended(), RemovePgTempFilesInDir(), RemovePgTempRelationFiles(), snprintf, and TABLESPACE_VERSION_DIRECTORY.
Referenced by PostmasterMain().
Definition at line 3097 of file fd.c.
References AllocateDir(), dirent::d_name, ereport, errcode_for_file_access(), errmsg(), FreeDir(), LOG, lstat, MAXPGPATH, PG_TEMP_FILE_PREFIX, ReadDirExtended(), RemovePgTempFilesInDir(), S_ISDIR, snprintf, and stat::st_mode.
Referenced by PostmasterMain(), RemovePgTempFiles(), and RemovePgTempFilesInDir().
|
static |
Definition at line 3163 of file fd.c.
References AllocateDir(), dirent::d_name, FreeDir(), LOG, MAXPGPATH, ReadDirExtended(), RemovePgTempRelationFilesInDbspace(), and snprintf.
Referenced by RemovePgTempFiles().
|
static |
Definition at line 3191 of file fd.c.
References AllocateDir(), dirent::d_name, ereport, errcode_for_file_access(), errmsg(), FreeDir(), LOG, looks_like_temp_rel_name(), MAXPGPATH, ReadDirExtended(), and snprintf.
Referenced by RemovePgTempRelationFiles().
|
static |
Definition at line 1418 of file fd.c.
References ereport, errmsg(), LOG, log_temp_files, and pgstat_report_tempfile().
Referenced by FileClose(), and PathNameDeleteTemporaryFile().
|
static |
Definition at line 2279 of file fd.c.
References ereport, errcode(), errmsg(), ERROR, FD_MINFREE, malloc, max_safe_fds, maxAllocatedDescs, numAllocatedDescs, and realloc.
Referenced by AllocateDir(), AllocateFile(), OpenPipeStream(), and OpenTransientFilePerm().
void ReserveExternalFD | ( | void | ) |
Definition at line 1111 of file fd.c.
References numExternalFDs, and ReleaseLruFiles().
Referenced by AcquireExternalFD(), BackendInitialize(), dsm_impl_op(), InitializeLatchSupport(), InitPostmasterDeathWatchHandle(), pgstat_init(), PostmasterMarkPIDForWorkerNotify(), and XLogWrite().
void set_max_safe_fds | ( | void | ) |
Definition at line 971 of file fd.c.
References count_usable_fds(), DEBUG2, elog, ereport, errcode(), errdetail(), errmsg(), FATAL, FD_MINFREE, max_files_per_process, max_safe_fds, Min, and NUM_RESERVED_FDS.
Referenced by PostmasterMain().
void SetTempTablespaces | ( | Oid * | tableSpaces, |
int | numSpaces | ||
) |
Definition at line 2821 of file fd.c.
References Assert, nextTempTableSpace, numTempTableSpaces, random(), and tempTableSpaces.
Referenced by assign_temp_tablespaces(), and PrepareTempTablespaces().
void SyncDataDirectory | ( | void | ) |
Definition at line 3289 of file fd.c.
References datadir_fsync_fname(), DEBUG1, enableFsync, ereport, errcode_for_file_access(), errmsg(), LOG, lstat, pgwin32_is_junction(), stat::st_mode, and walkdir().
Referenced by StartupXLOG().
void TempTablespacePath | ( | char * | path, |
Oid | tablespace | ||
) |
Definition at line 1659 of file fd.c.
References InvalidOid, MAXPGPATH, PG_TEMP_FILES_DIR, snprintf, and TABLESPACE_VERSION_DIRECTORY.
Referenced by OpenTemporaryFileInTablespace(), pg_ls_tmpdir(), SharedFileSetCreate(), and SharedFileSetPath().
bool TempTablespacesAreSet | ( | void | ) |
Definition at line 2849 of file fd.c.
References numTempTableSpaces.
Referenced by GetTempTablespaces(), and PrepareTempTablespaces().
|
static |
Definition at line 3471 of file fd.c.
References ereport, errcode_for_file_access(), errmsg(), and PathNameDeleteTemporaryFile().
Referenced by PathNameDeleteTemporaryDir().
|
static |
Definition at line 3363 of file fd.c.
References generate_unaccent_rules::action, AllocateDir(), CHECK_FOR_INTERRUPTS, CloseTransientFile(), dirent::d_name, elevel, ereport, errcode_for_file_access(), errmsg(), vfd::fd, FreeDir(), get_dirent_type(), MAXPGPATH, OpenTransientFile(), PG_BINARY, pg_flush_data(), PGFILETYPE_DIR, PGFILETYPE_REG, ReadDirExtended(), snprintf, and subpath().
Referenced by PathNameDeleteTemporaryDir(), and SyncDataDirectory().
|
static |
Definition at line 159 of file fd.c.
Referenced by data_sync_elevel().
Definition at line 219 of file fd.c.
Referenced by CleanupTempFiles(), and RegisterTemporaryFile().
int max_files_per_process = 1000 |
Definition at line 143 of file fd.c.
Referenced by set_max_safe_fds().
int max_safe_fds = FD_MINFREE |
Definition at line 156 of file fd.c.
Referenced by AcquireExternalFD(), PostmasterMarkPIDForWorkerNotify(), ReleaseLruFiles(), reserveAllocatedDesc(), and set_max_safe_fds().
|
static |
Definition at line 254 of file fd.c.
Referenced by AllocateDir(), AllocateFile(), OpenPipeStream(), OpenTransientFilePerm(), and reserveAllocatedDesc().
|
static |
Definition at line 276 of file fd.c.
Referenced by GetNextTempTableSpace(), and SetTempTablespaces().
|
static |
Definition at line 213 of file fd.c.
Referenced by FileClose(), LruDelete(), LruInsert(), PathNameOpenFilePerm(), ReleaseLruFile(), and ReleaseLruFiles().
|
static |
Definition at line 253 of file fd.c.
Referenced by AllocateDir(), AllocateFile(), AtEOSubXact_Files(), CleanupTempFiles(), ClosePipeStream(), CloseTransientFile(), FreeDesc(), FreeDir(), FreeFile(), OpenPipeStream(), OpenTransientFilePerm(), ReleaseLruFiles(), and reserveAllocatedDesc().
|
static |
Definition at line 260 of file fd.c.
Referenced by AcquireExternalFD(), ReleaseExternalFD(), ReleaseLruFiles(), and ReserveExternalFD().
|
static |
Definition at line 275 of file fd.c.
Referenced by AtEOXact_Files(), GetNextTempTableSpace(), GetTempTablespaces(), OpenTemporaryFile(), SetTempTablespaces(), and TempTablespacesAreSet().
|
static |
Definition at line 208 of file fd.c.
Referenced by AllocateVfd(), CleanupTempFiles(), closeAllVfds(), and InitFileAccess().
|
static |
Definition at line 266 of file fd.c.
Referenced by OpenTemporaryFileInTablespace().
|
static |
Definition at line 227 of file fd.c.
Referenced by FileClose(), FileTruncate(), and FileWrite().
|
static |
Definition at line 274 of file fd.c.
Referenced by AtEOXact_Files(), GetNextTempTableSpace(), GetTempTablespaces(), and SetTempTablespaces().