PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <fcntl.h>
#include <unistd.h>
#include "common/file_utils.h"
#include "miscadmin.h"
#include "pgstat.h"
#include "storage/copydir.h"
#include "storage/fd.h"
Go to the source code of this file.
Macros | |
#define | COPY_BUF_SIZE (8 * BLCKSZ) |
#define | FLUSH_DISTANCE (1024 * 1024) |
Functions | |
void | copydir (const char *fromdir, const char *todir, bool recurse) |
void | copy_file (const char *fromfile, const char *tofile) |
#define COPY_BUF_SIZE (8 * BLCKSZ) |
#define FLUSH_DISTANCE (1024 * 1024) |
void copy_file | ( | const char * | fromfile, |
const char * | tofile | ||
) |
Definition at line 117 of file copydir.c.
References CHECK_FOR_INTERRUPTS, CloseTransientFile(), COPY_BUF_SIZE, dstfd, ereport, errcode_for_file_access(), errmsg(), ERROR, FLUSH_DISTANCE, OpenTransientFile(), palloc(), pfree(), PG_BINARY, pg_flush_data(), pgstat_report_wait_end(), pgstat_report_wait_start(), read, and write.
Referenced by basic_archive_file(), copydir(), process_directory_recursively(), reconstruct_from_incremental_file(), and ResetUnloggedRelationsInDbspaceDir().
void copydir | ( | const char * | fromdir, |
const char * | todir, | ||
bool | recurse | ||
) |
Definition at line 37 of file copydir.c.
References AllocateDir(), CHECK_FOR_INTERRUPTS, copy_file(), dirent::d_name, enableFsync, ereport, errcode_for_file_access(), errmsg(), ERROR, FreeDir(), fsync_fname(), get_dirent_type(), MakePGDirectory(), MAXPGPATH, PGFILETYPE_DIR, PGFILETYPE_REG, ReadDir(), and snprintf.
Referenced by CreateDatabaseUsingFileCopy(), dbase_redo(), and movedb().