53 char *strategy_name = NULL;
54 void (*strategy_implementation) (
const char *,
const char *,
66 pg_fatal(
"could not open file \"%s\": %m", src);
68 pg_fatal(
"could not close file \"%s\": %m", src);
72 copy_method = COPY_METHOD_COPYFILE;
79 strategy_name =
"clone";
87 strategy_name =
"copy_file_range";
91 case COPY_METHOD_COPYFILE:
92 strategy_name =
"CopyFile";
93 strategy_implementation = copy_file_copyfile;
101 pg_log_debug(
"would copy \"%s\" to \"%s\" using strategy %s",
102 src, dst, strategy_name);
110 pg_log_debug(
"copying \"%s\" to \"%s\" using strategy %s",
111 src, dst, strategy_name);
116 pg_log_debug(
"copying \"%s\" to \"%s\" and checksumming with %s",
119 strategy_implementation(src, dst, checksum_ctx);
char * pg_checksum_type_name(pg_checksum_type type)
static void copy_file_blocks(const char *src, const char *dst, pg_checksum_context *checksum_ctx)
static void copy_file_clone(const char *src, const char *dest, pg_checksum_context *checksum_ctx)
static void copy_file_by_range(const char *src, const char *dest, pg_checksum_context *checksum_ctx)
#define pg_log_debug(...)
static int fd(const char *x, int i)