@@ -126,7 +126,7 @@ static void dir_list_file_internal(parray *files, const char *root,
126
126
bool omit_symlink ,parray * black_list ,fio_location location );
127
127
128
128
static void list_data_directories (parray * files ,const char * path ,bool is_root ,
129
- bool exclude );
129
+ bool exclude , fio_location location );
130
130
131
131
/* Tablespace mapping */
132
132
static TablespaceList tablespace_dirs = {NULL ,NULL };
@@ -773,15 +773,15 @@ dir_list_file_internal(parray *files, const char *root, pgFile *parent,
773
773
*/
774
774
static void
775
775
list_data_directories (parray * files ,const char * path ,bool is_root ,
776
- bool exclude )
776
+ bool exclude , fio_location location )
777
777
{
778
778
DIR * dir ;
779
779
struct dirent * dent ;
780
780
int prev_errno ;
781
781
bool has_child_dirs = false;
782
782
783
783
/* open directory and list contents */
784
- dir = fio_opendir (path ,FIO_DB_HOST );
784
+ dir = fio_opendir (path ,location );
785
785
if (dir == NULL )
786
786
elog (ERROR ,"cannot open directory \"%s\": %s" ,path ,strerror (errno ));
787
787
@@ -799,7 +799,7 @@ list_data_directories(parray *files, const char *path, bool is_root,
799
799
800
800
join_path_components (child ,path ,dent -> d_name );
801
801
802
- if (fio_stat (child ,& st , false,FIO_DB_HOST )== -1 )
802
+ if (fio_stat (child ,& st , false,location )== -1 )
803
803
elog (ERROR ,"cannot stat file \"%s\": %s" ,child ,strerror (errno ));
804
804
805
805
if (!S_ISDIR (st .st_mode ))
@@ -823,15 +823,15 @@ list_data_directories(parray *files, const char *path, bool is_root,
823
823
continue ;
824
824
825
825
has_child_dirs = true;
826
- list_data_directories (files ,child , false,exclude );
826
+ list_data_directories (files ,child , false,exclude , location );
827
827
}
828
828
829
829
/* List only full and last directories */
830
830
if (!is_root && !has_child_dirs )
831
831
{
832
832
pgFile * dir ;
833
833
834
- dir = pgFileNew (path , false,FIO_LOCAL_HOST );
834
+ dir = pgFileNew (path , false,location );
835
835
parray_append (files ,dir );
836
836
}
837
837
@@ -982,7 +982,8 @@ create_data_directories(const char *data_dir, const char *backup_dir,
982
982
}
983
983
984
984
join_path_components (backup_database_dir ,backup_dir ,DATABASE_DIR );
985
- list_data_directories (dirs ,backup_database_dir , true, false);
985
+ list_data_directories (dirs ,backup_database_dir , true, false,
986
+ FIO_BACKUP_HOST );
986
987
987
988
elog (LOG ,"restore directories and symlinks..." );
988
989