]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: kill open_foreign_stray; but open remote mdsdirs instead
authorSage Weil <sage@newdream.net>
Thu, 3 Jun 2010 23:09:23 +0000 (16:09 -0700)
committerSage Weil <sage@newdream.net>
Fri, 4 Jun 2010 00:33:29 +0000 (17:33 -0700)
Signed-off-by: Sage Weil <sage@newdream.net>
src/mds/MDCache.cc
src/mds/MDCache.h

index 71e5d710b0e7bc17b52f09e30db61446d8d73ca4..00722da097f17bb1207ac7cb193a3c15ca761d89 100644 (file)
@@ -560,16 +560,11 @@ void MDCache::populate_mydir()
   mds->queue_waiters(waiting_for_open);
 }
 
-void MDCache::open_foreign_stray(int who, Context *c)
+void MDCache::open_foreign_mdsdir(inodeno_t ino, Context *fin)
 {
-  inodeno_t ino = MDS_INO_STRAY(who);
-  dout(10) << "open_foreign_stray mds" << who << " " << ino << dendl;
-  assert(!have_inode(ino));
-
-  discover_base_ino(ino, c, who);
+  discover_base_ino(ino, fin, ino & (MAX_MDS-1));
 }
 
-
 CDentry *MDCache::get_or_create_stray_dentry(CInode *in)
 {
   string straydname;
@@ -5788,8 +5783,8 @@ int MDCache::path_traverse(MDRequest *mdr, Message *req,     // who
   dout(7) << "traverse: opening base ino " << path.get_ino() << " snap " << snapid << dendl;
   CInode *cur = get_inode(path.get_ino());
   if (cur == NULL) {
-    if (MDS_INO_IS_STRAY(path.get_ino())) 
-      open_foreign_stray(path.get_ino() - MDS_INO_STRAY_OFFSET, _get_waiter(mdr, req));
+    if (MDS_INO_IS_MDSDIR(path.get_ino())) 
+      open_foreign_mdsdir(path.get_ino(), _get_waiter(mdr, req));
     else {
       //assert(0);  // hrm.. broken
       return -ESTALE;
@@ -6271,9 +6266,8 @@ void MDCache::open_remote_ino_2(inodeno_t ino,
       in = get_inode(anchortrace[i].dirino);
       if (!in) {
        dout(0) << "open_remote_ino_2 don't have dir inode " << anchortrace[i].dirino << dendl;
-       if (MDS_INO_IS_STRAY(anchortrace[i].dirino)) {
-         int mds = anchortrace[i].dirino % MAX_MDS;
-         open_foreign_stray(mds, onfinish);
+       if (MDS_INO_IS_MDSDIR(anchortrace[i].dirino)) {
+         open_foreign_mdsdir(anchortrace[i].dirino, onfinish);
          return;
        }
        assert(in);  // hrm!
index a6bf8c53f456c465bdce8d89ec5913c2bf326667..85d0902653dda24839f3b12e3b7c40eed5b36c36 100644 (file)
@@ -944,7 +944,7 @@ public:
   void _create_system_file(CDir *dir, const char *name, CInode *in, Context *fin);
   void _create_system_file_finish(Mutation *mut, CDentry *dn, Context *fin);
 
-  void open_foreign_stray(int who, Context *c);
+  void open_foreign_mdsdir(inodeno_t ino, Context *c);
   CDentry *get_or_create_stray_dentry(CInode *in);
 
   Context *_get_waiter(MDRequest *mdr, Message *req);