]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scrub: prefer modern C++ random facilities 69148/head
authorRonen Friedman <rfriedma@redhat.com>
Thu, 28 May 2026 16:14:41 +0000 (16:14 +0000)
committerRonen Friedman <rfriedma@redhat.com>
Fri, 29 May 2026 04:35:04 +0000 (04:35 +0000)
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/osd/scrubber/scrub_job.cc

index 08014834ef3de6bec0de651e7af0587eaae93870..19182d15cb986f74812cb358e6fae9398fe37727 100644 (file)
@@ -128,7 +128,8 @@ void ScrubJob::adjust_shallow_schedule(
 
     // add a random delay to the proposed scheduled time
     adj_target += app_conf.shallow_interval;
-    double r = rand() / (double)RAND_MAX;
+    std::uniform_real_distribution<double> dist{0.0, 1.0};
+    double r = dist(random_gen);
     adj_target +=
        app_conf.shallow_interval * app_conf.interval_randomize_ratio * r;