if (act == __BLK_TA_QUEUE) {
inflight_add(p, t->sector, t->bytes);
ret = handle_queue_trace(t, p);
- } else if (act == __BLK_TA_REQUEUE) {
- p->o.inflight--;
} else if (act == __BLK_TA_BACKMERGE) {
struct inflight *i;
uint64_t usec = (o->last_ttime[rw] - o->first_ttime[rw]) / 1000ULL;
uint64_t val;
+ if (!usec)
+ return 0;
+
+ usec /= 1000;
if (!usec)
return 0;
val = o->kb[rw] * 1000ULL;
- return val / (usec / 1000ULL);
+ return val / usec;
}
static uint64_t o_first_ttime(struct btrace_out *o)