]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/ceph_dedup_tool: use size_t for fpstore-threshold
authorSamuel Just <sjust@redhat.com>
Fri, 6 Oct 2023 22:54:28 +0000 (15:54 -0700)
committermyoungwon oh <ohmyoungwon@gmail.com>
Thu, 2 Nov 2023 05:53:54 +0000 (05:53 +0000)
At various points, this value was an int, an unsigned, an ssize_t, or a
uint64_t.  Change all of these to size_t.

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

index 0cb90699925dae8cd86038516e0e7ed3bccc8141..65c2b9ac3c60c5e494b70d1bfdb44fb35e12e764 100644 (file)
@@ -185,7 +185,7 @@ po::options_description make_usage() {
     ("daemon", ": execute sample dedup in daemon mode")
     ("loop", ": execute sample dedup in a loop until terminated. Sleeps 'wakeup-period' seconds between iterations")
     ("wakeup-period", po::value<int>(), ": set the wakeup period of crawler thread (sec)")
-    ("fpstore-threshold", po::value<int>()->default_value(100_M), ": set max size of in-memory fingerprint store (bytes)")
+    ("fpstore-threshold", po::value<size_t>()->default_value(100_M), ": set max size of in-memory fingerprint store (bytes)")
   ;
   desc.add(op_desc);
   return desc;
@@ -737,7 +737,7 @@ public:
 
     FpStore(size_t chunk_threshold,
       uint32_t report_period,  
-      ssize_t memory_threshold) :
+      size_t memory_threshold) :
       report_period(report_period),
       memory_threshold(memory_threshold),
       fp_map(chunk_threshold) { }
@@ -749,7 +749,7 @@ public:
     utime_t next_report;
     const uint32_t report_period;
     size_t total_bytes = 0;
-    const uint64_t memory_threshold;
+    const size_t memory_threshold;
     FpMap<std::string, dup_count_t> fp_map;
   };
 
@@ -760,7 +760,7 @@ public:
       int chunk_threshold,
       int sampling_ratio,
       uint32_t report_period,
-      unsigned fpstore_threshold) :
+      size_t fpstore_threshold) :
       fp_store(chunk_threshold, report_period, fpstore_threshold),
       sampling_ratio(static_cast<double>(sampling_ratio) / 100) { }
   };
@@ -1779,7 +1779,7 @@ int make_crawling_daemon(const po::variables_map &opts)
     cout << "100 second is set as wakeup period by default" << std::endl;
   }
 
-  const unsigned fp_threshold = opts["fpstore-threshold"].as<int>();
+  const size_t fp_threshold = opts["fpstore-threshold"].as<size_t>();
 
   std::string fp_algo = get_opts_fp_algo(opts);