libaio: commit on EAGAIN
[fio.git] / iolog.c
diff --git a/iolog.c b/iolog.c
index ef8b84145db0e14f808bdb53539184011b44975b..4a7d939af251c77ae2de82d2ad57b15a9f04d4b4 100644 (file)
--- a/iolog.c
+++ b/iolog.c
@@ -28,7 +28,7 @@ void queue_io_piece(struct thread_data *td, struct io_piece *ipo)
        td->total_io_size += ipo->len;
 }
 
-void log_io_u(struct thread_data *td, struct io_u *io_u)
+void log_io_u(const struct thread_data *td, const struct io_u *io_u)
 {
        if (!td->o.write_iolog_file)
                return;
@@ -282,7 +282,7 @@ void unlog_io_piece(struct thread_data *td, struct io_u *io_u)
        td->io_hist_len--;
 }
 
-void trim_io_piece(struct thread_data *td, struct io_u *io_u)
+void trim_io_piece(struct thread_data *td, const struct io_u *io_u)
 {
        struct io_piece *ipo = io_u->ipo;
 
@@ -539,9 +539,9 @@ int init_iolog(struct thread_data *td)
 void setup_log(struct io_log **log, struct log_params *p,
               const char *filename)
 {
-       struct io_log *l = malloc(sizeof(*l));
+       struct io_log *l;
 
-       memset(l, 0, sizeof(*l));
+       l = calloc(1, sizeof(*l));
        l->nr_samples = 0;
        l->max_samples = 1024;
        l->log_type = p->log_type;