]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
removed some old hack_* funcs
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Sat, 26 Aug 2006 03:57:18 +0000 (03:57 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Sat, 26 Aug 2006 03:57:18 +0000 (03:57 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@821 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/mds/MDCache.cc

index a2ca4f060df171bb0c85af2035584d04bd8cca15..f137bc272f851931e19900d87df61a1ddb785834 100644 (file)
@@ -8848,88 +8848,3 @@ void MDCache::show_cache()
   }
 }
 
-
-// hack
-vector<CInode*> MDCache::hack_add_file(string& fn, CInode *in) {
-  
-  // root?
-  if (fn == "/") {
-       if (!root) {
-         root = in;
-         add_inode( in );
-         dout(7) << " added root " << root << endl;
-       } else {
-         root->inode.ino = in->inode.ino;  // bleh
-       }
-       vector<CInode*> trace;
-       trace.push_back(root);
-       return trace;
-  } 
-
-
-  // file.
-  int lastslash = fn.rfind("/");
-  string dirpart = fn.substr(0,lastslash);
-  string file = fn.substr(lastslash+1);
-
-  //dout(7) << "dirpart '" << dirpart << "' filepart '" << file << "' inode " << in << endl;
-  
-  CInode *diri = hack_get_file(dirpart);
-  assert(diri);
-
-  //dout(7) << " got dir " << diri << endl;
-
-  if (diri->dir == NULL) {
-       dout(4) << " making " << *diri << " into a dir" << endl;
-       diri->inode.mode &= ~INODE_MODE_FILE;
-       diri->inode.mode |= INODE_MODE_DIR;
-  }
-
-  assert(diri->is_dir());
-  diri->get_or_open_dir(mds);
-  
-  add_inode( in );
-  diri->dir->add_dentry( file, in );
-
-  if (in->is_dir())
-       in->get_or_open_dir(mds);
-
-  vector<CInode*> trace;
-  trace.push_back(diri);
-  trace.push_back(in);
-  while (diri->parent) {
-       diri = diri->parent->dir->inode;
-       trace.insert(trace.begin(),diri);
-  }
-  return trace;
-}
-
-CInode* MDCache::hack_get_file(string& fn) {
-  unsigned off = 1;
-  CInode *cur = root;
-  
-  // dirs
-  while (off < fn.length()) {
-       unsigned int slash = fn.find("/", off);
-       if (slash == string::npos) 
-         slash = fn.length();  
-       string n = fn.substr(off, slash-off);
-
-       //dout(7) << " looking up '" << n << "' in " << cur << endl;
-
-       if (cur->dir == NULL) {
-         //dout(7) << "   not a directory!" << endl;
-         return NULL;  // this isn't a directory.
-       }
-
-       CDentry* den = cur->dir->lookup(n);
-       if (den == NULL) return NULL;   // file dne!
-       cur = den->inode;
-       off = slash+1;  
-  }
-
-  //dump();
-  lru.lru_status();
-
-  return cur;  
-}