]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/ceph_dedup_tool: make dedup_threshold a size_t
authorSamuel Just <sjust@redhat.com>
Fri, 6 Oct 2023 22:59:44 +0000 (15:59 -0700)
committermyoungwon oh <ohmyoungwon@gmail.com>
Thu, 2 Nov 2023 05:54:16 +0000 (05:54 +0000)
It was variously an int, a uint32_t, or an ssize_t.  Standardize it to
size_t.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/tools/ceph_dedup_tool.cc

index 4808058b866c13dd01480a7ace3bd0504bb6189a..c67368f9318c7d41a3085c044ee80d24df28e4a5 100644 (file)
@@ -180,7 +180,7 @@ po::options_description make_usage() {
     ("snap", ": deduplciate snapshotted object")
     ("debug", ": enable debug")
     ("pgid", ": set pgid")
-    ("chunk-dedup-threshold", po::value<uint32_t>(), ": set the threshold for chunk dedup (number of duplication) ")
+    ("chunk-dedup-threshold", po::value<size_t>(), ": set the threshold for chunk dedup (number of duplication) ")
     ("sampling-ratio", po::value<int>(), ": set the sampling ratio (percentile)")
     ("daemon", ": execute sample dedup in daemon mode")
     ("loop", ": execute sample dedup in a loop until terminated. Sleeps 'wakeup-period' seconds between iterations")
@@ -686,12 +686,12 @@ public:
       under_threshold_fp_map.clear();
     }
 
-    FpMap(ssize_t dedup_threshold) : dedup_threshold(dedup_threshold) {}
+    FpMap(size_t dedup_threshold) : dedup_threshold(dedup_threshold) {}
     FpMap() = delete;
   private:
     map_t under_threshold_fp_map;
     map_t over_threshold_fp_map;
-    const ssize_t dedup_threshold;
+    const size_t dedup_threshold;
   };
 
   class FpStore {
@@ -757,7 +757,7 @@ public:
     FpStore fp_store;
     const double sampling_ratio = -1;
     SampleDedupGlobal(
-      int chunk_threshold,
+      size_t chunk_threshold,
       int sampling_ratio,
       uint32_t report_period,
       size_t fpstore_threshold) :
@@ -1756,7 +1756,7 @@ int make_crawling_daemon(const po::variables_map &opts)
 
   uint32_t chunk_dedup_threshold = -1;
   if (opts.count("chunk-dedup-threshold")) {
-    chunk_dedup_threshold = opts["chunk-dedup-threshold"].as<uint32_t>();
+    chunk_dedup_threshold = opts["chunk-dedup-threshold"].as<size_t>();
   }
 
   std::string chunk_algo = get_opts_chunk_algo(opts);