]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: allow early reply when request's witness list is empty
authorYan, Zheng <zheng.z.yan@intel.com>
Wed, 30 Apr 2014 05:45:31 +0000 (13:45 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Wed, 30 Apr 2014 17:32:39 +0000 (01:32 +0800)
Early reply should be Ok when there were slave requests, but all
of them were for acquiring locks.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mds/Locker.cc
src/mds/Mutation.cc
src/mds/Mutation.h
src/mds/Server.cc

index e5fe00c2a679404daef2c31d1cb1378c5cd82cea..4f6140dfa6281ade9fd28f4eb5338be4f0cb6eb4 100644 (file)
@@ -515,10 +515,12 @@ void Locker::set_xlocks_done(MutationImpl *mut, bool skip_dentry)
   for (set<SimpleLock*>::iterator p = mut->xlocks.begin();
        p != mut->xlocks.end();
        ++p) {
+    MDSCacheObject *object = (*p)->get_parent();
+    assert(object->is_auth());
     if (skip_dentry &&
        ((*p)->get_type() == CEPH_LOCK_DN || (*p)->get_type() == CEPH_LOCK_DVERSION))
       continue;
-    dout(10) << "set_xlocks_done on " << **p << " " << *(*p)->get_parent() << dendl;
+    dout(10) << "set_xlocks_done on " << **p << " " << *object << dendl;
     (*p)->set_xlock_done();
   }
 }
index ffeb066b6bd04e2a5bbb5a7ec2d854c9f8ff6764..a733b3358e70ef29f06f4b014dd5273048afe704 100644 (file)
@@ -197,9 +197,9 @@ bool MDRequestImpl::has_more()
   return _more;
 }
 
-bool MDRequestImpl::are_slaves()
+bool MDRequestImpl::has_witnesses()
 {
-  return _more && !_more->slaves.empty();
+  return _more && !_more->witnessed.empty();
 }
 
 bool MDRequestImpl::slave_did_prepare()
index dbfbe7595b0aebe8d668ea34acffac702dd2fc69..87bf3df332b25b0b4a2c26bfbf20cb3bb9c43a2e 100644 (file)
@@ -295,7 +295,7 @@ struct MDRequestImpl : public MutationImpl {
   
   More* more();
   bool has_more();
-  bool are_slaves();
+  bool has_witnesses();
   bool slave_did_prepare();
   bool did_ino_allocation();
   bool freeze_auth_pin(CInode *inode);
index 407ceed31e1185364f6590cc80f7ba4a3eb0155d..98617f17f48f7f847aadff55a4280dac31746add 100644 (file)
@@ -825,8 +825,8 @@ void Server::early_reply(MDRequestRef& mdr, CInode *tracei, CDentry *tracedn)
   if (!g_conf->mds_early_reply)
     return;
 
-  if (mdr->are_slaves()) {
-    dout(10) << "early_reply - there are slaves, not allowed." << dendl;
+  if (mdr->has_witnesses()) {
+    dout(10) << "early_reply - there are witnesses, not allowed." << dendl;
     mds->mdlog->flush();
     return; 
   }