]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: [Clean Up] Don't initialze object by NULL or 0 18311/head
authorShinobu Kinjo <shinobu@redhat.com>
Sun, 15 Oct 2017 04:17:02 +0000 (13:17 +0900)
committerShinobu Kinjo <shinobu@redhat.com>
Sun, 15 Oct 2017 04:17:02 +0000 (13:17 +0900)
Signed-off-by: Shinobu Kinjo <shinobu@redhat.com>
src/osd/ECBackend.cc
src/osd/PrimaryLogPG.cc
src/osd/Watch.cc

index 780bdb676b3316f9f8d207429d535b412a32f4c7..62955f059c5f11dcf0f1e42113fd0348f5ec4786 100644 (file)
@@ -1264,7 +1264,7 @@ void ECBackend::complete_read_op(ReadOp &rop, RecoveryMessages *m)
       pair<RecoveryMessages *, read_result_t &> arg(
        m, resiter->second);
       reqiter->second.cb->complete(arg);
-      reqiter->second.cb = NULL;
+      reqiter->second.cb = nullptr;
     }
   }
   tid_to_read_map.erase(rop.tid);
@@ -1332,7 +1332,7 @@ void ECBackend::filter_read_op(
             << "  for obj " << *i << dendl;
     assert(req.cb);
     delete req.cb;
-    req.cb = NULL;
+    req.cb = nullptr;
 
     op.to_read.erase(*i);
     op.complete.erase(*i);
@@ -1393,7 +1393,7 @@ void ECBackend::on_change()
         j != i->second.to_read.end();
         ++j) {
       delete j->second.cb;
-      j->second.cb = 0;
+      j->second.cb = nullptr;
     }
   }
   tid_to_read_map.clear();
index 99a4230da78950aca6ca5d91d09fb4c67951be8a..1a5d86d768c579e0afc55ca08923ea661c6e5f08 100644 (file)
@@ -7665,7 +7665,7 @@ int PrimaryLogPG::do_copy_get(OpContext *ctx, bufferlist::iterator& bp,
 
   bool async_read_started = false;
   object_copy_data_t _reply_obj;
-  C_CopyFrom_AsyncReadCb *cb = NULL;
+  C_CopyFrom_AsyncReadCb *cb = nullptr;
   if (pool.info.require_rollback()) {
     cb = new C_CopyFrom_AsyncReadCb(&osd_op, features);
   }
index 7ff9f99b2bfab5929a52b7409279d20cccb5d09d..4579b8a2b299e32a287c7e278f6a51dc565021f7 100644 (file)
@@ -93,7 +93,7 @@ void Notify::do_timeout()
 {
   assert(lock.is_locked_by_me());
   dout(10) << "timeout" << dendl;
-  cb = NULL;
+  cb = nullptr;
   if (is_discarded()) {
     lock.Unlock();
     return;
@@ -140,7 +140,7 @@ void Notify::unregister_cb()
   {
     osd->watch_lock.Lock();
     osd->watch_timer.cancel_event(cb);
-    cb = NULL;
+    cb = nullptr;
     osd->watch_lock.Unlock();
   }
 }
@@ -247,7 +247,7 @@ public:
     boost::intrusive_ptr<PrimaryLogPG> pg(watch->pg);
     osd->watch_lock.Unlock();
     pg->lock();
-    watch->cb = NULL;
+    watch->cb = nullptr;
     if (!watch->is_discarded() && !canceled)
       watch->pg->handle_watch_timeout(watch);
     delete this; // ~Watch requires pg lock!
@@ -268,7 +268,7 @@ public:
     OSDService *osd(watch->osd);
     dout(10) << "HandleWatchTimeoutDelayed" << dendl;
     assert(watch->pg->is_locked());
-    watch->cb = NULL;
+    watch->cb = nullptr;
     if (!watch->is_discarded() && !canceled)
       watch->pg->handle_watch_timeout(watch);
   }
@@ -349,7 +349,7 @@ void Watch::unregister_cb()
     Mutex::Locker l(osd->watch_lock);
     osd->watch_timer.cancel_event(cb); // harmless if not registered with timer
   }
-  cb = NULL;
+  cb = nullptr;
 }
 
 void Watch::got_ping(utime_t t)