t/io_uring: only calculate per-file depth if we have files
[fio.git] / engines / posixaio.c
index 135d088c7a029ef1ac3e55192d724d147875bbe7..0f4eea68a9ee6019e256498c0279be611dfd3473 100644 (file)
@@ -197,11 +197,9 @@ static void fio_posixaio_cleanup(struct thread_data *td)
 
 static int fio_posixaio_init(struct thread_data *td)
 {
-       struct posixaio_data *pd = malloc(sizeof(*pd));
-
-       memset(pd, 0, sizeof(*pd));
-       pd->aio_events = malloc(td->o.iodepth * sizeof(struct io_u *));
-       memset(pd->aio_events, 0, td->o.iodepth * sizeof(struct io_u *));
+       struct posixaio_data *pd;
+       pd = calloc(1, sizeof(*pd));
+       pd->aio_events = calloc(td->o.iodepth, sizeof(struct io_u *));
 
        td->io_ops_data = pd;
        return 0;