]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "client: adjust objecter locking"
authorSage Weil <sage@newdream.net>
Wed, 12 Nov 2008 22:18:04 +0000 (14:18 -0800)
committerSage Weil <sage@newdream.net>
Wed, 12 Nov 2008 22:31:31 +0000 (14:31 -0800)
This reverts commit 1c70b1d8f62ad8d9eeef3a86ef36d8e6933c5702.

Actually, we need client_lock to protect access ot the objecter
and cache structures, as they have no internal locking.

Fix the safecond separately...

src/client/Client.cc

index 5f126406783f541c4d160848b04fa7dafc95991f..2f14d490fd3b4f0c3c428da869fa97a60d73d13e 100644 (file)
@@ -1096,15 +1096,11 @@ void Client::dispatch(Message *m)
 
     // osd
   case CEPH_MSG_OSD_OPREPLY:
-    client_lock.Unlock();
     objecter->handle_osd_op_reply((MOSDOpReply*)m);
-    client_lock.Lock();
     break;
 
   case CEPH_MSG_OSD_MAP:
-    client_lock.Unlock();
     objecter->handle_osd_map((class MOSDMap*)m);
-    client_lock.Lock();
     if (!mounted) mount_cond.Signal();
     break;
     
@@ -1669,7 +1665,8 @@ void Client::_flush(Inode *in, Context *onfinish)
 
 void Client::flush_set_callback(inodeno_t ino)
 {
-  Mutex::Locker l(client_lock);
+  //  Mutex::Locker l(client_lock);
+  assert(client_lock.is_locked());   // will be called via dispatch() -> objecter -> ...
   Inode *in = inode_map[vinodeno_t(ino,CEPH_NOSNAP)];
   assert(in);
   _flushed(in);
@@ -3755,8 +3752,7 @@ public:
 
 void Client::sync_write_commit(Inode *in)
 {
-  Mutex::Locker l(client_lock);
-
+  client_lock.Lock();
   assert(unsafe_sync_write > 0);
   unsafe_sync_write--;
 
@@ -3769,6 +3765,8 @@ void Client::sync_write_commit(Inode *in)
   }
 
   put_inode(in);
+
+  client_lock.Unlock();
 }
 
 int Client::write(int fd, const char *buf, loff_t size, loff_t offset)