]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
nuke dlist 2090/head
authorSage Weil <sage@inktank.com>
Thu, 10 Jul 2014 14:01:44 +0000 (07:01 -0700)
committerSage Weil <sage@inktank.com>
Thu, 10 Jul 2014 14:01:44 +0000 (07:01 -0700)
No users.

Signed-off-by: Sage Weil <sage@inktank.com>
src/include/Makefile.am
src/include/dlist.h [deleted file]
src/mds/CInode.h
src/mds/LogSegment.h

index 6dacd4a2dc478ef7cb34e8a8ba7d55a3b33b1d7d..7fa1e18b96f6fe79eedc4ca55e4b6639b7fd8b2b 100644 (file)
@@ -70,7 +70,6 @@ noinst_HEADERS += \
        include/triple.h \
        include/types.h \
        include/utime.h \
-       include/dlist.h \
        include/elist.h \
        include/uuid.h \
        include/xlist.h \
diff --git a/src/include/dlist.h b/src/include/dlist.h
deleted file mode 100644 (file)
index 09eb0bc..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph - scalable distributed file system
- *
- * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
- *
- * This is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software 
- * Foundation.  See file COPYING.
- * 
- */
-
-#ifndef CEPH_DLIST_H
-#define CEPH_DLIST_H
-
-template<typename T>
-class dlist {
-public:
-  struct item {
-    T _item;
-    item *_prev, *_next;
-    
-    item(T i) : _item(i), _prev(this), _next(this) {}
-    ~item() { 
-      assert(!is_on_list());
-    }
-
-    // no copying!
-    item(const item& other);
-    const item& operator= (const item& right);
-
-    
-    bool empty() const { return _prev == this; }
-    bool is_on_list() const { return !empty(); }
-
-    bool remove_myself() {
-      if (_next == this) {
-       assert(_prev == this);
-       return false;
-      }
-      _next->_prev = _prev;
-      _prev->_next = _next;
-      _prev = _next = this;
-      return true;
-    }
-
-    void insert_after(item *other) {
-      assert(other->empty());
-      other->_prev = this;
-      other->_next = _next;
-      _next->_prev = other;
-      _next = other;
-    }
-    void insert_before(item *other) {
-      assert(other->empty());
-      other->_next = this;
-      other->_prev = _prev;
-      _prev->_next = other;
-      _prev = other;
-    }
-  };
-
-private:
-  item _head;
-
-public:
-  dlist(const dlist& other);
-  const dlist& operator=(const dlist& other);
-
-  dlist() : _head(NULL) {}
-  ~dlist() { 
-    assert(_head.empty());
-  }
-
-  bool empty() { 
-    return _head.empty();
-  }
-
-  void clear() {
-    while (!_head.empty())
-      remove(front());
-  }
-
-  void push_front(item *i) {
-    if (!i->empty()) 
-      i->remove_myself();
-    _head.insert_after(i);
-  }
-  void push_back(item *i) {
-    if (!i->empty()) 
-      i->remove_myself();
-    _head.insert_before(i);
-  }
-
-  T front() { return (T)_head._next->_item; }
-  T back() { return (T)_head._prev->_item; }
-
-  void pop_front() {
-    assert(!empty());
-    _head._next->remove_myself();
-  }
-  void pop_back() {
-    assert(!empty());
-    _head._prev->remove_myself();
-  }
-
-  class iterator {
-  private:
-    item *cur;
-  public:
-    iterator(item *i = 0) : cur(i) {}
-    T operator*() { return (T)cur->_item; }
-    iterator& operator++() {
-      assert(cur);
-      cur = cur->_next;
-      return *this;
-    }
-    bool end() { return cur->_item == 0; }
-  };
-
-  iterator begin() { return iterator(_head._next); }
-};
-
-
-#endif
index 697e603dfc4c234ba7aaa8f43f43f6f7a342d32f..77e22c3735da4551e4e7e2fcc5d90f93bcdbeff1 100644 (file)
@@ -18,7 +18,6 @@
 #define CEPH_CINODE_H
 
 #include "common/config.h"
-#include "include/dlist.h"
 #include "include/elist.h"
 #include "include/types.h"
 #include "include/lru.h"
@@ -417,7 +416,7 @@ protected:
     flock_locks.clear();
   }
 
-  // LogSegment dlists i (may) belong to
+  // LogSegment lists i (may) belong to
 public:
   elist<CInode*>::item item_dirty;
   elist<CInode*>::item item_caps;
index 1df103b0514c6c3f286625674fcc7463334da1f6..a141855fdd1c5714f7010b2b46b7138fa952f9ba 100644 (file)
@@ -15,7 +15,6 @@
 #ifndef CEPH_LOGSEGMENT_H
 #define CEPH_LOGSEGMENT_H
 
-#include "include/dlist.h"
 #include "include/elist.h"
 #include "include/interval_set.h"
 #include "include/Context.h"