]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/options: ensure all RBD-related integer options are unsigned
authorJason Dillaman <dillaman@redhat.com>
Thu, 4 Oct 2018 17:29:12 +0000 (13:29 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 4 Oct 2018 20:39:32 +0000 (16:39 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
22 files changed:
src/common/options.cc
src/librbd/ImageCtx.cc
src/librbd/ImageState.cc
src/librbd/Journal.cc
src/librbd/deep_copy/ImageCopyRequest.cc
src/librbd/image/CreateRequest.cc
src/librbd/internal.cc
src/test/librbd/managed_lock/test_mock_AcquireRequest.cc
src/test/rbd_mirror/test_mock_LeaderWatcher.cc
src/tools/rbd/action/Create.cc
src/tools/rbd/action/Export.cc
src/tools/rbd/action/Import.cc
src/tools/rbd/action/List.cc
src/tools/rbd/action/MirrorPool.cc
src/tools/rbd_mirror/InstanceReplayer.cc
src/tools/rbd_mirror/InstanceWatcher.cc
src/tools/rbd_mirror/Instances.cc
src/tools/rbd_mirror/LeaderWatcher.cc
src/tools/rbd_mirror/LeaderWatcher.h
src/tools/rbd_mirror/Mirror.cc
src/tools/rbd_mirror/Threads.cc
src/tools/rbd_mirror/image_map/Policy.cc

index 7e89a816596d7e1677d47f5d528e07293b5e1cb1..a8253e4223c54cf49a8f64940f9e286700ef4274 100644 (file)
@@ -6402,11 +6402,11 @@ static std::vector<Option> get_rbd_options() {
        return 0;
       }),
 
-    Option("rbd_op_threads", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_op_threads", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(1)
     .set_description("number of threads to utilize for internal processing"),
 
-    Option("rbd_op_thread_timeout", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_op_thread_timeout", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(60)
     .set_description("time in seconds for detecting a hung thread"),
 
@@ -6440,7 +6440,7 @@ static std::vector<Option> get_rbd_options() {
     .set_default(1.0)
     .set_description("seconds in cache before writeback starts"),
 
-    Option("rbd_cache_max_dirty_object", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_cache_max_dirty_object", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(0)
     .set_description("dirty limit for objects - set to 0 for auto calculate from rbd_cache_size"),
 
@@ -6448,7 +6448,7 @@ static std::vector<Option> get_rbd_options() {
     .set_default(false)
     .set_description("whether to block writes to the cache before the aio_write call completes"),
 
-    Option("rbd_concurrent_management_ops", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_concurrent_management_ops", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(10)
     .set_min(1)
     .set_description("how many operations can be in flight for a management operation like deleting or resizing an image"),
@@ -6481,7 +6481,7 @@ static std::vector<Option> get_rbd_options() {
                           "object size will disable sparse-read for all "
                           "requests"),
 
-    Option("rbd_readahead_trigger_requests", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_readahead_trigger_requests", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(10)
     .set_description("number of sequential requests necessary to trigger readahead"),
 
@@ -6501,11 +6501,11 @@ static std::vector<Option> get_rbd_options() {
     .set_default(true)
     .set_description("whether to blacklist clients whose lock was broken"),
 
-    Option("rbd_blacklist_expire_seconds", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_blacklist_expire_seconds", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(0)
     .set_description("number of seconds to blacklist - set to 0 for OSD default"),
 
-    Option("rbd_request_timed_out_seconds", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_request_timed_out_seconds", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(30)
     .set_description("number of seconds before maintenance request times out"),
 
@@ -6545,15 +6545,15 @@ static std::vector<Option> get_rbd_options() {
     .set_default(0)
     .set_description("time-delay in seconds for rbd-mirror delete propagation"),
 
-    Option("rbd_mirroring_replay_delay", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_mirroring_replay_delay", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(0)
     .set_description("time-delay in seconds for rbd-mirror asynchronous replication"),
 
-    Option("rbd_default_format", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_default_format", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(2)
     .set_description("default image format for new images"),
 
-    Option("rbd_default_order", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_default_order", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(22)
     .set_description("default order (data block object size) for new images"),
 
@@ -6598,7 +6598,7 @@ static std::vector<Option> get_rbd_options() {
     .set_default(5)
     .set_description("commit time interval, seconds"),
 
-    Option("rbd_journal_object_flush_interval", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_journal_object_flush_interval", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(0)
     .set_description("maximum number of pending commits per journal object"),
 
@@ -6622,7 +6622,7 @@ static std::vector<Option> get_rbd_options() {
     .set_default(16384)
     .set_description("maximum journal payload size before splitting"),
 
-    Option("rbd_journal_max_concurrent_object_sets", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_journal_max_concurrent_object_sets", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(0)
     .set_description("maximum number of object sets a journal client can be behind before it is automatically unregistered"),
 
@@ -6688,7 +6688,7 @@ static std::vector<Option> get_rbd_mirror_options() {
     .set_default(5)
     .set_description("maximum number of image syncs in parallel"),
 
-    Option("rbd_mirror_pool_replayers_refresh_interval", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_mirror_pool_replayers_refresh_interval", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(30)
     .set_description("interval to refresh peers in rbd-mirror daemon"),
 
@@ -6701,21 +6701,21 @@ static std::vector<Option> get_rbd_mirror_options() {
     .set_default(30)
     .set_description("interval to check and retry the failed deletion requests"),
 
-    Option("rbd_mirror_image_state_check_interval", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_mirror_image_state_check_interval", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(30)
     .set_min(1)
     .set_description("interval to get images from pool watcher and set sources in replayer"),
 
-    Option("rbd_mirror_leader_heartbeat_interval", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_mirror_leader_heartbeat_interval", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(5)
     .set_min(1)
     .set_description("interval (in seconds) between mirror leader heartbeats"),
 
-    Option("rbd_mirror_leader_max_missed_heartbeats", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_mirror_leader_max_missed_heartbeats", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(2)
     .set_description("number of missed heartbeats for non-lock owner to attempt to acquire lock"),
 
-    Option("rbd_mirror_leader_max_acquire_attempts_before_break", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_mirror_leader_max_acquire_attempts_before_break", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(3)
     .set_description("number of failed attempts to acquire lock after missing heartbeats before breaking lock"),
 
@@ -6724,7 +6724,7 @@ static std::vector<Option> get_rbd_mirror_options() {
     .set_enum_allowed({"none", "simple"})
     .set_description("active/active policy type for mapping images to instances"),
 
-    Option("rbd_mirror_image_policy_migration_throttle", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_mirror_image_policy_migration_throttle", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(300)
     .set_description("number of seconds after which an image can be reshuffled (migrated) again"),
 
index f6b5047cf7bcf2725a9ea3729b46ed984d0ec6e1..6ab0555fa4cf65090b03ca844a70b6ca825e15ac 100644 (file)
@@ -62,7 +62,7 @@ public:
     : ThreadPool(cct, "librbd::thread_pool", "tp_librbd", 1,
                  "rbd_op_threads"),
       op_work_queue(new ContextWQ("librbd::op_work_queue",
-                                  cct->_conf.get_val<int64_t>("rbd_op_thread_timeout"),
+                                  cct->_conf.get_val<uint64_t>("rbd_op_thread_timeout"),
                                   this)) {
     start();
   }
@@ -139,7 +139,7 @@ public:
     get_thread_pool_instance(cct, &thread_pool, &op_work_queue);
     io_work_queue = new io::ImageRequestWQ<>(
       this, "librbd::io_work_queue",
-      cct->_conf.get_val<int64_t>("rbd_op_thread_timeout"),
+      cct->_conf.get_val<uint64_t>("rbd_op_thread_timeout"),
       thread_pool);
     io_object_dispatcher = new io::ObjectDispatcher<>(this);
 
@@ -844,34 +844,34 @@ public:
     ASSIGN_OPTION(cache_max_dirty, Option::size_t);
     ASSIGN_OPTION(cache_target_dirty, Option::size_t);
     ASSIGN_OPTION(cache_max_dirty_age, double);
-    ASSIGN_OPTION(cache_max_dirty_object, int64_t);
+    ASSIGN_OPTION(cache_max_dirty_object, uint64_t);
     ASSIGN_OPTION(cache_block_writes_upfront, bool);
-    ASSIGN_OPTION(concurrent_management_ops, int64_t);
+    ASSIGN_OPTION(concurrent_management_ops, uint64_t);
     ASSIGN_OPTION(balance_snap_reads, bool);
     ASSIGN_OPTION(localize_snap_reads, bool);
     ASSIGN_OPTION(balance_parent_reads, bool);
     ASSIGN_OPTION(localize_parent_reads, bool);
     ASSIGN_OPTION(sparse_read_threshold_bytes, Option::size_t);
-    ASSIGN_OPTION(readahead_trigger_requests, int64_t);
+    ASSIGN_OPTION(readahead_trigger_requests, uint64_t);
     ASSIGN_OPTION(readahead_max_bytes, Option::size_t);
     ASSIGN_OPTION(readahead_disable_after_bytes, Option::size_t);
     ASSIGN_OPTION(clone_copy_on_read, bool);
     ASSIGN_OPTION(blacklist_on_break_lock, bool);
-    ASSIGN_OPTION(blacklist_expire_seconds, int64_t);
-    ASSIGN_OPTION(request_timed_out_seconds, int64_t);
+    ASSIGN_OPTION(blacklist_expire_seconds, uint64_t);
+    ASSIGN_OPTION(request_timed_out_seconds, uint64_t);
     ASSIGN_OPTION(enable_alloc_hint, bool);
     ASSIGN_OPTION(journal_order, uint64_t);
     ASSIGN_OPTION(journal_splay_width, uint64_t);
     ASSIGN_OPTION(journal_commit_age, double);
-    ASSIGN_OPTION(journal_object_flush_interval, int64_t);
+    ASSIGN_OPTION(journal_object_flush_interval, uint64_t);
     ASSIGN_OPTION(journal_object_flush_bytes, Option::size_t);
     ASSIGN_OPTION(journal_object_flush_age, double);
     ASSIGN_OPTION(journal_object_max_in_flight_appends, uint64_t);
     ASSIGN_OPTION(journal_max_payload_bytes, Option::size_t);
-    ASSIGN_OPTION(journal_max_concurrent_object_sets, int64_t);
+    ASSIGN_OPTION(journal_max_concurrent_object_sets, uint64_t);
     ASSIGN_OPTION(mirroring_resync_after_disconnect, bool);
     ASSIGN_OPTION(mirroring_delete_delay, uint64_t);
-    ASSIGN_OPTION(mirroring_replay_delay, int64_t);
+    ASSIGN_OPTION(mirroring_replay_delay, uint64_t);
     ASSIGN_OPTION(mtime_update_interval, uint64_t);
     ASSIGN_OPTION(atime_update_interval, uint64_t);
     ASSIGN_OPTION(skip_partial_discard, bool);
index fd1aa357475d406c79202560d3debfe58bb46ead..1f0535e25c823704b9d63b1b0ebb8dd055bd703d 100644 (file)
@@ -216,7 +216,7 @@ private:
       ThreadPoolSingleton>("librbd::ImageUpdateWatchers::thread_pool",
                           false, m_cct);
     m_work_queue = new ContextWQ("librbd::ImageUpdateWatchers::op_work_queue",
-                                m_cct->_conf.get_val<int64_t>("rbd_op_thread_timeout"),
+                                m_cct->_conf.get_val<uint64_t>("rbd_op_thread_timeout"),
                                 &thread_pool);
   }
 
index a74cfb4c510cecc209425073bd49edf04cd93668..233de8fb5252599b5e7023741984c14da4c8ec99 100644 (file)
@@ -340,7 +340,7 @@ Journal<I>::Journal(I &image_ctx)
     &cct->lookup_or_create_singleton_object<ThreadPoolSingleton>(
       "librbd::journal::thread_pool", false, cct);
   m_work_queue = new ContextWQ("librbd::journal::work_queue",
-                               cct->_conf.get_val<int64_t>("rbd_op_thread_timeout"),
+                               cct->_conf.get_val<uint64_t>("rbd_op_thread_timeout"),
                                thread_pool_singleton);
   ImageCtx::get_timer_instance(cct, &m_timer, &m_timer_lock);
 }
index 1f6ce40227454190e153a0458438d3c1b37d0fa1..f9be8276a75baf440b7d6dc3b1259459c65b4769 100644 (file)
@@ -82,8 +82,8 @@ void ImageCopyRequest<I>::send_object_copies() {
   bool complete;
   {
     Mutex::Locker locker(m_lock);
-    for (int i = 0;
-         i < m_cct->_conf.get_val<int64_t>("rbd_concurrent_management_ops");
+    for (uint64_t i = 0;
+         i < m_cct->_conf.get_val<uint64_t>("rbd_concurrent_management_ops");
          ++i) {
       send_next_object_copy();
       if (m_ret_val < 0 && m_current_ops == 0) {
index 693b95bb26d8069b92a0b150fe4fa6e544256f72..77823d2bb6a6d33fa987e1e4cc5fc8b9a219b2c5 100644 (file)
@@ -238,7 +238,7 @@ void CreateRequest<I>::handle_get_pool_metadata(int r) {
   }
   if (get_image_option(m_image_options, RBD_IMAGE_OPTION_ORDER,
                        &m_order) != 0 || m_order == 0) {
-    m_order = config.get_val<int64_t>("rbd_default_order");
+    m_order = config.get_val<uint64_t>("rbd_default_order");
   }
   if (get_image_option(m_image_options, RBD_IMAGE_OPTION_JOURNAL_ORDER,
                        &m_journal_order) != 0) {
index 18ced600d84e7dec884ff3354334459dd9ee7cd1..d57ad9567109184692a8278f06d3950579e5afd1 100644 (file)
@@ -877,7 +877,7 @@ bool compare_by_name(const child_info_t& c1, const child_info_t& c2)
 
     uint64_t format;
     if (opts.get(RBD_IMAGE_OPTION_FORMAT, &format) != 0)
-      format = cct->_conf.get_val<int64_t>("rbd_default_format");
+      format = cct->_conf.get_val<uint64_t>("rbd_default_format");
     bool old_format = format == 1;
 
     // make sure it doesn't already exist, in either format
@@ -894,7 +894,7 @@ bool compare_by_name(const child_info_t& c1, const child_info_t& c2)
 
     uint64_t order = 0;
     if (opts.get(RBD_IMAGE_OPTION_ORDER, &order) != 0 || order == 0) {
-      order = cct->_conf.get_val<int64_t>("rbd_default_order");
+      order = cct->_conf.get_val<uint64_t>("rbd_default_order");
     }
     r = image::CreateRequest<>::validate_order(cct, order);
     if (r < 0) {
index b14a218208a63b774d252a95eec150933d7295d6..5218fa96d3477fcb4591ee18cf23d22795231126 100644 (file)
@@ -36,8 +36,8 @@ struct BreakRequest<librbd::MockImageCtx> {
     CephContext *cct = reinterpret_cast<CephContext *>(ioctx.cct());
     EXPECT_EQ(cct->_conf.get_val<bool>("rbd_blacklist_on_break_lock"),
               blacklist_locker);
-    EXPECT_EQ(cct->_conf.get_val<int64_t>("rbd_blacklist_expire_seconds"),
-              (int)blacklist_expire_seconds);
+    EXPECT_EQ(cct->_conf.get_val<uint64_t>("rbd_blacklist_expire_seconds"),
+              blacklist_expire_seconds);
     EXPECT_FALSE(force_break_lock);
     ceph_assert(s_instance != nullptr);
     s_instance->on_finish = on_finish;
index e8b4326d890f077bf5d6f9f6bc618bbdd1ded7af..d83fe92aaa300c83f9764c4c1f770427a3f4e061 100644 (file)
@@ -626,7 +626,7 @@ TEST_F(TestMockLeaderWatcher, Break) {
   EXPECT_EQ(0, _rados->conf_set("rbd_mirror_leader_max_missed_heartbeats",
                                 "1"));
   CephContext *cct = reinterpret_cast<CephContext *>(m_local_io_ctx.cct());
-  int max_acquire_attempts = cct->_conf.get_val<int64_t>(
+  int max_acquire_attempts = cct->_conf.get_val<uint64_t>(
     "rbd_mirror_leader_max_acquire_attempts_before_break");
 
   MockManagedLock mock_managed_lock;
index 5f950e30bd96da272bdd8bae1c2f190527cf882e..5a168d9bc268b4f879415c737a91ecb5afb0eef8 100644 (file)
@@ -64,7 +64,7 @@ struct thick_provision_writer {
     ceph_assert(r >= 0);
     uint64_t order;
     if (info.order == 0) {
-      order = g_conf().get_val<int64_t>("rbd_default_order");
+      order = g_conf().get_val<uint64_t>("rbd_default_order");
     } else {
       order = info.order;
     }
@@ -73,7 +73,7 @@ struct thick_provision_writer {
       chunk_size = image->get_stripe_unit();
     }
 
-    concurr = g_conf().get_val<int64_t>("rbd_concurrent_management_ops");
+    concurr = g_conf().get_val<uint64_t>("rbd_concurrent_management_ops");
     io_status.in_flight = 0;
     io_status.io_error = 0;
   }
index 710eeddeaed7772bcbbf141c0d7f412914de21ab..cbad1cd280cdc1fd53e689c10499a779ea5620ea 100644 (file)
@@ -190,7 +190,7 @@ int do_export_diff_fd(librbd::Image& image, const char *fromsnapname,
     }
   }
   ExportDiffContext edc(&image, fd, info.size,
-                        g_conf().get_val<int64_t>("rbd_concurrent_management_ops"),
+                        g_conf().get_val<uint64_t>("rbd_concurrent_management_ops"),
                         no_progress, export_format);
   r = image.diff_iterate2(fromsnapname, 0, info.size, true, whole_object,
                           &C_ExportDiff::export_diff_cb, (void *)&edc);
@@ -565,7 +565,7 @@ static int do_export(librbd::Image& image, const char *path, bool no_progress, i
     fd = STDOUT_FILENO;
     max_concurrent_ops = 1;
   } else {
-    max_concurrent_ops = g_conf().get_val<int64_t>("rbd_concurrent_management_ops");
+    max_concurrent_ops = g_conf().get_val<uint64_t>("rbd_concurrent_management_ops");
     fd = open(path, O_WRONLY | O_CREAT | O_EXCL, 0644);
     if (fd < 0) {
       return -errno;
index f7205ee758e409483efc2bd471ecbf756e68e138..94ac426181769e9d393b21694ab2fa8165312b1a 100644 (file)
@@ -37,7 +37,7 @@ struct ImportDiffContext {
   ImportDiffContext(librbd::Image *image, int fd, size_t size, bool no_progress)
     : image(image), fd(fd), size(size), pc("Importing image diff", no_progress),
       throttle((fd == STDIN_FILENO) ? 1 :
-                  g_conf().get_val<int64_t>("rbd_concurrent_management_ops"),
+                  g_conf().get_val<uint64_t>("rbd_concurrent_management_ops"),
                false),
       last_offset(0) {
   }
@@ -740,7 +740,7 @@ static int do_import_v1(int fd, librbd::Image &image, uint64_t size,
     throttle.reset(new SimpleThrottle(1, false));
   } else {
     throttle.reset(new SimpleThrottle(
-      g_conf().get_val<int64_t>("rbd_concurrent_management_ops"), false));
+      g_conf().get_val<uint64_t>("rbd_concurrent_management_ops"), false));
   }
 
   reqlen = min<uint64_t>(reqlen, size);
@@ -834,7 +834,7 @@ static int do_import(librados::Rados &rados, librbd::RBD &rbd,
 
   uint64_t order;
   if (opts.get(RBD_IMAGE_OPTION_ORDER, &order) != 0) {
-    order = g_conf().get_val<int64_t>("rbd_default_order");
+    order = g_conf().get_val<uint64_t>("rbd_default_order");
   }
 
   // try to fill whole imgblklen blocks for sparsification
index d4b3a2c28644b4d18b42418c7778416e175ff0bc..dcab81814a6e19bcabcaccfa7885d539c27feb74 100644 (file)
@@ -302,7 +302,7 @@ int execute(const po::variables_map &vm,
   }
 
   r = do_list(pool_name, namespace_name, vm["long"].as<bool>(),
-              g_conf().get_val<int64_t>("rbd_concurrent_management_ops"),
+              g_conf().get_val<uint64_t>("rbd_concurrent_management_ops"),
               formatter.get());
   if (r < 0) {
     std::cerr << "rbd: listing images failed : " << cpp_strerror(r) << std::endl;
index db33a20e50cf4a3ed7d32d33df3a4f1d03a1baf3..825965d9af29843f9915e301e7368d0bfcce42b7 100644 (file)
@@ -667,7 +667,7 @@ public:
       m_factory(std::bind(ImageRequestAllocator<RequestT>(),
                           std::ref(m_io_ctx), std::ref(m_throttle),
                           std::placeholders::_1, std::forward<Args>(args)...)),
-      m_throttle(g_conf().get_val<int64_t>("rbd_concurrent_management_ops"),
+      m_throttle(g_conf().get_val<uint64_t>("rbd_concurrent_management_ops"),
                  true) {
   }
 
index d3dfc557d702f75a2ad30e432df921ee6f433c3c..6d6b03ea8dbc34f8e703083d90072dd561246f3a 100644 (file)
@@ -489,7 +489,7 @@ void InstanceReplayer<I>::schedule_image_state_check_task() {
     });
 
   auto cct = static_cast<CephContext *>(m_local_rados->cct());
-  int after = cct->_conf.get_val<int64_t>(
+  int after = cct->_conf.get_val<uint64_t>(
     "rbd_mirror_image_state_check_interval");
 
   dout(10) << "scheduling image state check after " << after << " sec (task "
index afecd4042f5ec01e23df0ede99baaf1d704e89ac..c1f990018e80f60d7954b952be6f9010653cfdcc 100644 (file)
@@ -326,7 +326,7 @@ InstanceWatcher<I>::InstanceWatcher(librados::IoCtx &io_ctx,
     m_lock(unique_lock_name("rbd::mirror::InstanceWatcher::m_lock", this)),
     m_instance_lock(librbd::ManagedLock<I>::create(
       m_ioctx, m_work_queue, m_oid, this, librbd::managed_lock::EXCLUSIVE, true,
-      m_cct->_conf.get_val<int64_t>("rbd_blacklist_expire_seconds"))) {
+      m_cct->_conf.get_val<uint64_t>("rbd_blacklist_expire_seconds"))) {
 }
 
 template <typename I>
index c7cea7094df007552070e628c65f69408ece8b84..cdef008c3d60277d96de99ed91c1b51f98795b8c 100644 (file)
@@ -314,9 +314,9 @@ void Instances<I>::schedule_remove_task(const utime_t& time) {
     return;
   }
 
-  int after = m_cct->_conf.get_val<int64_t>("rbd_mirror_leader_heartbeat_interval") *
-    (1 + m_cct->_conf.get_val<int64_t>("rbd_mirror_leader_max_missed_heartbeats") +
-     m_cct->_conf.get_val<int64_t>("rbd_mirror_leader_max_acquire_attempts_before_break"));
+  int after = m_cct->_conf.get_val<uint64_t>("rbd_mirror_leader_heartbeat_interval") *
+    (1 + m_cct->_conf.get_val<uint64_t>("rbd_mirror_leader_max_missed_heartbeats") +
+     m_cct->_conf.get_val<uint64_t>("rbd_mirror_leader_max_acquire_attempts_before_break"));
 
   bool schedule = false;
   utime_t oldest_time = time;
index 4be445ba3da1a62134b6b1ef260ae1a3e58cbf6b..a26dafbc7710417478d9d7bdf5690b8aeabf521b 100644 (file)
@@ -34,7 +34,7 @@ LeaderWatcher<I>::LeaderWatcher(Threads<I> *threads, librados::IoCtx &io_ctx,
     m_notifier_id(librados::Rados(io_ctx).get_instance_id()),
     m_instance_id(stringify(m_notifier_id)),
     m_leader_lock(new LeaderLock(m_ioctx, m_work_queue, m_oid, this, true,
-                                 m_cct->_conf.get_val<int64_t>(
+                                 m_cct->_conf.get_val<uint64_t>(
                                    "rbd_blacklist_expire_seconds"))) {
 }
 
@@ -371,7 +371,7 @@ void LeaderWatcher<I>::schedule_timer_task(const std::string &name,
       m_timer_gate->timer_callback = timer_callback;
     });
 
-  int after = delay_factor * m_cct->_conf.get_val<int64_t>(
+  int after = delay_factor * m_cct->_conf.get_val<uint64_t>(
     "rbd_mirror_leader_heartbeat_interval");
 
   dout(10) << "scheduling " << name << " after " << after << " sec (task "
@@ -569,7 +569,7 @@ void LeaderWatcher<I>::handle_get_locker(int r,
     }
   }
 
-  if (m_acquire_attempts >= m_cct->_conf.get_val<int64_t>(
+  if (m_acquire_attempts >= m_cct->_conf.get_val<uint64_t>(
         "rbd_mirror_leader_max_acquire_attempts_before_break")) {
     dout(0) << "breaking leader lock after " << m_acquire_attempts << " "
             << "failed attempts to acquire" << dendl;
@@ -606,7 +606,7 @@ void LeaderWatcher<I>::schedule_acquire_leader_lock(uint32_t delay_factor) {
 
   schedule_timer_task("acquire leader lock",
                       delay_factor *
-                        m_cct->_conf.get_val<int64_t>("rbd_mirror_leader_max_missed_heartbeats"),
+                        m_cct->_conf.get_val<uint64_t>("rbd_mirror_leader_max_missed_heartbeats"),
                       false, &LeaderWatcher<I>::acquire_leader_lock, false);
 }
 
index 8b37db0ee066129618be0095ed67d02872c3be08..54ee5dc82c3290c6fc99f0fbed05b443513f7db8 100644 (file)
@@ -214,7 +214,7 @@ private:
   LeaderLock *m_leader_lock;
   Context *m_on_finish = nullptr;
   Context *m_on_shut_down_finish = nullptr;
-  int m_acquire_attempts = 0;
+  uint64_t m_acquire_attempts = 0;
   int m_ret_val = 0;
   MirrorStatusWatcher<ImageCtxT> *m_status_watcher = nullptr;
   Instances<ImageCtxT> *m_instances = nullptr;
index fc6a114f42b7364c67af0f556bed47ae2386f54f..144386cb47a7be706cc6aad2bb60bd7812efaef3 100644 (file)
@@ -260,7 +260,7 @@ void Mirror::run()
     }
     m_cond.WaitInterval(
       m_lock,
-      utime_t(m_cct->_conf.get_val<int64_t>("rbd_mirror_pool_replayers_refresh_interval"), 0));
+      utime_t(m_cct->_conf.get_val<uint64_t>("rbd_mirror_pool_replayers_refresh_interval"), 0));
   }
 
   // stop all pool replayers in parallel
index ffd402684f7dfc9b4749519b4357bc3b98578f57..ca0a8b0f93aaf441518f794d5327bc62101a57db 100644 (file)
@@ -12,12 +12,12 @@ namespace mirror {
 template <typename I>
 Threads<I>::Threads(CephContext *cct) : timer_lock("Threads::timer_lock") {
   thread_pool = new ThreadPool(cct, "Journaler::thread_pool", "tp_journal",
-                               cct->_conf.get_val<int64_t>("rbd_op_threads"),
+                               cct->_conf.get_val<uint64_t>("rbd_op_threads"),
                                "rbd_op_threads");
   thread_pool->start();
 
   work_queue = new ContextWQ("Journaler::work_queue",
-                             cct->_conf.get_val<int64_t>("rbd_op_thread_timeout"),
+                             cct->_conf.get_val<uint64_t>("rbd_op_thread_timeout"),
                              thread_pool);
 
   timer = new SafeTimer(cct, timer_lock, true);
index cf08065617d897581b6f85a522d35b39bcebab60..6fababddb60e963300b405de7d486842112dd5e1 100644 (file)
@@ -356,7 +356,7 @@ bool Policy::can_shuffle_image(const std::string &global_image_id) {
   ceph_assert(m_map_lock.is_locked());
 
   CephContext *cct = reinterpret_cast<CephContext *>(m_ioctx.cct());
-  int migration_throttle = cct->_conf.get_val<int64_t>(
+  int migration_throttle = cct->_conf.get_val<uint64_t>(
     "rbd_mirror_image_policy_migration_throttle");
 
   auto it = m_image_states.find(global_image_id);