X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=eta.c;h=5ef31c692cf8b9a32bd366710fcc81af4cb71623;hp=cfb8679379c6d5a89d268add26df235a320dee9d;hb=9e6eedcd3535a249b73db0551f15044360239de5;hpb=fc47559b84e9708f97b66ff4123950fb33de9dc3 diff --git a/eta.c b/eta.c index cfb86793..5ef31c69 100644 --- a/eta.c +++ b/eta.c @@ -139,6 +139,15 @@ static int thread_eta(struct thread_data *td) bytes_total = td->fill_device_size; } + if (td->o.zone_size && td->o.zone_skip && bytes_total) { + unsigned int nr_zones; + uint64_t zone_bytes; + + zone_bytes = bytes_total + td->o.zone_size + td->o.zone_skip; + nr_zones = (zone_bytes - 1) / (td->o.zone_size + td->o.zone_skip); + bytes_total -= nr_zones * td->o.zone_skip; + } + /* * if writing and verifying afterwards, bytes_total will be twice the * size. In a mixed workload, verify phase will be the size of the @@ -156,9 +165,6 @@ static int thread_eta(struct thread_data *td) bytes_total <<= 1; } - if (td->o.zone_size && td->o.zone_skip) - bytes_total /= (td->o.zone_skip / td->o.zone_size); - if (td->runstate == TD_RUNNING || td->runstate == TD_VERIFYING) { double perc, perc_t;