]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore: move journal_type_t to seastore_types.h with shorter names
authorYingxin Cheng <yingxin.cheng@intel.com>
Fri, 19 Aug 2022 07:05:26 +0000 (15:05 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Wed, 24 Aug 2022 01:54:57 +0000 (09:54 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/os/seastore/journal.h
src/crimson/os/seastore/journal/circular_bounded_journal.h
src/crimson/os/seastore/journal/segmented_journal.h
src/crimson/os/seastore/seastore_types.h
src/test/crimson/seastore/test_transaction_manager.cc
src/test/crimson/seastore/transaction_manager_test_state.h

index 1500649428ed1b1261279046e7e23669819b1a64..18c0797a8b8b80d13c8d56a6167080e95ccc3988 100644 (file)
@@ -19,11 +19,6 @@ class SegmentManagerGroup;
 class SegmentProvider;
 class JournalTrimmer;
 
-enum class journal_type_t {
-  SEGMENT_JOURNAL = 0,
-  CIRCULARBOUNDED_JOURNAL
-};
-
 class Journal {
 public:
   virtual JournalTrimmer &get_trimmer() = 0;
index 9be8eb0f508adc98bc0a2479b0209a134d4f6307..3c777883b742d39812e6a8ff9543544555aaabdb 100644 (file)
@@ -91,7 +91,7 @@ public:
   close_ertr::future<> close() final;
 
   journal_type_t get_type() final {
-    return journal_type_t::CIRCULARBOUNDED_JOURNAL;
+    return journal_type_t::CIRCULAR;
   }
 
   submit_record_ret submit_record(
index 2ac1f2bcce2de52d6460256e68573905fcf27fbc..dbeede8944e382b6448577715db29ac30fd7d351 100644 (file)
@@ -52,7 +52,7 @@ public:
   }
 
   journal_type_t get_type() final {
-    return journal_type_t::SEGMENT_JOURNAL;
+    return journal_type_t::SEGMENTED;
   }
   seastar::future<> finish_commit(transaction_type_t type) {
     return seastar::now();
index 250c791a491412a9a1a2eac8252f6779716c742d..3f8c0ce16a589f9e5c81cd30d2f1bd7b33304372 100644 (file)
@@ -863,7 +863,13 @@ std::ostream& operator<<(std::ostream& out, device_type_t t);
 bool can_delay_allocation(device_type_t type);
 device_type_t string_to_device_type(std::string type);
 
-/* Monotonically increasing identifier for the location of a
+enum class journal_type_t {
+  SEGMENTED,
+  CIRCULAR
+};
+
+/**
+ * Monotonically increasing identifier for the location of a
  * journal_record.
  */
 // JOURNAL_SEQ_NULL == JOURNAL_SEQ_MAX == journal_seq_t{}
index d01f262af87221d6fa7e4aebd8a977360a173773..6b79835616f465e364a24ee7eb85f21a3ed04d01 100644 (file)
@@ -74,9 +74,9 @@ struct transaction_manager_test_t :
   seastar::future<> set_up_fut() final {
     std::string j_type = GetParam();
     if (j_type == "segmented") {
-      return tm_setup(journal_type_t::SEGMENT_JOURNAL);
+      return tm_setup(journal_type_t::SEGMENTED);
     } else if (j_type == "circularbounded") {
-      return tm_setup(journal_type_t::CIRCULARBOUNDED_JOURNAL);
+      return tm_setup(journal_type_t::CIRCULAR);
     } else {
       ceph_assert(0 == "no support");
     }
index 1a8a310afec92c63f270d87f231089219c7d1073..3c9761a8e4baa04e18b469f410f2c026eb800c7c 100644 (file)
@@ -128,15 +128,15 @@ protected:
   }
 
   seastar::future<> tm_setup(
-    journal_type_t type = journal_type_t::SEGMENT_JOURNAL) {
+    journal_type_t type = journal_type_t::SEGMENTED) {
     LOG_PREFIX(EphemeralTestState::tm_setup);
     SUBINFO(test, "begin with {} devices ...", get_num_devices());
     journal_type = type;
     // FIXME: should not initialize segment_manager with circularbounded-journal
-    if (journal_type == journal_type_t::SEGMENT_JOURNAL) {
+    if (journal_type == journal_type_t::SEGMENTED) {
       return segment_setup();
     } else {
-      assert(journal_type == journal_type_t::CIRCULARBOUNDED_JOURNAL);
+      assert(journal_type == journal_type_t::CIRCULAR);
       return randomblock_setup();
     }
   }
@@ -172,7 +172,7 @@ protected:
     for (auto &sec_sm : secondary_segment_managers) {
       sec_devices.emplace_back(sec_sm.get());
     }
-    if (journal_type == journal_type_t::CIRCULARBOUNDED_JOURNAL) {
+    if (journal_type == journal_type_t::CIRCULAR) {
       // FIXME: should not initialize segment_manager with circularbounded-journal
       // FIXME: no secondary device in the single device test
       sec_devices.emplace_back(segment_manager.get());
@@ -213,7 +213,7 @@ protected:
   }
 
   virtual FuturizedStore::mkfs_ertr::future<> _mkfs() {
-    if (journal_type == journal_type_t::SEGMENT_JOURNAL) {
+    if (journal_type == journal_type_t::SEGMENTED) {
       return tm->mkfs(
       ).handle_error(
        crimson::ct_error::assert_all{"Error in mkfs"}