From: Samuel Just Date: Fri, 6 Oct 2023 22:54:28 +0000 (-0700) Subject: tools/ceph_dedup_tool: use size_t for fpstore-threshold X-Git-Tag: v19.0.0~73^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c841c761ce6d3ef86a4390b4e6367f72bb323fb2;p=ceph.git tools/ceph_dedup_tool: use size_t for fpstore-threshold 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 --- diff --git a/src/tools/ceph_dedup_tool.cc b/src/tools/ceph_dedup_tool.cc index 0cb90699925d..65c2b9ac3c60 100644 --- a/src/tools/ceph_dedup_tool.cc +++ b/src/tools/ceph_dedup_tool.cc @@ -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(), ": set the wakeup period of crawler thread (sec)") - ("fpstore-threshold", po::value()->default_value(100_M), ": set max size of in-memory fingerprint store (bytes)") + ("fpstore-threshold", po::value()->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 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(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(); + const size_t fp_threshold = opts["fpstore-threshold"].as(); std::string fp_algo = get_opts_fp_algo(opts);