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;
}
while (!flist_empty(&td->io_hist_list)) {
- ipo = flist_entry(&td->io_hist_list, struct io_piece, list);
+ ipo = flist_first_entry(&td->io_hist_list, struct io_piece, list);
flist_del(&ipo->list);
remove_trim_entry(td, ipo);
td->io_hist_len--;
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;
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;
*/
total = ic.len;
do {
- size_t ret;
+ size_t iret;
- ret = inflate_chunk(&ic, 1, stdout, &stream, &iter);
- total -= ret;
+ iret = inflate_chunk(&ic, 1, stdout, &stream, &iter);
+ total -= iret;
if (!total)
break;
if (iter.err)
break;
ic.seq++;
- ic.len -= ret;
- ic.buf += ret;
+ ic.len -= iret;
+ ic.buf += iret;
} while (1);
if (iter.seq) {