]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/options: switch some rbd settings to TYPE_SIZE
authorKefu Chai <kchai@redhat.com>
Tue, 13 Feb 2018 08:03:58 +0000 (16:03 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 9 Mar 2018 05:01:05 +0000 (13:01 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/options.cc
src/librbd/ImageCtx.cc
src/tools/rbd_mirror/image_replayer/PrepareRemoteImageRequest.cc

index 40d9aef7785bd122766352dbcb9733c1bcf38625..397eb64e0b1f15188ec3907f204b55bb7269c3ea 100644 (file)
@@ -6054,15 +6054,15 @@ static std::vector<Option> get_rbd_options() {
                      "flush is called, to be sure the user of librbd will send "
                      "flushes so that writeback is safe"),
 
-    Option("rbd_cache_size", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_cache_size", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(32_M)
     .set_description("cache size in bytes"),
 
-    Option("rbd_cache_max_dirty", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_cache_max_dirty", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(24_M)
     .set_description("dirty limit in bytes - set to 0 for write-through caching"),
 
-    Option("rbd_cache_target_dirty", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_cache_target_dirty", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(16_M)
     .set_description("target dirty limit in bytes"),
 
@@ -6099,7 +6099,7 @@ static std::vector<Option> get_rbd_options() {
     .set_default(false)
     .set_description("localize parent requests to closest OSD"),
 
-    Option("rbd_sparse_read_threshold_bytes", Option::TYPE_UINT,
+    Option("rbd_sparse_read_threshold_bytes", Option::TYPE_SIZE,
            Option::LEVEL_ADVANCED)
     .set_default(64_K)
     .set_description("threshold for issuing a sparse-read")
@@ -6115,11 +6115,11 @@ static std::vector<Option> get_rbd_options() {
     .set_default(10)
     .set_description("number of sequential requests necessary to trigger readahead"),
 
-    Option("rbd_readahead_max_bytes", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_readahead_max_bytes", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(512_K)
     .set_description("set to 0 to disable readahead"),
 
-    Option("rbd_readahead_disable_after_bytes", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_readahead_disable_after_bytes", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(50_M)
     .set_description("how many bytes are read in total before readahead is disabled"),
 
@@ -6232,7 +6232,7 @@ static std::vector<Option> get_rbd_options() {
     .set_default(0)
     .set_description("maximum number of pending commits per journal object"),
 
-    Option("rbd_journal_object_flush_bytes", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rbd_journal_object_flush_bytes", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(0)
     .set_description("maximum number of pending bytes per journal object"),
 
@@ -6244,7 +6244,7 @@ static std::vector<Option> get_rbd_options() {
     .set_default("")
     .set_description("pool for journal objects"),
 
-    Option("rbd_journal_max_payload_bytes", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+    Option("rbd_journal_max_payload_bytes", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(16384)
     .set_description("maximum journal payload size before splitting"),
 
@@ -6268,7 +6268,7 @@ static std::vector<Option> get_rbd_mirror_options() {
     .set_default(5)
     .set_description("maximum age (in seconds) between successive journal polls"),
 
-    Option("rbd_mirror_journal_max_fetch_bytes", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+    Option("rbd_mirror_journal_max_fetch_bytes", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(32768)
     .set_description("maximum bytes to read from each journal data object per fetch"),
 
index 05133636090e76fef6d0221e11689fdb0a4ffaea..dd42dce459217f1211e893ac282e964c1e3fb810 100644 (file)
@@ -1069,9 +1069,9 @@ struct C_InvalidateCache : public Context {
     ASSIGN_OPTION(non_blocking_aio, bool);
     ASSIGN_OPTION(cache, bool);
     ASSIGN_OPTION(cache_writethrough_until_flush, bool);
-    ASSIGN_OPTION(cache_size, int64_t);
-    ASSIGN_OPTION(cache_max_dirty, int64_t);
-    ASSIGN_OPTION(cache_target_dirty, int64_t);
+    ASSIGN_OPTION(cache_size, Option::size_t);
+    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_block_writes_upfront, bool);
@@ -1080,10 +1080,10 @@ struct C_InvalidateCache : public Context {
     ASSIGN_OPTION(localize_snap_reads, bool);
     ASSIGN_OPTION(balance_parent_reads, bool);
     ASSIGN_OPTION(localize_parent_reads, bool);
-    ASSIGN_OPTION(sparse_read_threshold_bytes, uint64_t);
+    ASSIGN_OPTION(sparse_read_threshold_bytes, Option::size_t);
     ASSIGN_OPTION(readahead_trigger_requests, int64_t);
-    ASSIGN_OPTION(readahead_max_bytes, int64_t);
-    ASSIGN_OPTION(readahead_disable_after_bytes, int64_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);
@@ -1093,9 +1093,9 @@ struct C_InvalidateCache : public Context {
     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_bytes, int64_t);
+    ASSIGN_OPTION(journal_object_flush_bytes, Option::size_t);
     ASSIGN_OPTION(journal_object_flush_age, double);
-    ASSIGN_OPTION(journal_max_payload_bytes, uint64_t);
+    ASSIGN_OPTION(journal_max_payload_bytes, Option::size_t);
     ASSIGN_OPTION(journal_max_concurrent_object_sets, int64_t);
     ASSIGN_OPTION(mirroring_resync_after_disconnect, bool);
     ASSIGN_OPTION(mirroring_delete_delay, uint64_t);
index 30688c11edef867c7a29488f731955a016aacc63..036a0da9ad67f6ea4a793b7fc8e3999be1465032 100644 (file)
@@ -107,7 +107,7 @@ void PrepareRemoteImageRequest<I>::get_client() {
   journal::Settings settings;
   settings.commit_interval = g_ceph_context->_conf->get_val<double>(
     "rbd_mirror_journal_commit_age");
-  settings.max_fetch_bytes = g_ceph_context->_conf->get_val<uint64_t>(
+  settings.max_fetch_bytes = g_ceph_context->_conf->get_val<Option::size_t>(
     "rbd_mirror_journal_max_fetch_bytes");
 
   assert(*m_remote_journaler == nullptr);