@@ -1505,32 +1505,8 @@ dir_create_dir(const char *dir, mode_t mode, bool strict)
1505
1505
int
1506
1506
fio_mkdir (fio_location location , const char * path , int mode , bool strict )
1507
1507
{
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 );
1534
1510
}
1535
1511
1536
1512
static void
@@ -3537,6 +3513,13 @@ pioLocalDrive_pioIsRemote(VSelf)
3537
3513
return false;
3538
3514
}
3539
3515
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
+
3540
3523
static void
3541
3524
pioLocalDrive_pioListDir (VSelf , parray * files , const char * root , bool handle_tablespaces ,
3542
3525
bool follow_symlink , bool backup_logs , bool skip_hidden ,
@@ -3853,6 +3836,31 @@ pioRemoteDrive_pioIsRemote(VSelf)
3853
3836
return true;
3854
3837
}
3855
3838
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
+
3856
3864
static void
3857
3865
pioRemoteDrive_pioListDir (VSelf , parray * files , const char * root , bool handle_tablespaces ,
3858
3866
bool follow_symlink , bool backup_logs , bool skip_hidden ,
0 commit comments