From 81fe66e0f0aa4f958a8707df669f60756c89bb85 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Tue, 5 Nov 2024 15:59:51 -0600 Subject: [PATCH v2 1/8] Export walkdir(). THIS IS A PROOF OF CONCEPT AND IS NOT READY FOR SERIOUS REVIEW. A follow-up commit will use this function to swap catalog files between database directories during pg_upgrade. --- src/common/file_utils.c | 5 +---- src/include/common/file_utils.h | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/file_utils.c b/src/common/file_utils.c index 398fe1c334..3f488bf5ec 100644 --- a/src/common/file_utils.c +++ b/src/common/file_utils.c @@ -48,9 +48,6 @@ #ifdef PG_FLUSH_DATA_WORKS static int pre_sync_fname(const char *fname, bool isdir); #endif -static void walkdir(const char *path, - int (*action) (const char *fname, bool isdir), - bool process_symlinks); #ifdef HAVE_SYNCFS @@ -268,7 +265,7 @@ sync_dir_recurse(const char *dir, DataDirSyncMethod sync_method) * * See also walkdir in fd.c, which is a backend version of this logic. */ -static void +void walkdir(const char *path, int (*action) (const char *fname, bool isdir), bool process_symlinks) diff --git a/src/include/common/file_utils.h b/src/include/common/file_utils.h index e4339fb7b6..5a9519acfe 100644 --- a/src/include/common/file_utils.h +++ b/src/include/common/file_utils.h @@ -39,6 +39,9 @@ extern void sync_pgdata(const char *pg_data, int serverVersion, extern void sync_dir_recurse(const char *dir, DataDirSyncMethod sync_method); extern int durable_rename(const char *oldfile, const char *newfile); extern int fsync_parent_path(const char *fname); +extern void walkdir(const char *path, + int (*action) (const char *fname, bool isdir), + bool process_symlinks); #endif extern PGFileType get_dirent_type(const char *path, -- 2.39.5 (Apple Git-154)