@@ -1505,32 +1505,8 @@ dir_create_dir(const char *dir, mode_t mode, bool strict)
15051505int
15061506fio_mkdir (fio_location location , const char * path , int mode , bool strict )
15071507{
1508- if (fio_is_remote (location ))
1509- {
1510- fio_header hdr = {
1511- .cop = FIO_MKDIR ,
1512- .handle = strict ? 1 : 0 , /* ugly "hack" to pass more params*/
1513- .size = strlen (path ) + 1 ,
1514- .arg = mode ,
1515- };
1516-
1517- IO_CHECK (fio_write_all (fio_stdout , & hdr , sizeof (hdr )), sizeof (hdr ));
1518- IO_CHECK (fio_write_all (fio_stdout , path , hdr .size ), hdr .size );
1519-
1520- IO_CHECK (fio_read_all (fio_stdin , & hdr , sizeof (hdr )), sizeof (hdr ));
1521- Assert (hdr .cop == FIO_MKDIR );
1522-
1523- if (hdr .arg != 0 )
1524- {
1525- errno = hdr .arg ;
1526- return -1 ;
1527- }
1528- return 0 ;
1529- }
1530- else
1531- {
1532- return dir_create_dir (path , mode , strict );
1533- }
1508+ pioDrive_i drive = pioDriveForLocation (location );
1509+ return $i (pioMakeDir , drive , .path = path , .mode = mode , .strict = strict );
15341510}
15351511
15361512static void
@@ -3537,6 +3513,13 @@ pioLocalDrive_pioIsRemote(VSelf)
35373513 return false;
35383514}
35393515
3516+ static int
3517+ pioLocalDrive_pioMakeDir (VSelf , const char * path , mode_t mode , bool strict )
3518+ {
3519+ FOBJ_FUNC_ARP ();
3520+ return dir_create_dir (path , mode , strict );
3521+ }
3522+
35403523static void
35413524pioLocalDrive_pioListDir (VSelf , parray * files , const char * root , bool handle_tablespaces ,
35423525 bool follow_symlink , bool backup_logs , bool skip_hidden ,
@@ -3853,6 +3836,31 @@ pioRemoteDrive_pioIsRemote(VSelf)
38533836 return true;
38543837}
38553838
3839+ static int
3840+ pioRemoteDrive_pioMakeDir (VSelf , const char * path , mode_t mode , bool strict )
3841+ {
3842+ FOBJ_FUNC_ARP ();
3843+ fio_header hdr = {
3844+ .cop = FIO_MKDIR ,
3845+ .handle = strict ? 1 : 0 , /* ugly "hack" to pass more params*/
3846+ .size = strlen (path ) + 1 ,
3847+ .arg = mode ,
3848+ };
3849+
3850+ IO_CHECK (fio_write_all (fio_stdout , & hdr , sizeof (hdr )), sizeof (hdr ));
3851+ IO_CHECK (fio_write_all (fio_stdout , path , hdr .size ), hdr .size );
3852+
3853+ IO_CHECK (fio_read_all (fio_stdin , & hdr , sizeof (hdr )), sizeof (hdr ));
3854+ Assert (hdr .cop == FIO_MKDIR );
3855+
3856+ if (hdr .arg != 0 )
3857+ {
3858+ errno = hdr .arg ;
3859+ return -1 ;
3860+ }
3861+ return 0 ;
3862+ }
3863+
38563864static void
38573865pioRemoteDrive_pioListDir (VSelf , parray * files , const char * root , bool handle_tablespaces ,
38583866 bool follow_symlink , bool backup_logs , bool skip_hidden ,
0 commit comments