1) Setup a new current log, if the log doesn't have one.
2) Bump size of pending log. Should be depth + 1, let's just
use the default size of a log (1024).
Signed-off-by: Jens Axboe <axboe@fb.com>
struct io_logs *p;
p = calloc(1, sizeof(*l->pending));
- p->max_samples = l->td->o.iodepth;
+ p->max_samples = DEF_LOG_ENTRIES;
p->log = calloc(p->max_samples, log_entry_sz(l));
l->pending = p;
}
return NULL;
cur_log = iolog_cur_log(iolog);
+ if (!cur_log) {
+ cur_log = get_new_log(iolog);
+ if (!cur_log)
+ return NULL;
+ }
+
if (cur_log->nr_samples < cur_log->max_samples)
return cur_log;