]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd/cache/pwl/ssd: make log entry pointers 64 bit (on-disk format change)
authorYin Congmin <congmin.yin@intel.com>
Wed, 30 Jun 2021 11:10:30 +0000 (19:10 +0800)
committerYin Congmin <congmin.yin@intel.com>
Tue, 2 Nov 2021 03:46:04 +0000 (11:46 +0800)
Fixes: https://tracker.ceph.com/issues/50675
Signed-off-by: Yin Congmin <congmin.yin@intel.com>
src/librbd/cache/pwl/AbstractWriteLog.cc
src/librbd/cache/pwl/AbstractWriteLog.h
src/librbd/cache/pwl/LogEntry.h
src/librbd/cache/pwl/Types.h
src/librbd/cache/pwl/ssd/WriteLog.cc

index 421d5dd8bc49ed5a0914ba57042afc31c39ff747..861469575e95d5e386f042c41a1557b5cb1cc9f5 100644 (file)
@@ -344,7 +344,7 @@ template <typename I>
 void AbstractWriteLog<I>::update_entries(std::shared_ptr<GenericLogEntry> *log_entry,
     WriteLogCacheEntry *cache_entry, std::map<uint64_t, bool> &missing_sync_points,
     std::map<uint64_t, std::shared_ptr<SyncPointLogEntry>> &sync_point_entries,
-    int entry_index) {
+    uint64_t entry_index) {
     bool writer = cache_entry->is_writer();
     if (cache_entry->is_sync_point()) {
       ldout(m_image_ctx.cct, 20) << "Entry " << entry_index
index 128c00d99d82a2217b3aff210e63cc4482dcc860..83cbc11d4ed7fdb54ea896ad45ee07f7065bd4af 100644 (file)
@@ -336,7 +336,7 @@ protected:
       std::map<uint64_t, bool> &missing_sync_points,
       std::map<uint64_t,
       std::shared_ptr<pwl::SyncPointLogEntry>> &sync_point_entries,
-      int entry_index);
+      uint64_t entry_index);
   void update_sync_points(
       std::map<uint64_t, bool> &missing_sync_points,
       std::map<uint64_t,
index 766b5500767f616c2d9ca85a6fb119b8d672a3b1..a5889a13bc79d9463d2e5918d1c27707215fcd8b 100644 (file)
@@ -25,7 +25,7 @@ class GenericLogEntry {
 public:
   WriteLogCacheEntry ram_entry;
   WriteLogCacheEntry *cache_entry = nullptr;
-  uint32_t log_entry_index = 0;
+  uint64_t log_entry_index = 0;
   bool completed = false;
   GenericLogEntry(uint64_t image_offset_bytes = 0, uint64_t write_bytes = 0)
     : ram_entry(image_offset_bytes, write_bytes) {
index 3a68e48924aa30928f210f7939f58fc29346f62d..ce6f6ab9da87019031075ee37e7e1e841ba5244a 100644 (file)
@@ -297,8 +297,8 @@ struct WriteLogPoolRoot {
                                   * sync gen number are flushed. */
   uint32_t block_size;           /* block size */
   uint32_t num_log_entries;
-  uint32_t first_free_entry;     /* Entry following the newest valid entry */
-  uint32_t first_valid_entry;    /* Index of the oldest valid entry in the log */
+  uint64_t first_free_entry;     /* Entry following the newest valid entry */
+  uint64_t first_valid_entry;    /* Index of the oldest valid entry in the log */
 
   #ifdef WITH_RBD_SSD_CACHE
   DENC(WriteLogPoolRoot, v, p) {
index 9d887227e96d677d897a6e6aa26ec9c734a68155..6a30c6f422c3013aabb85d420cdbae17cf357627 100644 (file)
@@ -659,8 +659,8 @@ template <typename I>
 bool WriteLog<I>::retire_entries(const unsigned long int frees_per_tx) {
   CephContext *cct = m_image_ctx.cct;
   GenericLogEntriesVector retiring_entries;
-  uint32_t initial_first_valid_entry;
-  uint32_t first_valid_entry;
+  uint64_t initial_first_valid_entry;
+  uint64_t first_valid_entry;
 
   std::lock_guard retire_locker(this->m_log_retire_lock);
   ldout(cct, 20) << "Look for entries to retire" << dendl;