From 5c4a65a5218525f0f1ce4ac87d43e487c9671fbe Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Sat, 4 Jun 2016 11:55:28 +0800 Subject: [PATCH] bluestore/BitAllocator: literal cleanups Signed-off-by: xie xingguo --- src/os/bluestore/BitAllocator.cc | 18 ++++++++++-------- src/os/bluestore/BitAllocator.h | 3 +-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/os/bluestore/BitAllocator.cc b/src/os/bluestore/BitAllocator.cc index b92c73aafa27..28ca534ed033 100644 --- a/src/os/bluestore/BitAllocator.cc +++ b/src/os/bluestore/BitAllocator.cc @@ -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()) { diff --git a/src/os/bluestore/BitAllocator.h b/src/os/bluestore/BitAllocator.h index ada3f1f1f9b6..3184890ba66e 100644 --- a/src/os/bluestore/BitAllocator.h +++ b/src/os/bluestore/BitAllocator.h @@ -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; } -- 2.47.3