]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: use Locker to manage mds_lock
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 22 Jun 2016 19:18:48 +0000 (15:18 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 22 Jun 2016 19:26:34 +0000 (15:26 -0400)
This makes these blocks consistent with the others for trivial management of
mds_lock.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/MDSRank.cc

index 16a93485b2b437d0facf3d06d19c6e13089dd4bf..9809bc396d0e49cd5ff7684dad7c381a545456fa 100644 (file)
@@ -1694,13 +1694,11 @@ bool MDSRankDispatcher::handle_asok_command(
       cond.wait();
     }
   } else if (command == "session ls") {
-    mds_lock.Lock();
+    Mutex::Locker l(mds_lock);
 
     heartbeat_reset();
 
     dump_sessions(SessionFilter(), f);
-
-    mds_lock.Unlock();
   } else if (command == "session evict") {
     std::string client_id;
     const bool got_arg = cmd_getval(g_ceph_context, cmdmap, "client_id", client_id);
@@ -1759,9 +1757,8 @@ bool MDSRankDispatcher::handle_asok_command(
       mdcache->dump_cache(path);
     }
   } else if (command == "force_readonly") {
-    mds_lock.Lock();
+    Mutex::Locker l(mds_lock);
     mdcache->force_readonly();
-    mds_lock.Unlock();
   } else if (command == "dirfrag split") {
     Mutex::Locker l(mds_lock);
     command_dirfrag_split(cmdmap, ss);