]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
xlist itesm remove themselves in destructor; dump mdcache when shutdown looks hung
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Mon, 8 Oct 2007 17:42:57 +0000 (17:42 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Mon, 8 Oct 2007 17:42:57 +0000 (17:42 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1891 29311d96-e01e-0410-9327-a35deaab8ce9

branches/sage/mds/include/xlist.h
branches/sage/mds/mds/MDCache.cc

index 35099311ef6661506cd25c17926cb45c5d64342a..9c1da495029163dbc12c135c98791303f772ae7e 100644 (file)
@@ -24,12 +24,15 @@ public:
     xlist *_head;
     
     item(T i) : _item(i), _prev(0), _next(0), _head(0) {}
+    ~item() { 
+      remove_myself();
+    }
     
     xlist* get_xlist() { return _head; }
     void remove_myself() {
-      if (_head) {
+      if (_head) 
        _head->remove(this);
-      }
+      assert(_head == 0);
     }
   };
 
@@ -84,6 +87,15 @@ public:
   T front() { return (T)_front->_item; }
   T back() { return (T)_back->_item; }
 
+  void pop_front() {
+    assert(!empty());
+    remove(_front);
+  }
+  void pop_back() {
+    assert(!empty());
+    remove(_back);
+  }
+
   class iterator {
   private:
     item *cur;
index 7831afcfe82d2d5e4d88a0368d853426578cafab..18d8a26844441b6d0ea10f760e2f16b59119f6dc 100644 (file)
@@ -3547,7 +3547,8 @@ bool MDCache::shutdown_pass()
     show_subtrees();
     migrator->show_importing();
     migrator->show_exporting();
-    //show_cache();
+    if (!migrator->is_importing() && !migrator->is_exporting())
+      show_cache();
     return false;
   }
   assert(subtrees.empty());