]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/include/elist.h
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / include / elist.h
index 1bf3df8c6c8758f526b7ee847b0d62316ace69de..38be35dbff33a0b3a994cf108341d9accfe288a1 100644 (file)
@@ -36,12 +36,11 @@ public:
     
     item(T i=0) : _prev(this), _next(this) {}
     ~item() { 
-      assert(!is_on_list());
+      ceph_assert(!is_on_list());
     }
 
-    // no copying!
-    item(const item& other);
-    const item& operator= (const item& right);
+    item(const item& other) = delete;
+    const item& operator= (const item& right) = delete;
 
     
     bool empty() const { return _prev == this; }
@@ -49,7 +48,7 @@ public:
 
     bool remove_myself() {
       if (_next == this) {
-       assert(_prev == this);
+       ceph_assert(_prev == this);
        return false;
       }
       _next->_prev = _prev;
@@ -59,14 +58,14 @@ public:
     }
 
     void insert_after(item *other) {
-      assert(other->empty());
+      ceph_assert(other->empty());
       other->_prev = this;
       other->_next = _next;
       _next->_prev = other;
       _next = other;
     }
     void insert_before(item *other) {
-      assert(other->empty());
+      ceph_assert(other->empty());
       other->_next = this;
       other->_prev = _prev;
       _prev->_next = other;
@@ -74,7 +73,7 @@ public:
     }
 
     T get_item(size_t offset) {
-      assert(offset);
+      ceph_assert(offset);
       return (T)(((char *)this) - offset); 
     }
   };
@@ -89,7 +88,7 @@ public:
 
   elist(size_t o) : _head(NULL), item_offset(o) {}
   ~elist() { 
-    assert(_head.empty());
+    ceph_assert(_head.empty());
   }
 
   bool empty() const {
@@ -113,20 +112,20 @@ public:
   }
 
   T front(size_t o=0) {
-    assert(!_head.empty());
+    ceph_assert(!_head.empty());
     return _head._next->get_item(o ? o : item_offset);
   }
   T back(size_t o=0) {
-    assert(!_head.empty());
+    ceph_assert(!_head.empty());
     return _head._prev->get_item(o ? o : item_offset);
   }
 
   void pop_front() {
-    assert(!empty());
+    ceph_assert(!empty());
     _head._next->remove_myself();
   }
   void pop_back() {
-    assert(!empty());
+    ceph_assert(!empty());
     _head._prev->remove_myself();
   }
 
@@ -149,14 +148,14 @@ public:
     iterator(item *h, size_t o, mode_t m) :
       head(h), cur(h->_next), next(cur->_next), item_offset(o),
       mode(m) {
-      assert(item_offset > 0);
+      ceph_assert(item_offset > 0);
     }
     T operator*() {
       return cur->get_item(item_offset);
     }
     iterator& operator++() {
-      assert(cur);
-      assert(cur != head);
+      ceph_assert(cur);
+      ceph_assert(cur != head);
       if (mode == MAGIC) {
        // if 'cur' appears to be valid, use that.  otherwise,
        // use cached 'next'.