]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix inode load existence check
authorSage Weil <sage@newdream.net>
Tue, 22 Sep 2009 22:37:51 +0000 (15:37 -0700)
committerSage Weil <sage@newdream.net>
Tue, 22 Sep 2009 22:37:51 +0000 (15:37 -0700)
We can lookup using last snapid, not first.  That's how the
inode_map is indexed.

src/mds/CDir.cc
src/mds/MDCache.h

index b491e979e51ecb7eb08b681287044e014a675b37..58982d1faad3ac61d7f7e12f9be5de6c3ae41861 100644 (file)
@@ -1225,8 +1225,8 @@ void CDir::_fetched(bufferlist &bl)
       } else {
        // add inode
        CInode *in = 0;
-       if (cache->have_inode(inode.ino, first)) {
-         in = cache->get_inode(inode.ino, first);
+       if (cache->have_inode(inode.ino, last)) {
+         in = cache->get_inode(inode.ino, last);
          dout(-12) << "_fetched  got (but i already had) " << *in 
                   << " mode " << in->inode.mode 
                   << " mtime " << in->inode.mtime << dendl;
index 9aaa9468def9b81875f83221f5fc695d554867c8..f858ca055e5fa3bf87567675857f800076fe2989 100644 (file)
@@ -835,6 +835,7 @@ public:
     return have_inode(vinodeno_t(ino, snap));
   }
   bool have_inode(vinodeno_t vino) { return inode_map.count(vino) ? true:false; }
+
   CInode* get_inode(vinodeno_t vino) {
     return get_inode(vino.ino, vino.snapid);
   }
@@ -844,16 +845,11 @@ public:
       return inode_map[vino];
     return NULL;
   }
+
   CDir* get_dirfrag(dirfrag_t df) {
     if (!have_inode(df.ino)) return NULL;
     return get_inode(df.ino)->get_dirfrag(df.frag);
   }
-  /*
-  void get_dirfrags_under(dirfrag_t df, list<CDir*>& ls) {
-    if (have_inode(df.ino))
-      inode_map[df.ino]->get_dirfrags_under(df.frag, ls);
-  }
-  */
 
   MDSCacheObject *get_object(MDSCacheObjectInfo &info);