]> git-server-git.apps.pok.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)
committerDeepika Upadhyay <dupadhya@redhat.com>
Sat, 13 Nov 2021 11:59:40 +0000 (17:29 +0530)
Fixes: https://tracker.ceph.com/issues/50675
Signed-off-by: Yin Congmin <congmin.yin@intel.com>
(cherry picked from commit c091ec3471973f41717b237d500b8e4374af660f)

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 5d63920ce18b1b155c4b6141213f7fef208e6593..1352884932e8b5ee925264a6940617968689ce2f 100644 (file)
@@ -343,7 +343,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 887d77010bb45605d94e37da103ae86d9acebadc..864f1e8e6313b0e89237cc736bd6094466dd9300 100644 (file)
@@ -338,7 +338,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 d73eb19cea36b9d44278d8dc8a8fb46006498ce9..1d6c169b53b5a8b2b96a3136fc3090cf9b099361 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 09bbc66d1ca4bbc5ab627817863ba084a23a66c7..9541827bf2630631f2d06eedfb9dc08b49caa562 100644 (file)
@@ -660,8 +660,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;