]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: refactoring scrub: minor cleanups (mostly removing trailing whitespace)
authorRonen Friedman <rfriedma@redhat.com>
Sun, 15 Nov 2020 17:08:36 +0000 (19:08 +0200)
committerRonen Friedman <rfriedma@redhat.com>
Thu, 10 Dec 2020 13:21:53 +0000 (15:21 +0200)
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/osd/OSD.cc
src/osd/OSD.h
src/osd/PG.cc
src/osd/PrimaryLogPG.cc
src/osd/PrimaryLogPG.h

index db0d9eb23f8bc3bd2ecaf67f37b13b965570cdf6..d0d1f8a6097c272a67c9588f9d4531a30af4826a 100644 (file)
@@ -2020,12 +2020,11 @@ void OSDService::_queue_for_recovery(
 #define dout_prefix *_dout
 
 // Commands shared between OSD's console and admin console:
-namespace ceph { 
-namespace osd_cmds { 
+namespace ceph::osd_cmds {
 
 int heap(CephContext& cct, const cmdmap_t& cmdmap, Formatter& f, std::ostream& os);
-}} // namespace ceph::osd_cmds
+
+} // namespace ceph::osd_cmds
 
 int OSD::mkfs(CephContext *cct, ObjectStore *store, uuid_d fsid, int whoami, string osdspec_affinity)
 {
@@ -2282,8 +2281,8 @@ OSD::OSD(CephContext *cct_, ObjectStore *store_,
 {
 
   if (!gss_ktfile_client.empty()) {
-    // Assert we can export environment variable 
-    /* 
+    // Assert we can export environment variable
+    /*
         The default client keytab is used, if it is present and readable,
         to automatically obtain initial credentials for GSSAPI client
         applications. The principal name of the first entry in the client
@@ -2292,7 +2291,7 @@ OSD::OSD(CephContext *cct_, ObjectStore *store_,
         2. The default_client_keytab_name profile variable in [libdefaults].
         3. The hardcoded default, DEFCKTNAME.
     */
-    const int32_t set_result(setenv("KRB5_CLIENT_KTNAME", 
+    const int32_t set_result(setenv("KRB5_CLIENT_KTNAME",
                                     gss_ktfile_client.c_str(), 1));
     ceph_assert(set_result == 0);
   }
@@ -2755,7 +2754,7 @@ will start to track new ops received afterwards.";
     store->compact();
     auto end = ceph::coarse_mono_clock::now();
     double duration = std::chrono::duration<double>(end-start).count();
-    dout(1) << "finished manual compaction in " 
+    dout(1) << "finished manual compaction in "
             << duration
             << " seconds" << dendl;
     f->open_object_section("compact_result");
@@ -6758,7 +6757,7 @@ void OSD::got_full_map(epoch_t e)
     requested_full_first = requested_full_last = 0;
     return;
   }
-  
+
   requested_full_first = e + 1;
 
   dout(10) << __func__ << " " << e << ", requested " << requested_full_first
@@ -7197,7 +7196,7 @@ void OSD::ms_fast_dispatch(Message *m)
       service.release_map(nextmap);
     }
   }
-  OID_EVENT_TRACE_WITH_MSG(m, "MS_FAST_DISPATCH_END", false); 
+  OID_EVENT_TRACE_WITH_MSG(m, "MS_FAST_DISPATCH_END", false);
 }
 
 int OSD::ms_handle_authentication(Connection *con)
@@ -7521,14 +7520,14 @@ bool OSD::scrub_time_permit(utime_t now)
       time_permit = true;
     }
   }
-  if (!time_permit) {
+  if (time_permit) {
     dout(20) << __func__ << " should run between " << cct->_conf->osd_scrub_begin_hour
             << " - " << cct->_conf->osd_scrub_end_hour
-            << " now " << bdt.tm_hour << " = no" << dendl;
+            << " now " << bdt.tm_hour << " = yes" << dendl;
   } else {
     dout(20) << __func__ << " should run between " << cct->_conf->osd_scrub_begin_hour
             << " - " << cct->_conf->osd_scrub_end_hour
-            << " now " << bdt.tm_hour << " = yes" << dendl;
+            << " now " << bdt.tm_hour << " = no" << dendl;
   }
   return time_permit;
 }
@@ -7597,7 +7596,7 @@ void OSD::sched_scrub()
   OSDService::ScrubJob scrub_job;
   if (service.first_scrub_stamp(&scrub_job)) {
     do {
-      dout(30) << "sched_scrub examine " << scrub.pgid << " at " << scrub.sched_time << dendl;
+      dout(30) << "sched_scrub examine " << scrub_job.pgid << " at " << scrub_job.sched_time << dendl;
 
       if (scrub_job.sched_time > now) {
        // save ourselves some effort
@@ -8404,7 +8403,7 @@ void OSD::_committed_osd_maps(epoch_t first, epoch_t last, MOSDMap *m)
        set<int> avoid_ports;
 #if defined(__FreeBSD__)
         // prevent FreeBSD from grabbing the client_messenger port during
-        // rebinding. In which case a cluster_meesneger will connect also 
+        // rebinding. In which case a cluster_meesneger will connect also
        // to the same port
        client_messenger->get_myaddrs().get_ports(&avoid_ports);
 #endif
@@ -9628,7 +9627,7 @@ void OSD::do_recovery(
       // This is true for the first recovery op and when the previous recovery op
       // has been scheduled in the past. The next recovery op is scheduled after
       // completing the sleep from now.
-      
+
       if (auto now = ceph::real_clock::now();
          service.recovery_schedule_time < now) {
         service.recovery_schedule_time = now;
@@ -9658,7 +9657,7 @@ void OSD::do_recovery(
 #endif
 
     bool do_unfound = pg->start_recovery_ops(reserved_pushes, handle, &started);
-    dout(10) << "do_recovery started " << started << "/" << reserved_pushes 
+    dout(10) << "do_recovery started " << started << "/" << reserved_pushes
             << " on " << *pg << dendl;
 
     if (do_unfound) {
@@ -10058,7 +10057,7 @@ void OSD::check_config()
                 << cct->_conf->osd_pg_epoch_persisted_max_stale << ")";
   }
   if (cct->_conf->osd_object_clean_region_max_num_intervals < 0) {
-    clog->warn() << "osd_object_clean_region_max_num_intervals (" 
+    clog->warn() << "osd_object_clean_region_max_num_intervals ("
                  << cct->_conf->osd_object_clean_region_max_num_intervals
                 << ") is < 0";
   }
@@ -10958,8 +10957,7 @@ void OSD::ShardedOpWQ::_enqueue_front(OpSchedulerItem&& item)
   sdata->sdata_cond.notify_one();
 }
 
-namespace ceph { 
-namespace osd_cmds { 
+namespace ceph::osd_cmds {
 
 int heap(CephContext& cct, const cmdmap_t& cmdmap, Formatter& f,
         std::ostream& os)
@@ -10968,13 +10966,13 @@ int heap(CephContext& cct, const cmdmap_t& cmdmap, Formatter& f,
         os << "could not issue heap profiler command -- not using tcmalloc!";
         return -EOPNOTSUPP;
   }
-  
+
   string cmd;
   if (!cmd_getval(cmdmap, "heapcmd", cmd)) {
         os << "unable to get value for command \"" << cmd << "\"";
        return -EINVAL;
   }
-  
+
   std::vector<std::string> cmd_vec;
   get_str_vec(cmd, cmd_vec);
 
@@ -10982,10 +10980,10 @@ int heap(CephContext& cct, const cmdmap_t& cmdmap, Formatter& f,
   if (cmd_getval(cmdmap, "value", val)) {
     cmd_vec.push_back(val);
   }
-  
+
   ceph_heap_profiler_handle_command(cmd_vec, os);
-  
+
   return 0;
 }
-}} // namespace ceph::osd_cmds
+
+} // namespace ceph::osd_cmds
index aab81286fdb94e7030812c78d318eff4e4a9f4c1..b64e35c7075798980c14258e71b420d7046ec83b 100644 (file)
@@ -682,7 +682,7 @@ public:
   }
 
   unsigned get_target_pg_log_entries() const;
-  
+
   // delayed pg activation
   void queue_for_recovery(PG *pg) {
     std::lock_guard l(recovery_lock);
@@ -742,7 +742,7 @@ public:
   void need_heartbeat_peer_update();
 
   void init();
-  void final_init();  
+  void final_init();
   void start_shutdown();
   void shutdown_reserver();
   void shutdown();
@@ -1153,7 +1153,7 @@ protected:
 
 public:
   int get_nodeid() { return whoami; }
-  
+
   static ghobject_t get_osdmap_pobject_name(epoch_t epoch) {
     char foo[20];
     snprintf(foo, sizeof(foo), "osdmap.%d", epoch);
@@ -1185,7 +1185,7 @@ public:
     getline(ss, s);
     return ghobject_t(hobject_t(sobject_t(object_t(s.c_str()), 0)));
   }
-  
+
   static ghobject_t make_pg_biginfo_oid(spg_t pg) {
     std::stringstream ss;
     ss << "pginfo_" << pg;
@@ -1233,7 +1233,7 @@ public:
    * Return value: CompatSet of all supported features
    */
   static CompatSet get_osd_compat_set();
-  
+
 
 private:
   class C_Tick;
@@ -1457,7 +1457,7 @@ private:
   std::map<int, int> debug_heartbeat_drops_remaining;
   ceph::condition_variable heartbeat_cond;
   bool heartbeat_stop;
-  std::atomic<bool> heartbeat_need_update;   
+  std::atomic<bool> heartbeat_need_update;
   std::map<int,HeartbeatInfo> heartbeat_peers;  ///< map of osd id to HeartbeatInfo
   utime_t last_mon_heartbeat;
   Messenger *hb_front_client_messenger;
@@ -1543,13 +1543,13 @@ public:
 private:
   // -- waiters --
   std::list<OpRequestRef> finished;
-  
+
   void take_waiters(std::list<OpRequestRef>& ls) {
     ceph_assert(ceph_mutex_is_locked(osd_lock));
     finished.splice(finished.end(), ls);
   }
   void do_waiters();
-  
+
   // -- op tracking --
   OpTracker op_tracker;
   void test_ops(std::string command, std::string args, std::ostream& ss);
@@ -1839,7 +1839,7 @@ protected:
   bool _is_healthy();
 
   void send_full_update();
-  
+
   friend struct CB_OSD_GetVersion;
 
   // -- alive --
@@ -2065,7 +2065,7 @@ public:
                       uuid_d *osd_fsid,
                       int *whoami,
                       ceph_release_t *min_osd_release);
-  
+
 
   // startup/shutdown
   int pre_init();
index 724d896b727b979f43ef98812428c8c256bef42c..c06187b3106e9fde9b85132d8c7d30a730193244 100644 (file)
  */
 
 #include "PG.h"
-// #include "msg/Messenger.h"
 #include "messages/MOSDRepScrub.h"
-// #include "common/cmdparse.h"
-// #include "common/ceph_context.h"
 
 #include "common/errno.h"
 #include "common/ceph_releases.h"
@@ -33,7 +30,6 @@
 
 #include "messages/MOSDOp.h"
 #include "messages/MOSDPGNotify.h"
-// #include "messages/MOSDPGLog.h"
 #include "messages/MOSDPGInfo.h"
 #include "messages/MOSDPGScan.h"
 #include "messages/MOSDPGBackfill.h"
@@ -522,7 +518,7 @@ void PG::finish_recovery_op(const hobject_t& soid, bool dequeue)
 {
   dout(10) << "finish_recovery_op " << soid
 #ifdef DEBUG_RECOVERY_OIDS
-          << " (" << recovering_oids << ")" 
+          << " (" << recovering_oids << ")"
 #endif
           << dendl;
   ceph_assert(recovery_ops_active > 0);
@@ -724,7 +720,7 @@ void PG::rm_backoff(const ceph::ref_t<Backoff>& b)
   }
 }
 
-void PG::clear_recovery_state() 
+void PG::clear_recovery_state()
 {
   dout(10) << "clear_recovery_state" << dendl;
 
@@ -1164,16 +1160,14 @@ void PG::update_snap_map(
   const vector<pg_log_entry_t> &log_entries,
   ObjectStore::Transaction &t)
 {
-  for (vector<pg_log_entry_t>::const_iterator i = log_entries.begin();
-       i != log_entries.end();
-       ++i) {
+  for (auto i = log_entries.cbegin(); i != log_entries.cend(); ++i) {
     OSDriver::OSTransaction _t(osdriver.get_transaction(&t));
     if (i->soid.snap < CEPH_MAXSNAP) {
       if (i->is_delete()) {
        int r = snap_mapper.remove_oid(
          i->soid,
          &_t);
-       if (r != 0)
+       if (r)
          derr << __func__ << " remove_oid " << i->soid << " failed with " << r << dendl;
         // On removal tolerate missing key corruption
         ceph_assert(r == 0 || r == -ENOENT);
@@ -2257,7 +2251,6 @@ void PG::start_flush_on_transaction(ObjectStore::Transaction &t)
 
 bool PG::try_flush_or_schedule_async()
 {
-  
   Context *c = new QueuePeeringEvt(
     this, get_osdmap_epoch(), PeeringState::IntervalFlush());
   if (!ch->flush_commit(c)) {
@@ -2318,8 +2311,6 @@ ostream& operator<<(ostream& out, const PG& pg)
   }
 
   out << "]";
-
-
   return out;
 }
 
index edba0886707d5dc1d6326f850b09558fd4d2af48..e8038a6e955142d434d8856d81720293f09751ef 100644 (file)
@@ -1467,7 +1467,7 @@ void PrimaryLogPG::do_pg_op(OpRequestRef op)
          if (candidate >= next) {
            break;
          }
-           
+
          if (response.entries.size() == list_size) {
            next = candidate;
            break;
@@ -1985,7 +1985,7 @@ void PrimaryLogPG::do_op(OpRequestRef& op)
   // mds should have stopped writing before this point.
   // We can't allow OSD to become non-startable even if mds
   // could be writing as part of file removals.
-  if (write_ordered && osd->check_failsafe_full(get_dpp()) && 
+  if (write_ordered && osd->check_failsafe_full(get_dpp()) &&
       !m->has_flag(CEPH_OSD_FLAG_FULL_TRY)) {
     dout(10) << __func__ << " fail-safe full check failed, dropping request." << dendl;
     return;
@@ -2258,9 +2258,9 @@ void PrimaryLogPG::do_op(OpRequestRef& op)
   // make sure locator is consistent
   object_locator_t oloc(obc->obs.oi.soid);
   if (m->get_object_locator() != oloc) {
-    dout(10) << " provided locator " << m->get_object_locator() 
+    dout(10) << " provided locator " << m->get_object_locator()
             << " != object's " << obc->obs.oi.soid << dendl;
-    osd->clog->warn() << "bad locator " << m->get_object_locator() 
+    osd->clog->warn() << "bad locator " << m->get_object_locator()
                     << " on object " << oloc
                      << " op " << *m;
   }
@@ -2377,13 +2377,13 @@ PrimaryLogPG::cache_result_t PrimaryLogPG::maybe_handle_manifest_detail(
     OSDOp& osd_op = *p;
     ceph_osd_op& op = osd_op.op;
     if (op.op == CEPH_OSD_OP_SET_REDIRECT ||
-       op.op == CEPH_OSD_OP_SET_CHUNK || 
+       op.op == CEPH_OSD_OP_SET_CHUNK ||
        op.op == CEPH_OSD_OP_UNSET_MANIFEST ||
        op.op == CEPH_OSD_OP_TIER_PROMOTE ||
        op.op == CEPH_OSD_OP_TIER_FLUSH ||
        op.op == CEPH_OSD_OP_TIER_EVICT) {
       return cache_result_t::NOOP;
-    } 
+    }
   }
 
   switch (obc->obs.oi.manifest.type) {
@@ -2391,14 +2391,14 @@ PrimaryLogPG::cache_result_t PrimaryLogPG::maybe_handle_manifest_detail(
     if (op->may_write() || write_ordered) {
       do_proxy_write(op, obc);
     } else {
-      // promoted object 
+      // promoted object
       if (obc->obs.oi.size != 0) {
        return cache_result_t::NOOP;
       }
       do_proxy_read(op, obc);
     }
     return cache_result_t::HANDLED_PROXY;
-  case object_manifest_t::TYPE_CHUNKED: 
+  case object_manifest_t::TYPE_CHUNKED:
     {
       if (can_proxy_chunked_read(op, obc)) {
        map<hobject_t,FlushOpRef>::iterator p = flush_ops.find(obc->obs.oi.soid);
@@ -2429,7 +2429,7 @@ PrimaryLogPG::cache_result_t PrimaryLogPG::maybe_handle_manifest_detail(
       if (!check_laggy_requeue(op)) {
        return cache_result_t::BLOCKED_RECOVERY;
       }
-      
+
       for (auto& p : obc->obs.oi.manifest.chunk_map) {
        if (p.second.is_missing()) {
          auto m = op->get_req<MOSDOp>();
@@ -2592,7 +2592,7 @@ PrimaryLogPG::cache_result_t PrimaryLogPG::maybe_handle_cache_detail(
       do_proxy_write(op);
 
       // Promote too?
-      if (!op->need_skip_promote() && 
+      if (!op->need_skip_promote() &&
           maybe_promote(obc, missing_oid, oloc, in_hit_set,
                      pool.info.min_write_recency_for_promote,
                      OpRequestRef(),
@@ -2824,8 +2824,8 @@ struct C_ProxyChunkRead : public Context {
        prdop->ops[op_index].outdata.begin(copy_offset).copy_in(
           obj_op->ops[0].outdata.length(),
           obj_op->ops[0].outdata.c_str());
-      }        
-      
+      }
+
       pg->finish_proxy_read(oid, tid, r);
       pg->osd->logger->tinc(l_osd_tier_r_lat, ceph_clock_now() - start);
       if (obj_op) {
@@ -2847,7 +2847,7 @@ void PrimaryLogPG::do_proxy_read(OpRequestRef op, ObjectContextRef obc)
     switch (obc->obs.oi.manifest.type) {
       case object_manifest_t::TYPE_REDIRECT:
          oloc = object_locator_t(obc->obs.oi.manifest.redirect_target);
-         soid = obc->obs.oi.manifest.redirect_target;  
+         soid = obc->obs.oi.manifest.redirect_target;
          break;
       default:
        ceph_abort_msg("unrecognized manifest type");
@@ -3059,7 +3059,7 @@ void PrimaryLogPG::do_proxy_write(OpRequestRef op, ObjectContextRef obc)
     switch (obc->obs.oi.manifest.type) {
       case object_manifest_t::TYPE_REDIRECT:
          oloc = object_locator_t(obc->obs.oi.manifest.redirect_target);
-         soid = obc->obs.oi.manifest.redirect_target;  
+         soid = obc->obs.oi.manifest.redirect_target;
          break;
       default:
        ceph_abort_msg("unrecognized manifest type");
@@ -3101,7 +3101,7 @@ void PrimaryLogPG::do_proxy_write(OpRequestRef op, ObjectContextRef obc)
   in_progress_proxy_ops[soid].push_back(op);
 }
 
-void PrimaryLogPG::do_proxy_chunked_op(OpRequestRef op, const hobject_t& missing_oid, 
+void PrimaryLogPG::do_proxy_chunked_op(OpRequestRef op, const hobject_t& missing_oid,
                                       ObjectContextRef obc, bool write_ordered)
 {
   MOSDOp *m = static_cast<MOSDOp*>(op->get_nonconst_req());
@@ -3118,21 +3118,21 @@ void PrimaryLogPG::do_proxy_chunked_op(OpRequestRef op, const hobject_t& missing
       chunk_index = 0;
       chunk_length = 0;
       /* find the right chunk position for cursor */
-      for (auto &p : manifest->chunk_map) {                                                                        
-       if (p.first <= cursor && p.first + p.second.length > cursor) {                                             
-         chunk_length = p.second.length;                                                                          
-         chunk_index = p.first;                                                                                   
+      for (auto &p : manifest->chunk_map) {
+       if (p.first <= cursor && p.first + p.second.length > cursor) {
+         chunk_length = p.second.length;
+         chunk_index = p.first;
          break;
        }
-      } 
+      }
       /* no index */
       if (!chunk_index && !chunk_length) {
        if (cursor == osd_op->op.extent.offset) {
-         OpContext *ctx = new OpContext(op, m->get_reqid(), &m->ops, this);                                        
+         OpContext *ctx = new OpContext(op, m->get_reqid(), &m->ops, this);
          ctx->reply = new MOSDOpReply(m, 0, get_osdmap_epoch(), 0, false);
-         ctx->data_off = osd_op->op.extent.offset;                                                                
-         ctx->ignore_log_op_stats = true;                                                                         
-         complete_read_ctx(0, ctx);                                                                               
+         ctx->data_off = osd_op->op.extent.offset;
+         ctx->ignore_log_op_stats = true;
+         complete_read_ctx(0, ctx);
        }
        break;
       }
@@ -3144,9 +3144,9 @@ void PrimaryLogPG::do_proxy_chunked_op(OpRequestRef op, const hobject_t& missing
       }
       /* the size to read -> |   op length   | */
       /*                    |   a chunk | */
-      if (cursor + next_length > chunk_index + chunk_length) {                                                  
-       next_length = chunk_index + chunk_length - cursor;                                                      
-      } 
+      if (cursor + next_length > chunk_index + chunk_length) {
+       next_length = chunk_index + chunk_length - cursor;
+      }
 
       chunk_read[cursor] = {{chunk_index, next_length}};
       cursor += next_length;
@@ -3155,12 +3155,12 @@ void PrimaryLogPG::do_proxy_chunked_op(OpRequestRef op, const hobject_t& missing
     req_len = cursor - osd_op->op.extent.offset;
     for (auto &p : chunk_read) {
       auto chunks = p.second.begin();
-      dout(20) << __func__ << " chunk_index: " << chunks->first 
-             << " next_length: " << chunks->second << " cursor: " 
+      dout(20) << __func__ << " chunk_index: " << chunks->first
+             << " next_length: " << chunks->second << " cursor: "
              << p.first << dendl;
       do_proxy_chunked_read(op, obc, i, chunks->first, p.first, chunks->second, req_len, write_ordered);
     }
-  } 
+  }
 }
 
 struct RefCountCallback : public Context {
@@ -3168,7 +3168,7 @@ public:
   PrimaryLogPG::OpContext *ctx;
   OSDOp& osd_op;
   bool requeue = false;
-    
+
   RefCountCallback(PrimaryLogPG::OpContext *ctx, OSDOp &osd_op)
     : ctx(ctx), osd_op(osd_op) {}
   void finish(int r) override {
@@ -3274,7 +3274,7 @@ void PrimaryLogPG::cancel_manifest_ops(bool requeue, vector<ceph_tid_t> *tids)
 
 ObjectContextRef PrimaryLogPG::get_prev_clone_obc(ObjectContextRef obc)
 {
-  auto s = std::find(obc->ssc->snapset.clones.begin(), obc->ssc->snapset.clones.end(), 
+  auto s = std::find(obc->ssc->snapset.clones.begin(), obc->ssc->snapset.clones.end(),
                    obc->obs.oi.soid.snap);
   if (s != obc->ssc->snapset.clones.begin()) {
     auto s_iter = s - 1;
@@ -3323,7 +3323,7 @@ void PrimaryLogPG::get_adjacent_clones(ObjectContextRef src_obc,
 
   // We *must* find the clone iff it's not head,
   // let s == snapset.clones.end() mean head
-  ceph_assert((s == snapset.clones.end()) == oi.soid.is_head()); 
+  ceph_assert((s == snapset.clones.end()) == oi.soid.is_head());
 
   if (s != snapset.clones.begin()) {
     _l = get_context(s - 1);
@@ -3428,14 +3428,14 @@ void PrimaryLogPG::dec_all_refcount_manifest(const object_info_t& oi, OpContext*
          dec_refcount(soid, refs);
        });
     }
-  } else if (oi.manifest.is_redirect() && 
+  } else if (oi.manifest.is_redirect() &&
             oi.test_flag(object_info_t::FLAG_REDIRECT_HAS_REFERENCE)) {
     ctx->register_on_commit(
       [oi, this](){
        refcount_manifest(oi.soid, oi.manifest.redirect_target, 
                          refcount_t::DECREMENT_REF, NULL, std::nullopt);
       });
-  } 
+  }
 }
 
 ceph_tid_t PrimaryLogPG::refcount_manifest(hobject_t src_soid, hobject_t tgt_soid, refcount_t type,
@@ -3493,7 +3493,7 @@ void PrimaryLogPG::do_proxy_chunked_read(OpRequestRef op, ObjectContextRef obc,
   object_manifest_t *manifest = &obc->obs.oi.manifest;
   if (!manifest->chunk_map.count(chunk_index)) {
     return;
-  } 
+  }
   uint64_t chunk_length = manifest->chunk_map[chunk_index].length;
   hobject_t soid = manifest->chunk_map[chunk_index].oid;
   hobject_t ori_soid = m->get_hobj();
@@ -3502,7 +3502,7 @@ void PrimaryLogPG::do_proxy_chunked_read(OpRequestRef op, ObjectContextRef obc,
   if (write_ordered) {
     flags |= CEPH_OSD_FLAG_RWORDERED;
   }
-  
+
   if (!chunk_length || soid == hobject_t()) {
     return;
   }
@@ -3513,8 +3513,8 @@ void PrimaryLogPG::do_proxy_chunked_read(OpRequestRef op, ObjectContextRef obc,
                             CEPH_OSD_FLAG_ENFORCE_SNAPC |
                             CEPH_OSD_FLAG_MAP_SNAP_CLONE);
 
-  dout(10) << __func__ << " Start do chunk proxy read for " << *m 
-          << " index: " << op_index << " oid: " << soid.oid.name << " req_offset: " << req_offset 
+  dout(10) << __func__ << " Start do chunk proxy read for " << *m
+          << " index: " << op_index << " oid: " << soid.oid.name << " req_offset: " << req_offset
           << " req_length: " << req_length << dendl;
 
   ProxyReadOpRef prdop(std::make_shared<ProxyReadOp>(op, ori_soid, m->ops));
@@ -3526,8 +3526,8 @@ void PrimaryLogPG::do_proxy_chunked_read(OpRequestRef op, ObjectContextRef obc,
     osd_op.op.extent.offset = manifest->chunk_map[chunk_index].offset + req_offset - chunk_index;
   } else {
     ceph_abort_msg("chunk_index > req_offset");
-  } 
-  osd_op.op.extent.length = req_length; 
+  }
+  osd_op.op.extent.length = req_length;
 
   ObjectOperation obj_op;
   obj_op.dup(pobj_op->ops);
@@ -3562,7 +3562,7 @@ bool PrimaryLogPG::can_proxy_chunked_read(OpRequestRef op, ObjectContextRef obc)
     osd_op = &m->ops[i];
     ceph_osd_op op = osd_op->op;
     switch (op.op) {
-      case CEPH_OSD_OP_READ: 
+      case CEPH_OSD_OP_READ:
       case CEPH_OSD_OP_SYNC_READ: {
        uint64_t cursor = osd_op->op.extent.offset;
        uint64_t remain = osd_op->op.extent.length;
@@ -3575,14 +3575,14 @@ bool PrimaryLogPG::can_proxy_chunked_read(OpRequestRef op, ObjectContextRef obc)
            }
            if (p.second.length >= remain) {
              remain = 0;
-             break; 
+             break;
            } else {
              remain = remain - p.second.length;
            }
            cursor += p.second.length;
          }
        }
-       
+
        if (remain) {
          dout(20) << __func__ << " requested chunks don't exist in chunk_map " << dendl;
          return false;
@@ -3871,14 +3871,14 @@ void PrimaryLogPG::execute_ctx(OpContext *ctx)
     ctx->mtime = m->get_mtime();
 
     dout(10) << __func__ << " " << soid << " " << *ctx->ops
-            << " ov " << obc->obs.oi.version << " av " << ctx->at_version 
+            << " ov " << obc->obs.oi.version << " av " << ctx->at_version
             << " snapc " << ctx->snapc
             << " snapset " << obc->ssc->snapset
-            << dendl;  
+            << dendl;
   } else {
     dout(10) << __func__ << " " << soid << " " << *ctx->ops
             << " ov " << obc->obs.oi.version
-            << dendl;  
+            << dendl;
   }
 
   if (!ctx->user_at_version)
@@ -4400,7 +4400,7 @@ int PrimaryLogPG::trim_object(
   ctx->at_version = get_next_version();
 
   PGTransaction *t = ctx->op_t.get();
+
   if (new_snaps.empty()) {
     // remove clone
     dout(10) << coid << " snaps " << old_snaps << " -> "
@@ -4408,7 +4408,7 @@ int PrimaryLogPG::trim_object(
 
     // ...from snapset
     ceph_assert(p != snapset.clones.end());
-  
+
     snapid_t last = coid.snap;
     ctx->delta_stats.num_bytes -= snapset.get_clone_bytes(last);
 
@@ -4450,7 +4450,7 @@ int PrimaryLogPG::trim_object(
     snapset.clone_overlap.erase(last);
     snapset.clone_size.erase(last);
     snapset.clone_snaps.erase(last);
-       
+
     ctx->log.push_back(
       pg_log_entry_t(
        pg_log_entry_t::DELETE,
@@ -5730,7 +5730,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
     }
 
     switch (op.op) {
-      
+
       // --- READS ---
 
     case CEPH_OSD_OP_CMPEXT:
@@ -6070,7 +6070,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
        result = getattrs_maybe_cache(
          ctx->obc,
          &out);
-        
+
         bufferlist bl;
         encode(out, bl);
        ctx->delta_stats.num_rd_kb += shift_round_up(bl.length(), 10);
@@ -6078,7 +6078,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
         osd_op.outdata.claim_append(bl);
       }
       break;
-      
+
     case CEPH_OSD_OP_CMPXATTR:
       ++ctx->num_read;
       {
@@ -6087,7 +6087,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
        tracepoint(osd, do_osd_op_pre_cmpxattr, soid.oid.name.c_str(), soid.snap.val, aname.c_str());
        string name = "_" + aname;
        name[op.xattr.name_len + 1] = 0;
-       
+
        bufferlist xattr;
        result = getattr_maybe_cache(
          ctx->obc,
@@ -6095,7 +6095,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
          &xattr);
        if (result < 0 && result != -EEXIST && result != -ENODATA)
          break;
-       
+
        ctx->delta_stats.num_rd++;
        ctx->delta_stats.num_rd_kb += shift_round_up(xattr.length(), 10);
 
@@ -6257,7 +6257,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
         }
        if (result < 0) {
          break;
-       }         
+       }
         if (!ctx->obc->obs.oi.is_whiteout()) {
           ceph_assert(obs.exists);
           clone_info ci;
@@ -6461,7 +6461,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
        dout(10) << "clean_regions modified" << ctx->clean_regions << dendl;
       }
       break;
-      
+
     case CEPH_OSD_OP_WRITEFULL:
       ++ctx->num_write;
       result = 0;
@@ -6527,7 +6527,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
           static_cast<Option::size_t>(osd->osd_max_object_size), get_dpp());
        if (result < 0)
          break;
+
        ceph_assert(op.extent.length);
        if (obs.exists && !oi.is_whiteout()) {
          t->zero(soid, op.extent.offset, op.extent.length);
@@ -6628,7 +6628,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
        oi.clear_data_digest();
       }
       break;
-    
+
     case CEPH_OSD_OP_DELETE:
       ++ctx->num_write;
       result = 0;
@@ -6917,7 +6917,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
          result = -EINVAL;
          goto fail;
        }
-       
+
        if (!src_length) {
          result = -EINVAL;
          goto fail;
@@ -6974,14 +6974,14 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
            result = -EINPROGRESS;
            break;
          }
-       } 
+       }
        if (op_finisher) {
          result = op_finisher->execute();
          ceph_assert(result == 0);
        }
 
        oi.manifest.chunk_map[src_offset] = chunk_info;
-       if (!oi.has_manifest() && !oi.manifest.is_chunked()) 
+       if (!oi.has_manifest() && !oi.manifest.is_chunked())
          ctx->delta_stats.num_objects_manifest++;
        oi.set_flag(object_info_t::FLAG_MANIFEST);
        oi.manifest.type = object_manifest_t::TYPE_CHUNKED;
@@ -6991,7 +6991,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
        ctx->modify = true;
        ctx->cache_operation = true;
 
-       dout(10) << "set-chunked oid:" << oi.soid << " user_version: " << oi.user_version 
+       dout(10) << "set-chunked oid:" << oi.soid << " user_version: " << oi.user_version
                 << " chunk_info: " << chunk_info << dendl;
        if (op_finisher) {
          ctx->op_finishers.erase(ctx->current_osd_subop_num);
@@ -7110,7 +7110,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
          result = -EINVAL;
          break;
        }
-       
+
        // The chunks already has a reference, so it is just enough to invoke truncate if necessary
        uint64_t chunk_length = 0;
        for (auto p : obs.oi.manifest.chunk_map) {
@@ -7165,7 +7165,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
       break;
 
       // -- object attrs --
-      
+
     case CEPH_OSD_OP_SETXATTR:
       ++ctx->num_write;
       result = 0;
@@ -7211,7 +7211,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
        ctx->delta_stats.num_wr++;
       }
       break;
-    
+
 
       // -- fancy writers --
     case CEPH_OSD_OP_APPEND:
@@ -7486,7 +7486,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
          goto fail;
        }
        tracepoint(osd, do_osd_op_pre_omap_cmp, soid.oid.name.c_str(), soid.snap.val, list_keys(assertions).c_str());
-       
+
        map<string, bufferlist> out;
 
        if (oi.is_omap()) {
@@ -7991,14 +7991,14 @@ int PrimaryLogPG::_rollback_to(OpContext *ctx, ceph_osd_op& op)
   {
     ObjectContextRef promote_obc;
     cache_result_t tier_mode_result;
-    if (obs.exists && obs.oi.has_manifest()) { 
-      tier_mode_result = 
+    if (obs.exists && obs.oi.has_manifest()) {
+      tier_mode_result =
        maybe_handle_manifest_detail(
          ctx->op,
          true,
          rollback_to);
     } else {
-      tier_mode_result = 
+      tier_mode_result =
        maybe_handle_cache_detail(
          ctx->op,
          true,
@@ -8136,7 +8136,7 @@ void PrimaryLogPG::make_writeable(OpContext *ctx)
   ceph_assert(soid.snap == CEPH_NOSNAP);
   dout(20) << "make_writeable " << soid << " snapset=" << ctx->new_snapset
           << "  snapc=" << snapc << dendl;
-  
+
   bool was_dirty = ctx->obc->obs.oi.is_dirty();
   if (ctx->new_obs.exists) {
     // we will mark the object dirty
@@ -8184,7 +8184,7 @@ void PrimaryLogPG::make_writeable(OpContext *ctx)
     // clone
     hobject_t coid = soid;
     coid.snap = snapc.seq;
-    
+
     unsigned l;
     for (l = 1;
         l < snapc.snaps.size() && snapc.snaps[l] > ctx->new_snapset.seq;
@@ -8193,7 +8193,7 @@ void PrimaryLogPG::make_writeable(OpContext *ctx)
     vector<snapid_t> snaps(l);
     for (unsigned i=0; i<l; i++)
       snaps[i] = snapc.snaps[i];
-    
+
     // prepare clone
     object_info_t static_snap_oi(coid);
     object_info_t *snap_oi;
@@ -8209,7 +8209,7 @@ void PrimaryLogPG::make_writeable(OpContext *ctx)
        ctx->clone_obc->attr_cache = ctx->obc->attr_cache;
       snap_oi = &ctx->clone_obc->obs.oi;
       if (ctx->obc->obs.oi.has_manifest()) {
-       if ((ctx->obc->obs.oi.flags & object_info_t::FLAG_REDIRECT_HAS_REFERENCE) && 
+       if ((ctx->obc->obs.oi.flags & object_info_t::FLAG_REDIRECT_HAS_REFERENCE) &&
            ctx->obc->obs.oi.manifest.is_redirect()) {
          snap_oi->set_flag(object_info_t::FLAG_MANIFEST);
          snap_oi->manifest.type = object_manifest_t::TYPE_REDIRECT;
@@ -8236,7 +8236,7 @@ void PrimaryLogPG::make_writeable(OpContext *ctx)
     snap_oi->copy_user_bits(ctx->obs->oi);
 
     _make_clone(ctx, ctx->op_t.get(), ctx->clone_obc, soid, coid, snap_oi);
-    
+
     ctx->delta_stats.num_objects++;
     if (snap_oi->is_dirty()) {
       ctx->delta_stats.num_objects_dirty++;
@@ -8253,12 +8253,12 @@ void PrimaryLogPG::make_writeable(OpContext *ctx)
     ctx->new_snapset.clone_size[coid.snap] = ctx->obs->oi.size;
     ctx->new_snapset.clone_snaps[coid.snap] = snaps;
 
-    // clone_overlap should contain an entry for each clone 
+    // clone_overlap should contain an entry for each clone
     // (an empty interval_set if there is no overlap)
     ctx->new_snapset.clone_overlap[coid.snap];
     if (ctx->obs->oi.size)
       ctx->new_snapset.clone_overlap[coid.snap].insert(0, ctx->obs->oi.size);
-    
+
     // log clone
     dout(10) << " cloning v " << ctx->obs->oi.version
             << " to " << coid << " v " << ctx->at_version
@@ -8292,7 +8292,7 @@ void PrimaryLogPG::make_writeable(OpContext *ctx)
     }
     newest_overlap.subtract(ctx->modified_ranges);
   }
-  
+
   if (snapc.seq > ctx->new_snapset.seq) {
     // update snapset with latest snap context
     ctx->new_snapset.seq = snapc.seq;
@@ -8557,7 +8557,7 @@ void PrimaryLogPG::finish_ctx(OpContext *ctx, int log_op_type, int result)
     log_op_type != pg_log_entry_t::PROMOTE) {
     dec_refcount_by_dirty(ctx);
   }
-  
+
   // finish and log the op.
   if (ctx->user_modify) {
     // update the user_version for any modify ops, except for the watch op
@@ -8571,7 +8571,7 @@ void PrimaryLogPG::finish_ctx(OpContext *ctx, int log_op_type, int result)
     ctx->new_obs.oi.user_version = ctx->user_at_version;
   }
   ctx->bytes_written = ctx->op_t->get_bytes_written();
+
   if (ctx->new_obs.exists) {
     ctx->new_obs.oi.version = ctx->at_version;
     ctx->new_obs.oi.prior_version = ctx->obs->oi.version;
@@ -8680,7 +8680,7 @@ void PrimaryLogPG::complete_read_ctx(int result, OpContext *ctx)
   auto m = ctx->op->get_req<MOSDOp>();
   ceph_assert(ctx->async_reads_complete());
 
-  for (vector<OSDOp>::iterator p = ctx->ops->begin();
+  for (auto p = ctx->ops->begin();
     p != ctx->ops->end() && result >= 0; ++p) {
     if (p->rval < 0 && !(p->op.flags & CEPH_OSD_OP_FLAG_FAILOK)) {
       result = p->rval;
@@ -8774,7 +8774,7 @@ struct C_CopyChunk : public Context {
   C_CopyChunk(PrimaryLogPG *p, hobject_t o, epoch_t lpr,
             const PrimaryLogPG::CopyOpRef& c)
     : pg(p), oid(o), last_peering_reset(lpr),
-      tid(0), cop(c) 
+      tid(0), cop(c)
   {}
   void finish(int r) override {
     if (r == -ECANCELED)
@@ -9106,7 +9106,7 @@ void PrimaryLogPG::_copy_some_manifest(ObjectContextRef obc, CopyOpRef cop, uint
   int num_chunks = 0;
   uint64_t last_offset = 0, chunks_size = 0;
   object_manifest_t *manifest = &obc->obs.oi.manifest;
-  map<uint64_t, chunk_info_t>::iterator iter = manifest->chunk_map.find(start_offset); 
+  map<uint64_t, chunk_info_t>::iterator iter = manifest->chunk_map.find(start_offset);
   for (;iter != manifest->chunk_map.end(); ++iter) {
     num_chunks++;
     chunks_size += iter->second.length;
@@ -9120,7 +9120,7 @@ void PrimaryLogPG::_copy_some_manifest(ObjectContextRef obc, CopyOpRef cop, uint
   cop->start_offset = start_offset;
   cop->last_offset = last_offset;
   dout(20) << __func__ << " oid " << obc->obs.oi.soid << " num_chunks: " << num_chunks
-         << " start_offset: " << start_offset << " chunks_size: " << chunks_size 
+         << " start_offset: " << start_offset << " chunks_size: " << chunks_size
          << " last_offset: " << last_offset << dendl;
 
   iter = manifest->chunk_map.find(start_offset);
@@ -9168,9 +9168,9 @@ void PrimaryLogPG::_copy_some_manifest(ObjectContextRef obc, CopyOpRef cop, uint
     fin->tid = tid;
     sub_cop->objecter_tid = tid;
 
-    dout(20) << __func__ << " tgt_oid: " << soid.oid << " tgt_offset: " 
+    dout(20) << __func__ << " tgt_oid: " << soid.oid << " tgt_offset: "
            << manifest->chunk_map[iter->first].offset
-           << " length: " << length << " pool id: " << oloc.pool 
+           << " length: " << length << " pool id: " << oloc.pool
            << " tid: " << tid << dendl;
 
     if (last_offset < iter->first) {
@@ -9408,11 +9408,11 @@ void PrimaryLogPG::process_copy_chunk_manifest(hobject_t oid, ceph_tid_t tid, in
   if (r < 0) {
     obj_cop->failed = true;
     goto out;
-  }   
+  }
 
   if (obj_cop->failed) {
     return;
-  }                                                                                                                  
+  }
   if (!chunk_data.outdata.length()) {
     r = -EIO;
     obj_cop->failed = true;
@@ -9432,8 +9432,8 @@ void PrimaryLogPG::process_copy_chunk_manifest(hobject_t oid, ceph_tid_t tid, in
     if (!ctx->lock_manager.take_write_lock(
          obj_cop->obc->obs.oi.soid,
          obj_cop->obc)) {
-      // recovery op can take read lock. 
-      // so need to wait for recovery completion 
+      // recovery op can take read lock.
+      // so need to wait for recovery completion
       r = -EAGAIN;
       obj_cop->failed = true;
       close_op_ctx(ctx.release());
@@ -9450,16 +9450,16 @@ void PrimaryLogPG::process_copy_chunk_manifest(hobject_t oid, ceph_tid_t tid, in
              sub_chunk.outdata.length(),
              sub_chunk.outdata,
              p.second->dest_obj_fadvise_flags);
-      dout(20) << __func__ << " offset: " << p.second->cursor.data_offset 
+      dout(20) << __func__ << " offset: " << p.second->cursor.data_offset
              << " length: " << sub_chunk.outdata.length() << dendl;
       write_update_size_and_usage(ctx->delta_stats, obs.oi, ctx->modified_ranges,
                                  p.second->cursor.data_offset, sub_chunk.outdata.length());
-      obs.oi.manifest.chunk_map[p.second->cursor.data_offset].clear_flag(chunk_info_t::FLAG_MISSING); 
+      obs.oi.manifest.chunk_map[p.second->cursor.data_offset].clear_flag(chunk_info_t::FLAG_MISSING);
       ctx->clean_regions.mark_data_region_dirty(p.second->cursor.data_offset, sub_chunk.outdata.length());
       sub_chunk.outdata.clear();
     }
     obs.oi.clear_data_digest();
-    ctx->at_version = get_next_version(); 
+    ctx->at_version = get_next_version();
     finish_ctx(ctx.get(), pg_log_entry_t::PROMOTE);
     simple_opc_submit(std::move(ctx));
 
@@ -9916,7 +9916,7 @@ void PrimaryLogPG::finish_promote_manifest(int r, CopyResults *results,
     }
     return;
   }
-  
+
   osd->promote_finish(results->object_size);
   osd->logger->inc(l_osd_tier_promote);
 
@@ -10661,7 +10661,7 @@ int PrimaryLogPG::try_flush_mark_clean(FlushOpRef fop)
       ctx->new_obs.oi.clear_flag(object_info_t::FLAG_OMAP);
       ctx->clean_regions.mark_omap_dirty();
     }
-    if (obc->obs.oi.size == chunks_size) { 
+    if (obc->obs.oi.size == chunks_size) {
       t->truncate(oid, 0);
       interval_set<uint64_t> trim;
       trim.insert(0, ctx->new_obs.oi.size);
@@ -10676,7 +10676,7 @@ int PrimaryLogPG::try_flush_mark_clean(FlushOpRef fop)
       }
     } else {
       for (auto &p : ctx->new_obs.oi.manifest.chunk_map) {
-       dout(20) << __func__ << " offset: " << p.second.offset 
+       dout(20) << __func__ << " offset: " << p.second.offset
                << " length: " << p.second.length << dendl;
        p.second.clear_flag(chunk_info_t::FLAG_MISSING); // CLEAN
       }
@@ -10721,7 +10721,7 @@ void PrimaryLogPG::cancel_flush(FlushOpRef fop, bool requeue,
     for (auto &p : fop->io_tids) {
       tids->push_back(p.second);
       p.second = 0;
-    } 
+    }
   }
   if (fop->blocking && fop->obc->is_blocked()) {
     fop->obc->stop_block();
@@ -10829,7 +10829,7 @@ void PrimaryLogPG::eval_repop(RepGather *repop)
 
     dout(10) << " removing " << *repop << dendl;
     ceph_assert(!repop_queue.empty());
-    dout(20) << "   q front is " << *repop_queue.front() << dendl; 
+    dout(20) << "   q front is " << *repop_queue.front() << dendl;
     if (repop_queue.front() == repop) {
       RepGather *to_remove = nullptr;
       while (!repop_queue.empty() &&
@@ -10940,7 +10940,7 @@ boost::intrusive_ptr<PrimaryLogPG::RepGather> PrimaryLogPG::new_repop(
   dout(10) << __func__ << ": " << *repop << dendl;
   return boost::intrusive_ptr<RepGather>(repop);
 }
+
 void PrimaryLogPG::remove_repop(RepGather *repop)
 {
   dout(20) << __func__ << " " << *repop << dendl;
@@ -11271,7 +11271,7 @@ ObjectContextRef PrimaryLogPG::create_object_context(const object_info_t& oi,
 {
   ObjectContextRef obc(object_contexts.lookup_or_create(oi.soid));
   ceph_assert(obc->destructor_callback == NULL);
-  obc->destructor_callback = new C_PG_ObjectContext(this, obc.get());  
+  obc->destructor_callback = new C_PG_ObjectContext(this, obc.get());
   obc->obs.oi = oi;
   obc->obs.exists = false;
   obc->ssc = ssc;
@@ -11517,7 +11517,7 @@ int PrimaryLogPG::find_object_context(const hobject_t& oid,
 
   dout(10) << __func__ << " " << oid << " @" << oid.snap
           << " snapset " << ssc->snapset << dendl;
+
   // head?
   if (oid.snap > ssc->snapset.seq) {
     ObjectContextRef obc = get_object_context(head, false);
@@ -11771,7 +11771,7 @@ int PrimaryLogPG::recover_missing(
 {
   if (recovery_state.get_missing_loc().is_unfound(soid)) {
     dout(7) << __func__ << " " << soid
-           << " v " << v 
+           << " v " << v
            << " but it is unfound" << dendl;
     return PULL_NONE;
   }
@@ -12365,7 +12365,7 @@ void PrimaryLogPG::on_shutdown()
   apply_and_flush_repops(false);
   cancel_log_updates();
   // we must remove PGRefs, so do this this prior to release_backoffs() callers
-  clear_backoffs(); 
+  clear_backoffs();
   // clean up snap trim references
   snap_trimmer_machine.process_event(Reset());
 
@@ -12768,7 +12768,7 @@ bool PrimaryLogPG::start_recovery_ops(
   if (needs_recovery()) {
     // this shouldn't happen!
     // We already checked num_missing() so we must have missing replicas
-    osd->clog->error() << info.pgid 
+    osd->clog->error() << info.pgid
                        << " Unexpected Error: recovery ending with missing replicas";
     return false;
   }
@@ -12877,7 +12877,7 @@ uint64_t PrimaryLogPG::recover_primary(uint64_t max, ThreadPool::TPHandle &handl
        {
          if (item.have == latest->reverting_to) {
            ObjectContextRef obc = get_object_context(soid, true);
-           
+
            if (obc->obs.oi.version == latest->version) {
              // I'm already reverting
              dout(10) << " already reverting " << soid << dendl;
@@ -12945,7 +12945,7 @@ uint64_t PrimaryLogPG::recover_primary(uint64_t max, ThreadPool::TPHandle &handl
        break;
       }
     }
-   
+
     if (!recovering.count(soid)) {
       if (recovering.count(head)) {
        ++skipped;
@@ -12968,12 +12968,12 @@ uint64_t PrimaryLogPG::recover_primary(uint64_t max, ThreadPool::TPHandle &handl
          break;
       }
     }
-    
+
     // only advance last_requested if we haven't skipped anything
     if (!skipped)
       recovery_state.set_last_requested(v);
   }
+
   pgbackend->run_recovery_op(h, get_recovery_op_priority());
   return started;
 }
@@ -13747,7 +13747,7 @@ void PrimaryLogPG::scan_range(
 
 
 /** check_local
- * 
+ *
  * verifies that stray objects have been deleted
  */
 void PrimaryLogPG::check_local()
@@ -15498,7 +15498,7 @@ void PrimaryLogPG::SnapTrimmer::log_exit(const char *state_name, utime_t enter_t
 
 /* NotTrimming */
 PrimaryLogPG::NotTrimming::NotTrimming(my_context ctx)
-  : my_base(ctx), 
+  : my_base(ctx),
     NamedState(nullptr, "NotTrimming")
 {
   context< SnapTrimmer >().log_enter(state_name);
@@ -15742,6 +15742,7 @@ bool PrimaryLogPG::maybe_preempt_replica_scrub(const hobject_t& oid)
 {
   return m_scrubber->write_blocked_by_scrub(oid);
 }
+
 void intrusive_ptr_add_ref(PrimaryLogPG *pg) { pg->get("intptr"); }
 void intrusive_ptr_release(PrimaryLogPG *pg) { pg->put("intptr"); }
 
index a85c4f85ed475d685c51307971564ad9a7ef970a..211f8ede52277929503f2e19055cf266b78e3882 100644 (file)
@@ -1,4 +1,4 @@
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 /*
  * Ceph - scalable distributed file system
  *
@@ -9,9 +9,9 @@
  *
  * This is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software 
+ * License version 2.1, as published by the Free Software
  * Foundation.  See file COPYING.
- * 
+ *
  */
 
 #ifndef CEPH_REPLICATEDPG_H
@@ -158,7 +158,7 @@ public:
     uint64_t start_offset = 0;
     uint64_t last_offset = 0;
     std::vector<OSDOp> chunk_ops;
-  
+
     CopyOp(CopyCallback *cb_, ObjectContextRef _obc, hobject_t s,
           object_locator_t l,
            version_t v,
@@ -245,8 +245,8 @@ public:
     bool removal;               ///< we are removing the backend object
     std::optional<std::function<void()>> on_flush; ///< callback, may be null
     // for chunked object
-    std::map<uint64_t, int> io_results; 
-    std::map<uint64_t, ceph_tid_t> io_tids; 
+    std::map<uint64_t, int> io_results;
+    std::map<uint64_t, ceph_tid_t> io_tids;
     uint64_t chunks;
 
     FlushOp()
@@ -335,7 +335,7 @@ public:
     GenContext<ThreadPool::TPHandle&> *c) override;
   GenContext<ThreadPool::TPHandle&> *bless_unlocked_gencontext(
     GenContext<ThreadPool::TPHandle&> *c) override;
-    
+
   void send_message(int to_osd, Message *m) override {
     osd->send_message_osd_cluster(to_osd, m, get_osdmap_epoch());
   }
@@ -378,7 +378,7 @@ public:
   const std::map<pg_shard_t, pg_info_t> &get_shard_info() const override {
     return recovery_state.get_peer_info();
   }
-  using PGBackend::Listener::get_shard_info;  
+  using PGBackend::Listener::get_shard_info;
   const pg_missing_tracker_t &get_local_missing() const override {
     return recovery_state.get_pg_log().get_missing();
   }
@@ -503,7 +503,7 @@ public:
   bool pg_is_undersized() const override {
     return is_undersized();
   }
-  
+
   bool pg_is_repair() const override {
     return is_repair();
   }
@@ -797,9 +797,9 @@ public:
 
     bool rep_aborted;
     bool all_committed;
-    
+
     utime_t   start;
-    
+
     eversion_t          pg_local_last_complete;
 
     ObcLockManager lock_manager;
@@ -807,7 +807,7 @@ public:
     std::list<std::function<void()>> on_committed;
     std::list<std::function<void()>> on_success;
     std::list<std::function<void()>> on_finish;
-    
+
     RepGather(
       OpContext *c, ceph_tid_t rt,
       eversion_t lc) :
@@ -815,7 +815,7 @@ public:
       op(c->op),
       queue_item(this),
       nref(1),
-      rep_tid(rt), 
+      rep_tid(rt),
       rep_aborted(false),
       all_committed(false),
       pg_local_last_complete(lc),
@@ -917,7 +917,7 @@ protected:
    * Releases locks
    *
    * @param manager [in] manager with locks to release
-   * 
+   *
    * (moved to .cc due to scrubber access)
    */
   void release_object_locks(ObcLockManager &lock_manager);
@@ -1270,7 +1270,7 @@ protected:
   int prepare_transaction(OpContext *ctx);
   std::list<std::pair<OpRequestRef, OpContext*> > in_progress_async_reads;
   void complete_read_ctx(int result, OpContext *ctx);
-  
+
   // pg on-disk content
   void check_local() override;
 
@@ -1457,7 +1457,7 @@ protected:
     DECREMENT_REF,
     CREATE_OR_GET_REF,
   };
-  void do_proxy_chunked_op(OpRequestRef op, const hobject_t& missing_oid, 
+  void do_proxy_chunked_op(OpRequestRef op, const hobject_t& missing_oid,
                           ObjectContextRef obc, bool write_ordered);
   void do_proxy_chunked_read(OpRequestRef op, ObjectContextRef obc, int op_index,
                             uint64_t chunk_index, uint64_t req_offset, uint64_t req_length,
@@ -1968,7 +1968,7 @@ inline ostream& operator<<(ostream& out, const PrimaryLogPG::RepGather& repop)
 {
   out << "repgather(" << &repop
       << " " << repop.v
-      << " rep_tid=" << repop.rep_tid 
+      << " rep_tid=" << repop.rep_tid
       << " committed?=" << repop.all_committed
       << " r=" << repop.r
       << ")";