]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
uclient: use Inode::auth_cap to find mds to write back snap cap metadata to
authorSage Weil <sage@newdream.net>
Sat, 14 Nov 2009 00:27:26 +0000 (16:27 -0800)
committerSage Weil <sage@newdream.net>
Sat, 14 Nov 2009 00:27:26 +0000 (16:27 -0800)
src/client/Client.cc

index 08e6dfd4bb4620d4956f1ba57644010d2b8dd374..d51780a6da36a2b50741e84e35f62526edc6a71a 100644 (file)
@@ -1889,13 +1889,8 @@ void Client::flush_snaps(Inode *in)
   // pick auth mds
   int mds = -1;
   int mseq = 0;
-  for (map<int,InodeCap*>::iterator p = in->caps.begin(); p != in->caps.end(); p++) {
-    if (p->second->issued & CEPH_CAP_ANY_WR) {
-      mds = p->first;
-      mseq = p->second->mseq;
-      break;
-    }
-  }
+  assert(in->auth_cap);
+  mds = in->auth_cap->session->inst.name.num();
   assert(mds >= 0);
 
   for (map<snapid_t,CapSnap>::iterator p = in->cap_snaps.begin(); p != in->cap_snaps.end(); p++) {