]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
BitAllocator.cc: use static_cast instead of c-style
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 21 Feb 2017 15:23:12 +0000 (16:23 +0100)
committerKefu Chai <kchai@redhat.com>
Mon, 10 Apr 2017 15:34:16 +0000 (23:34 +0800)
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/os/bluestore/BitAllocator.cc

index 22f1ce9a47d478e9d29107f4549de625540058a4..d6fc8a22baf2948a88a5179fae1ed89352423368 100644 (file)
@@ -528,7 +528,7 @@ void BitMapZone::dump_state(CephContext* const cct, int& count)
   BitMapEntityIter <BmapEntry> iter = BitMapEntityIter<BmapEntry>(
           &m_bmap_vec, 0);
   dout(0) << __func__ << " zone " << count << " dump start " << dendl;
-  while ((bmap = (BmapEntry *) iter.next())) {
+  while ((bmap = static_cast<BmapEntry *>(iter.next()))) {
     bmap->dump_state(cct, bmap_idx);
     bmap_idx++;
   }
@@ -770,8 +770,8 @@ bool BitMapAreaIN::is_allocated(int64_t start_block, int64_t num_blocks)
   }
 
   while (num_blocks) {
-    area = (BitMapArea *) m_child_list.get_nth_item(
-                    start_block / m_child_size_blocks);
+    area = static_cast<BitMapArea *>(m_child_list.get_nth_item(
+                    start_block / m_child_size_blocks));
 
     area_block_offset = start_block % m_child_size_blocks;
     falling_in_area = MIN(m_child_size_blocks - area_block_offset,
@@ -795,7 +795,7 @@ int64_t BitMapAreaIN::alloc_blocks_dis_int_work(bool wrap, int64_t num_blocks, i
   BmapEntityListIter iter = BmapEntityListIter(
         &m_child_list, hint / m_child_size_blocks, wrap);
 
-  while ((child = (BitMapArea *) iter.next())) {
+  while ((child = static_cast<BitMapArea *>(iter.next()))) {
     if (!child_check_n_lock(child, 1)) {
       hint = 0;
       continue;
@@ -846,8 +846,8 @@ void BitMapAreaIN::set_blocks_used_int(int64_t start_block, int64_t num_blocks)
   alloc_assert(start_block >= 0);
 
   while (blks) {
-    child = (BitMapArea *) m_child_list.get_nth_item(
-                  start_blk / m_child_size_blocks);
+    child = static_cast<BitMapArea *>(m_child_list.get_nth_item(
+                  start_blk / m_child_size_blocks));
 
     child_block_offset = start_blk % child->size();
     falling_in_child = MIN(m_child_size_blocks - child_block_offset,
@@ -886,8 +886,8 @@ void BitMapAreaIN::free_blocks_int(int64_t start_block, int64_t num_blocks)
   }
 
   while (num_blocks) {
-    child = (BitMapArea *) m_child_list.get_nth_item(
-          start_block / m_child_size_blocks);
+    child = static_cast<BitMapArea *>(m_child_list.get_nth_item(
+          start_block / m_child_size_blocks));
 
     child_block_offset = start_block % m_child_size_blocks;
 
@@ -920,7 +920,7 @@ void BitMapAreaIN::dump_state(CephContext* const cct, int& count)
   BmapEntityListIter iter = BmapEntityListIter(
         &m_child_list, 0, false);
 
-  while ((child = (BitMapArea *) iter.next())) {
+  while ((child = static_cast<BitMapArea *>(iter.next()))) {
     child->dump_state(cct, count);
   }
 }
@@ -974,7 +974,7 @@ BitMapAreaLeaf::~BitMapAreaLeaf()
   lock_excl();
 
   for (int64_t i = 0; i < m_child_list.size(); i++) {
-    BitMapArea *child = (BitMapArea *) m_child_list.get_nth_item(i);
+    auto child = static_cast<BitMapArea *>(m_child_list.get_nth_item(i));
     delete child;
   }
 
@@ -1054,8 +1054,8 @@ void BitMapAreaLeaf::free_blocks_int(int64_t start_block, int64_t num_blocks)
   }
 
   while (num_blocks) {
-    child = (BitMapArea *) m_child_list.get_nth_item(
-          start_block / m_child_size_blocks);
+    child = static_cast<BitMapArea *>(m_child_list.get_nth_item(
+          start_block / m_child_size_blocks));
 
     child_block_offset = start_block % m_child_size_blocks;
 
@@ -1170,7 +1170,7 @@ BitAllocator::~BitAllocator()
   lock_excl();
 
   for (int64_t i = 0; i < m_child_list.size(); i++) {
-    BitMapArea *child = (BitMapArea *) m_child_list.get_nth_item(i);
+    auto child = static_cast<BitMapArea *>(m_child_list.get_nth_item(i));
     delete child;
   }