]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: dump_cache even when debug_mds < 2
authorSage Weil <sage@newdream.net>
Tue, 2 Feb 2010 18:56:14 +0000 (10:56 -0800)
committerSage Weil <sage@newdream.net>
Tue, 2 Feb 2010 19:00:32 +0000 (11:00 -0800)
Make output more readable.

src/mds/MDCache.cc

index 165794931fd9e36e6d3cc672f62fab67a5177cc7..4c0eb80a2907ad1b91ac0f6c681e77885ccf7d18 100644 (file)
@@ -8586,8 +8586,6 @@ void MDCache::show_cache()
 
 void MDCache::dump_cache(const char *fn)
 {
-  if (g_conf.debug_mds < 2) return;
-
   char deffn[200];
   if (!fn) {
     snprintf(deffn, sizeof(deffn), "cachedump.%d.mds%d", (int)mds->mdsmap->get_epoch(), mds->get_nodeid());
@@ -8607,13 +8605,13 @@ void MDCache::dump_cache(const char *fn)
     for (list<CDir*>::iterator p = dfs.begin(); p != dfs.end(); ++p) {
       CDir *dir = *p;
       myfile << *dir->inode << std::endl;
-      myfile << *dir << std::endl;
+      myfile << " " << *dir << std::endl;
       
-      for (CDir::map_t::iterator p = dir->items.begin();
-          p != dir->items.end();
-          ++p) {
-       CDentry *dn = p->second;
-       myfile << *dn << std::endl;
+      for (CDir::map_t::iterator q = dir->items.begin();
+          q != dir->items.end();
+          ++q) {
+       CDentry *dn = q->second;
+       myfile << "  " << *dn << std::endl;
       }
     }
   }