]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: remove broken delay of cap releases from a replica.
authorGreg Farnum <gregory.farnum@dreamhost.com>
Fri, 22 Jul 2011 21:00:55 +0000 (14:00 -0700)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Fri, 22 Jul 2011 21:00:55 +0000 (14:00 -0700)
This hasn't worked in a very long time and serves little purpose
since the clients will have their own cap delay releases.
Nix a few of the repeated asserts while we're at it.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/mds/CInode.h
src/mds/Locker.cc

index 666312470c6e8c713c79f13c7e953faf0078d786..7eeb25f83a221181aa05953465e9b67fdc720f67 100644 (file)
@@ -410,7 +410,6 @@ protected:
   map<client_t, Capability*> client_caps;         // client -> caps
   map<int, int>         mds_caps_wanted;     // [auth] mds -> caps wanted
   int                   replica_caps_wanted; // [replica] what i've requested from auth
-  utime_t               replica_caps_wanted_keep_until;
 
   map<int, set<client_t> > client_snap_caps;     // [auth] [snap] dirty metadata we still need from the head
 public:
index d657359a016aa97e4e156a2a132e0448a36309db..87f9f5211f7f43332d9520ff9e47491f4d36a75b 100644 (file)
@@ -1725,40 +1725,10 @@ void Locker::request_inode_file_caps(CInode *in)
 
   int wanted = in->get_caps_wanted();
   if (wanted != in->replica_caps_wanted) {
-
-    if (wanted == 0) {
-      if (in->replica_caps_wanted_keep_until.sec() == 0) {
-        in->replica_caps_wanted_keep_until = ceph_clock_now(g_ceph_context);
-        in->replica_caps_wanted_keep_until.sec_ref() += 2;
-        
-        dout(7) << "request_inode_file_caps " << ccap_string(wanted)
-                           << " was " << ccap_string(in->replica_caps_wanted)
-                           << " keeping until " << in->replica_caps_wanted_keep_until
-                           << " on " << *in
-                           << dendl;
-        return;
-      } else if (in->replica_caps_wanted_keep_until <
-          ceph_clock_now(g_ceph_context)) {
-        // ok, release them finally!
-        in->replica_caps_wanted_keep_until.sec_ref() = 0;
-        dout(7) << "request_inode_file_caps " << ccap_string(wanted)
-                     << " was " << ccap_string(in->replica_caps_wanted)
-                     << " no keeping anymore "
-                     << " on " << *in
-                     << dendl;
-      } else {
-        // wait longer
-        return;
-      }
-    } else {
-      in->replica_caps_wanted_keep_until.sec_ref() = 0;
-    }
-    assert(!in->is_auth());
-
     // wait for single auth
     if (in->is_ambiguous_auth()) {
       in->add_waiter(MDSCacheObject::WAIT_SINGLEAUTH, 
-                    new C_MDL_RequestInodeFileCaps(this, in));
+                     new C_MDL_RequestInodeFileCaps(this, in));
       return;
     }
 
@@ -1766,15 +1736,12 @@ void Locker::request_inode_file_caps(CInode *in)
     dout(7) << "request_inode_file_caps " << ccap_string(wanted)
             << " was " << ccap_string(in->replica_caps_wanted) 
             << " on " << *in << " to mds" << auth << dendl;
-    assert(!in->is_auth());
 
     in->replica_caps_wanted = wanted;
 
     if (mds->mdsmap->get_state(auth) >= MDSMap::STATE_REJOIN)
       mds->send_message_mds(new MInodeFileCaps(in->ino(), in->replica_caps_wanted),
                            auth);
-  } else {
-    in->replica_caps_wanted_keep_until.sec_ref() = 0;
   }
 }