utime_t &operator+=(utime_t, double) exists, let's just use that and
not muck about with converting the double to an int.
Fixes: 14247
Signed-off-by: Samuel Just <sjust@redhat.com>
pool_scrub_max_interval : g_conf->osd_scrub_max_interval;
sched_time += scrub_min_interval;
- if (g_conf->osd_scrub_interval_randomize_ratio > 0) {
- sched_time += rand() % (int)(scrub_min_interval *
- g_conf->osd_scrub_interval_randomize_ratio);
- }
+ double r = rand() / RAND_MAX;
+ sched_time +=
+ scrub_min_interval * g_conf->osd_scrub_interval_randomize_ratio * r;
deadline += scrub_max_interval;
}
}