aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/storage/file/fd.c4
-rw-r--r--src/backend/utils/misc/guc_tables.c7
-rw-r--r--src/include/common/file_utils.h6
-rw-r--r--src/include/storage/fd.h6
-rw-r--r--src/tools/pgindent/typedefs.list1
5 files changed, 13 insertions, 11 deletions
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index b490a76ba7d..3fed475c381 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -162,7 +162,7 @@ int max_safe_fds = FD_MINFREE; /* default if not changed */
bool data_sync_retry = false;
/* How SyncDataDirectory() should do its job. */
-int recovery_init_sync_method = RECOVERY_INIT_SYNC_METHOD_FSYNC;
+int recovery_init_sync_method = DATA_DIR_SYNC_METHOD_FSYNC;
/* Which kinds of files should be opened with PG_O_DIRECT. */
int io_direct_flags;
@@ -3513,7 +3513,7 @@ SyncDataDirectory(void)
}
#ifdef HAVE_SYNCFS
- if (recovery_init_sync_method == RECOVERY_INIT_SYNC_METHOD_SYNCFS)
+ if (recovery_init_sync_method == DATA_DIR_SYNC_METHOD_SYNCFS)
{
DIR *dir;
struct dirent *de;
diff --git a/src/backend/utils/misc/guc_tables.c b/src/backend/utils/misc/guc_tables.c
index 4107d0a7355..bdb26e2b77d 100644
--- a/src/backend/utils/misc/guc_tables.c
+++ b/src/backend/utils/misc/guc_tables.c
@@ -41,6 +41,7 @@
#include "commands/trigger.h"
#include "commands/user.h"
#include "commands/vacuum.h"
+#include "common/file_utils.h"
#include "common/scram-common.h"
#include "jit/jit.h"
#include "libpq/auth.h"
@@ -430,9 +431,9 @@ StaticAssertDecl(lengthof(ssl_protocol_versions_info) == (PG_TLS1_3_VERSION + 2)
"array length mismatch");
static const struct config_enum_entry recovery_init_sync_method_options[] = {
- {"fsync", RECOVERY_INIT_SYNC_METHOD_FSYNC, false},
+ {"fsync", DATA_DIR_SYNC_METHOD_FSYNC, false},
#ifdef HAVE_SYNCFS
- {"syncfs", RECOVERY_INIT_SYNC_METHOD_SYNCFS, false},
+ {"syncfs", DATA_DIR_SYNC_METHOD_SYNCFS, false},
#endif
{NULL, 0, false}
};
@@ -4953,7 +4954,7 @@ struct config_enum ConfigureNamesEnum[] =
gettext_noop("Sets the method for synchronizing the data directory before crash recovery."),
},
&recovery_init_sync_method,
- RECOVERY_INIT_SYNC_METHOD_FSYNC, recovery_init_sync_method_options,
+ DATA_DIR_SYNC_METHOD_FSYNC, recovery_init_sync_method_options,
NULL, NULL, NULL
},
diff --git a/src/include/common/file_utils.h b/src/include/common/file_utils.h
index dd1532bcb06..7da21f15e6e 100644
--- a/src/include/common/file_utils.h
+++ b/src/include/common/file_utils.h
@@ -24,6 +24,12 @@ typedef enum PGFileType
PGFILETYPE_LNK
} PGFileType;
+typedef enum DataDirSyncMethod
+{
+ DATA_DIR_SYNC_METHOD_FSYNC,
+ DATA_DIR_SYNC_METHOD_SYNCFS
+} DataDirSyncMethod;
+
struct iovec; /* avoid including port/pg_iovec.h here */
#ifdef FRONTEND
diff --git a/src/include/storage/fd.h b/src/include/storage/fd.h
index aea30c06226..d9d5d9da5fb 100644
--- a/src/include/storage/fd.h
+++ b/src/include/storage/fd.h
@@ -46,12 +46,6 @@
#include <dirent.h>
#include <fcntl.h>
-typedef enum RecoveryInitSyncMethod
-{
- RECOVERY_INIT_SYNC_METHOD_FSYNC,
- RECOVERY_INIT_SYNC_METHOD_SYNCFS
-} RecoveryInitSyncMethod;
-
typedef int File;
diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list
index 0656c944162..f2af84d7ca2 100644
--- a/src/tools/pgindent/typedefs.list
+++ b/src/tools/pgindent/typedefs.list
@@ -545,6 +545,7 @@ DR_printtup
DR_sqlfunction
DR_transientrel
DWORD
+DataDirSyncMethod
DataDumperPtr
DataPageDeleteStack
DatabaseInfo