@@ -844,15 +844,15 @@ opt_externaldir_map(ConfigOption *opt, const char *arg)
844844 */
845845void
846846create_data_directories (parray * dest_files , const char * data_dir , const char * backup_dir ,
847- bool extract_tablespaces , bool incremental , fio_location location ,
847+ bool extract_tablespaces , bool incremental , pioDrive_i location ,
848848 const char * waldir_path )
849849{
850850 int i ;
851851 parray * links = NULL ;
852852 mode_t pg_tablespace_mode = DIR_PERMISSION ;
853853 char to_path [MAXPGPATH ];
854854
855- if (waldir_path && !dir_is_empty ( waldir_path , location ))
855+ if (waldir_path && !$i ( pioIsDirEmpty , location , waldir_path ))
856856 {
857857 elog (ERROR , "WAL directory location is not empty: \"%s\"" , waldir_path );
858858 }
@@ -932,12 +932,25 @@ create_data_directories(parray *dest_files, const char *data_dir, const char *ba
932932 waldir_path , to_path );
933933
934934 /* create tablespace directory from waldir_path*/
935- fio_mkdir (location , waldir_path , pg_tablespace_mode , false);
935+ {
936+ int rc ;
937+ rc = $i (pioMakeDir , location , .path = waldir_path ,
938+ .mode = pg_tablespace_mode , .strict = false);
939+ if (rc ) {
940+ elog (WARNING , "Can not create wal directory \"%s\": \"%s\"" ,
941+ waldir_path , strerror (errno ));
942+ }
943+ }
936944
937945 /* create link to linked_path */
938- if (fio_symlink (location , waldir_path , to_path , incremental ) < 0 )
939- elog (ERROR , "Could not create symbolic link \"%s\": %s" ,
940- to_path , strerror (errno ));
946+ {
947+ int rc ;
948+ rc = $i (pioSymLink ,location , waldir_path , to_path , incremental );
949+ if (rc < 0 ) {
950+ elog (ERROR , "Could not create symbolic link \"%s\": %s" ,
951+ to_path , strerror (errno ));
952+ }
953+ }
941954
942955 continue ;
943956
@@ -974,12 +987,26 @@ create_data_directories(parray *dest_files, const char *data_dir, const char *ba
974987 linked_path , to_path );
975988
976989 /* create tablespace directory */
977- fio_mkdir (location , linked_path , pg_tablespace_mode , false);
990+ {
991+ int rc ;
992+
993+ rc = $i (pioMakeDir , location , .path = linked_path ,
994+ .mode = pg_tablespace_mode , .strict = false);
995+ if (rc ) {
996+ elog (WARNING , "Can not create tablespace directory \"%s\": \"%s\"" ,
997+ linked_path , strerror (errno ));
998+ }
999+ }
9781000
9791001 /* create link to linked_path */
980- if (fio_symlink (location , linked_path , to_path , incremental ) < 0 )
981- elog (ERROR , "Could not create symbolic link \"%s\": %s" ,
982- to_path , strerror (errno ));
1002+ {
1003+ int rc ;
1004+
1005+ rc = $i (pioSymLink , location , linked_path , to_path , incremental );
1006+ if (rc < 0 )
1007+ elog (ERROR , "Could not create symbolic link \"%s\": %s" ,
1008+ to_path , strerror (errno ));
1009+ }
9831010
9841011 continue ;
9851012 }
@@ -992,7 +1019,14 @@ create_data_directories(parray *dest_files, const char *data_dir, const char *ba
9921019 join_path_components (to_path , data_dir , dir -> rel_path );
9931020
9941021 // TODO check exit code
995- fio_mkdir (location , to_path , dir -> mode , false);
1022+ {
1023+ int rc ;
1024+
1025+ rc = $i (pioMakeDir , location , .path = to_path , .mode = dir -> mode , .strict = false);
1026+ if (rc ) {
1027+ elog (WARNING , "Can not create directory \"%s\": \"%s\"" , to_path , strerror (errno ));
1028+ }
1029+ }
9961030 }
9971031
9981032 if (extract_tablespaces )
0 commit comments