@@ -1536,32 +1536,8 @@ dir_create_dir(const char *dir, mode_t mode, bool strict)
1536
1536
int
1537
1537
fio_mkdir (fio_location location , const char * path , int mode , bool strict )
1538
1538
{
1539
- if (fio_is_remote (location ))
1540
- {
1541
- fio_header hdr = {
1542
- .cop = FIO_MKDIR ,
1543
- .handle = strict ? 1 : 0 , /* ugly "hack" to pass more params*/
1544
- .size = strlen (path ) + 1 ,
1545
- .arg = mode ,
1546
- };
1547
-
1548
- IO_CHECK (fio_write_all (fio_stdout , & hdr , sizeof (hdr )), sizeof (hdr ));
1549
- IO_CHECK (fio_write_all (fio_stdout , path , hdr .size ), hdr .size );
1550
-
1551
- IO_CHECK (fio_read_all (fio_stdin , & hdr , sizeof (hdr )), sizeof (hdr ));
1552
- Assert (hdr .cop == FIO_MKDIR );
1553
-
1554
- if (hdr .arg != 0 )
1555
- {
1556
- errno = hdr .arg ;
1557
- return -1 ;
1558
- }
1559
- return 0 ;
1560
- }
1561
- else
1562
- {
1563
- return dir_create_dir (path , mode , strict );
1564
- }
1539
+ pioDrive_i drive = pioDriveForLocation (location );
1540
+ return $i (pioMakeDir , drive , .path = path , .mode = mode , .strict = strict );
1565
1541
}
1566
1542
1567
1543
static void
@@ -4136,6 +4112,13 @@ pioLocalDrive_pioIsRemote(VSelf)
4136
4112
return false;
4137
4113
}
4138
4114
4115
+ static int
4116
+ pioLocalDrive_pioMakeDir (VSelf , const char * path , mode_t mode , bool strict )
4117
+ {
4118
+ FOBJ_FUNC_ARP ();
4119
+ return dir_create_dir (path , mode , strict );
4120
+ }
4121
+
4139
4122
static void
4140
4123
pioLocalDrive_pioListDir (VSelf , parray * files , const char * root , bool handle_tablespaces ,
4141
4124
bool follow_symlink , bool backup_logs , bool skip_hidden ,
@@ -4452,6 +4435,31 @@ pioRemoteDrive_pioIsRemote(VSelf)
4452
4435
return true;
4453
4436
}
4454
4437
4438
+ static int
4439
+ pioRemoteDrive_pioMakeDir (VSelf , const char * path , mode_t mode , bool strict )
4440
+ {
4441
+ FOBJ_FUNC_ARP ();
4442
+ fio_header hdr = {
4443
+ .cop = FIO_MKDIR ,
4444
+ .handle = strict ? 1 : 0 , /* ugly "hack" to pass more params*/
4445
+ .size = strlen (path ) + 1 ,
4446
+ .arg = mode ,
4447
+ };
4448
+
4449
+ IO_CHECK (fio_write_all (fio_stdout , & hdr , sizeof (hdr )), sizeof (hdr ));
4450
+ IO_CHECK (fio_write_all (fio_stdout , path , hdr .size ), hdr .size );
4451
+
4452
+ IO_CHECK (fio_read_all (fio_stdin , & hdr , sizeof (hdr )), sizeof (hdr ));
4453
+ Assert (hdr .cop == FIO_MKDIR );
4454
+
4455
+ if (hdr .arg != 0 )
4456
+ {
4457
+ errno = hdr .arg ;
4458
+ return -1 ;
4459
+ }
4460
+ return 0 ;
4461
+ }
4462
+
4455
4463
static void
4456
4464
pioRemoteDrive_pioListDir (VSelf , parray * files , const char * root , bool handle_tablespaces ,
4457
4465
bool follow_symlink , bool backup_logs , bool skip_hidden ,
0 commit comments