]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: Mutex::Locker -> std::lock_guard
authorSage Weil <sage@redhat.com>
Tue, 16 Oct 2018 19:10:37 +0000 (14:10 -0500)
committerSage Weil <sage@redhat.com>
Tue, 16 Oct 2018 19:10:37 +0000 (14:10 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/librados/IoCtxImpl.cc
src/librados/RadosClient.cc
src/osdc/ObjectCacher.cc

index cd93c44a9528f1fd7c594205be9e5f5f3ac88c51..ed5dd0d1a375bcd2b611fc09228ffbed0308bded 100644 (file)
@@ -327,7 +327,7 @@ void librados::IoCtxImpl::flush_aio_writes_async(AioCompletionImpl *c)
 {
   ldout(client->cct, 20) << "flush_aio_writes_async " << this
                         << " completion " << c << dendl;
-  Mutex::Locker l(aio_write_list_lock);
+  std::lock_guard l(aio_write_list_lock);
   ceph_tid_t seq = aio_write_seq;
   if (aio_write_list.empty()) {
     ldout(client->cct, 20) << "flush_aio_writes_async no writes. (tid "
index 72b934b87ced3fe22dae88301f40304ec392e4b5..3245892cd11c6949e47ec849253ad7a410dc6220 100644 (file)
@@ -199,7 +199,7 @@ int librados::RadosClient::get_fsid(std::string *s)
 {
   if (!s)
     return -EINVAL;
-  Mutex::Locker l(lock);
+  std::lock_guard l(lock);
   ostringstream oss;
   oss << monclient.get_fsid();
   *s = oss.str();
@@ -508,7 +508,7 @@ bool librados::RadosClient::ms_dispatch(Message *m)
 {
   bool ret;
 
-  Mutex::Locker l(lock);
+  std::lock_guard l(lock);
   if (state == DISCONNECTED) {
     ldout(cct, 10) << "disconnected, discarding " << *m << dendl;
     m->put();
@@ -579,7 +579,7 @@ int librados::RadosClient::wait_for_osdmap()
     });
 
   if (need_map) {
-    Mutex::Locker l(lock);
+    std::lock_guard l(lock);
 
     utime_t timeout;
     if (cct->_conf->rados_mon_op_timeout > 0)
@@ -688,13 +688,13 @@ int librados::RadosClient::get_fs_stats(ceph_statfs& stats)
 }
 
 void librados::RadosClient::get() {
-  Mutex::Locker l(lock);
+  std::lock_guard l(lock);
   ceph_assert(refcnt > 0);
   refcnt++;
 }
 
 bool librados::RadosClient::put() {
-  Mutex::Locker l(lock);
+  std::lock_guard l(lock);
   ceph_assert(refcnt > 0);
   refcnt--;
   return (refcnt == 0);
@@ -808,7 +808,7 @@ int librados::RadosClient::pool_delete_async(const char *name, PoolAsyncCompleti
 }
 
 void librados::RadosClient::blacklist_self(bool set) {
-  Mutex::Locker l(lock);
+  std::lock_guard l(lock);
   objecter->blacklist_self(set);
 }
 
@@ -867,7 +867,7 @@ int librados::RadosClient::mgr_command(const vector<string>& cmd,
                                       const bufferlist &inbl,
                                       bufferlist *outbl, string *outs)
 {
-  Mutex::Locker l(lock);
+  std::lock_guard l(lock);
 
   C_SaferCond cond;
   int r = mgrclient.start_command(cmd, inbl, outbl, outs, &cond);
@@ -974,7 +974,7 @@ int librados::RadosClient::monitor_log(const string& level,
                                       rados_log_callback2_t cb2,
                                       void *arg)
 {
-  Mutex::Locker l(lock);
+  std::lock_guard l(lock);
 
   if (state != CONNECTED) {
     return -ENOTCONN;
index 7ecfdb556fa206474fa8c9cef953845f6d71ddbb..44ea5e10e8e55ad235bff3b5039cfb23c3ca1ec9 100644 (file)
@@ -1790,7 +1790,7 @@ private:
 
 void ObjectCacher::C_WaitForWrite::finish(int r)
 {
-  Mutex::Locker l(m_oc->lock);
+  std::lock_guard l(m_oc->lock);
   m_oc->maybe_wait_for_writeback(m_len, &m_trace);
   m_onfinish->complete(r);
 }