]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
bluestore/BitAllocator: literal cleanups 9492/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Sat, 4 Jun 2016 03:55:28 +0000 (11:55 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 7 Jun 2016 04:28:14 +0000 (12:28 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BitAllocator.cc
src/os/bluestore/BitAllocator.h

index b92c73aafa2785c14fd8313ee9d929af57581f42..28ca534ed0338f6bb7da20a9eba0f8b4bcf4606a 100644 (file)
@@ -5,15 +5,17 @@
  * Author: Ramesh Chander, Ramesh.Chander@sandisk.com
  *
  * BitMap Tree Design:
- * Storage is divided into bitmap of blocks. Each bitmap has size of unsigned long.
- * Group of bitmap creates a Zone. Zone is a unit where at a time single
- * thread can be active as well as single biggest contiguous allocation that can be requested.
+ * Storage is divided into bitmap of blocks. Each bitmap has size of
+ * unsigned long. Group of bitmap creates a Zone. Zone is a unit where
+ * at a time single thread can be active as well as single biggest
+ * contiguous allocation that can be requested.
  *
  * Rest of the nodes are classified in to three catagories:
- *   root note or Alloctor, internal nodes or BitMapAreaIN and
- *  finally nodes that contains Zones called BitMapAreaLeaf.
- * This classification is according some their own implmentation of some the interfaces define in
- * BitMapArea.
+ *   root note or Allocator
+ *   internal nodes or BitMapAreaIN
+ *   finally nodes that contains Zones called BitMapAreaLeaf
+ * This classification is according to their own implmentation of some
+ * of the interfaces defined in BitMapArea.
  */
 
 #include "BitAllocator.h"
@@ -71,7 +73,7 @@ BitMapArea* BmapEntityListIter::next()
 
   if (m_cur_idx == m_list->size() &&
       m_wrap) {
-    m_cur_idx %= m_list->size();
+    m_cur_idx = 0;
     m_wrapped = true;
   }
   if (cur_idx == m_list->size()) {
index ada3f1f1f9b6941b29de7f72a4ee114a7c86069b..3184890ba66efb86d82804fdc13a207c9acd9659 100644 (file)
@@ -97,7 +97,6 @@ public:
        */
       if (!m_end) {
         m_end = true;
-        //return m_list->get_nth_item(cur_idx);
         return &(*m_list)[cur_idx];
       }
       return NULL;
@@ -106,7 +105,7 @@ public:
 
     if (m_cur_idx == m_list->size() &&
         m_wrap) {
-      m_cur_idx %= m_list->size();
+      m_cur_idx = 0;
       m_wrapped = true;
     }