@@ -1536,32 +1536,8 @@ dir_create_dir(const char *dir, mode_t mode, bool strict)
15361536int
15371537fio_mkdir (fio_location location , const char * path , int mode , bool strict )
15381538{
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 );
15651541}
15661542
15671543static void
@@ -4136,6 +4112,13 @@ pioLocalDrive_pioIsRemote(VSelf)
41364112 return false;
41374113}
41384114
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+
41394122static void
41404123pioLocalDrive_pioListDir (VSelf , parray * files , const char * root , bool handle_tablespaces ,
41414124 bool follow_symlink , bool backup_logs , bool skip_hidden ,
@@ -4452,6 +4435,31 @@ pioRemoteDrive_pioIsRemote(VSelf)
44524435 return true;
44534436}
44544437
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+
44554463static void
44564464pioRemoteDrive_pioListDir (VSelf , parray * files , const char * root , bool handle_tablespaces ,
44574465 bool follow_symlink , bool backup_logs , bool skip_hidden ,
0 commit comments