]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: rename apply to apply_for_bitset_range
authorIgor Fedotov <ifedotov@suse.com>
Mon, 18 Nov 2019 09:29:51 +0000 (12:29 +0300)
committerIgor Fedotov <ifedotov@suse.com>
Mon, 18 Nov 2019 09:52:53 +0000 (12:52 +0300)
Signed-off-by: Igor Fedotov <ifedotov@suse.com>
src/os/bluestore/BlueFS.cc
src/os/bluestore/BlueStore.cc
src/os/bluestore/bluestore_common.h

index 519a429003ad0b0db5278abecb495591212959c5..6de7df5f4918d4eeff7cdb3bfdc12f46a4f72fdf 100644 (file)
@@ -767,7 +767,7 @@ int BlueFS::_check_new_allocations(const bluefs_fnode_t& fnode,
     auto id = e.bdev;
     bool fail = false;
     ceph_assert(id < dev_count);
-    apply(e.offset, e.length, alloc_size[id], owned_blocks[id],
+    apply_for_bitset_range(e.offset, e.length, alloc_size[id], owned_blocks[id],
       [&](uint64_t pos, boost::dynamic_bitset<uint64_t> &bs) {
         ceph_assert(pos < bs.size());
         if (!bs.test(pos)) {
@@ -784,7 +784,7 @@ int BlueFS::_check_new_allocations(const bluefs_fnode_t& fnode,
       return -EFAULT;
     }
 
-    apply(e.offset, e.length, alloc_size[id], used_blocks[id],
+    apply_for_bitset_range(e.offset, e.length, alloc_size[id], used_blocks[id],
       [&](uint64_t pos, boost::dynamic_bitset<uint64_t> &bs) {
         ceph_assert(pos < bs.size());
         if (bs.test(pos)) {
@@ -1028,7 +1028,7 @@ int BlueFS::_replay(bool noop, bool to_stdout)
 
             if (cct->_conf->bluefs_log_replay_check_allocations) {
               bool fail = false;
-              apply(offset, length, alloc_size[id], owned_blocks[id],
+              apply_for_bitset_range(offset, length, alloc_size[id], owned_blocks[id],
                 [&](uint64_t pos, boost::dynamic_bitset<uint64_t> &bs) {
                   ceph_assert(pos < bs.size());
                   if (bs.test(pos)) {
@@ -1044,7 +1044,7 @@ int BlueFS::_replay(bool noop, bool to_stdout)
                   << std::dec << ": already given" << dendl;
                 return -EFAULT;
               }
-              apply(offset, length, alloc_size[id], used_blocks[id],
+              apply_for_bitset_range(offset, length, alloc_size[id], used_blocks[id],
                 [&](uint64_t pos, boost::dynamic_bitset<uint64_t> &bs) {
                   ceph_assert(pos < bs.size());
                   
@@ -1087,7 +1087,7 @@ int BlueFS::_replay(bool noop, bool to_stdout)
            alloc[id]->init_rm_free(offset, length);
             if (cct->_conf->bluefs_log_replay_check_allocations) {
               bool fail = false;
-              apply(offset, length, alloc_size[id], owned_blocks[id],
+              apply_for_bitset_range(offset, length, alloc_size[id], owned_blocks[id],
                 [&](uint64_t pos, boost::dynamic_bitset<uint64_t> &bs) {
                   ceph_assert(pos < bs.size());
                   if (!bs.test(pos)) {
@@ -1104,7 +1104,7 @@ int BlueFS::_replay(bool noop, bool to_stdout)
                 return -EFAULT;
               }
 
-              apply(offset, length, alloc_size[id], used_blocks[id],
+              apply_for_bitset_range(offset, length, alloc_size[id], used_blocks[id],
                 [&](uint64_t pos, boost::dynamic_bitset<uint64_t> &bs) {
                   ceph_assert(pos < bs.size());
                   if (bs.test(pos)) {
@@ -1246,7 +1246,7 @@ int BlueFS::_replay(bool noop, bool to_stdout)
               auto& fnode_extents = f->fnode.extents;
               for (auto e : fnode_extents) {
                 auto id = e.bdev;
-                apply(e.offset, e.length, alloc_size[id], used_blocks[id],
+                apply_for_bitset_range(e.offset, e.length, alloc_size[id], used_blocks[id],
                   [&](uint64_t pos, boost::dynamic_bitset<uint64_t> &bs) {
                     ceph_assert(pos < bs.size());
                     ceph_assert(bs.test(pos));
@@ -1290,7 +1290,7 @@ int BlueFS::_replay(bool noop, bool to_stdout)
               for (auto e : fnode_extents) {
                 auto id = e.bdev;
                 bool fail = false;
-                apply(e.offset, e.length, alloc_size[id], owned_blocks[id],
+                apply_for_bitset_range(e.offset, e.length, alloc_size[id], owned_blocks[id],
                   [&](uint64_t pos, boost::dynamic_bitset<uint64_t> &bs) {
                     ceph_assert(pos < bs.size());
                     if (!bs.test(pos)) {
@@ -1307,7 +1307,7 @@ int BlueFS::_replay(bool noop, bool to_stdout)
                   return -EFAULT;
                 }
 
-                apply(e.offset, e.length, alloc_size[id], used_blocks[id],
+                apply_for_bitset_range(e.offset, e.length, alloc_size[id], used_blocks[id],
                   [&](uint64_t pos, boost::dynamic_bitset<uint64_t> &bs) {
                     ceph_assert(pos < bs.size());
                     if (!bs.test(pos)) {
index 6e375950cbfe9125d851c916a9657f0c06e56821..f6ccca88047fe9357ebb7e7b09cd0771e23bd786 100644 (file)
@@ -7023,7 +7023,7 @@ int BlueStore::_fsck_check_extents(
     }
     if (depth != FSCK_SHALLOW) {
       bool already = false;
-      apply(
+      apply_for_bitset_range(
         e.offset, e.length, granularity, used_blocks,
         [&](uint64_t pos, mempool_dynamic_bitset &bs) {
          ceph_assert(pos < bs.size());
@@ -8083,7 +8083,7 @@ int BlueStore::_fsck_on_open(BlueStore::FSCKDepth depth, bool repair)
 
   _fsck_collections(&errors);
   used_blocks.resize(fm->get_alloc_units());
-  apply(
+  apply_for_bitset_range(
     0, std::max<uint64_t>(min_alloc_size, SUPER_RESERVED), fm->get_alloc_size(), used_blocks,
     [&](uint64_t pos, mempool_dynamic_bitset &bs) {
        ceph_assert(pos < bs.size());
@@ -8124,7 +8124,7 @@ int BlueStore::_fsck_on_open(BlueStore::FSCKDepth depth, bool repair)
     }
 
     for (auto e = bluefs_extents.begin(); e != bluefs_extents.end(); ++e) {
-      apply(
+      apply_for_bitset_range(
         e.get_start(), e.get_len(), fm->get_alloc_size(), used_blocks,
         [&](uint64_t pos, mempool_dynamic_bitset &bs) {
        ceph_assert(pos < bs.size());
@@ -8598,7 +8598,7 @@ int BlueStore::_fsck_on_open(BlueStore::FSCKDepth depth, bool repair)
                 << " ops " << wt.ops.size()
                 << " released 0x" << std::hex << wt.released << std::dec << dendl;
         for (auto e = wt.released.begin(); e != wt.released.end(); ++e) {
-          apply(
+          apply_for_bitset_range(
             e.get_start(), e.get_len(), fm->get_alloc_size(), used_blocks,
             [&](uint64_t pos, mempool_dynamic_bitset &bs) {
          ceph_assert(pos < bs.size());
@@ -8614,7 +8614,7 @@ int BlueStore::_fsck_on_open(BlueStore::FSCKDepth depth, bool repair)
       // remove bluefs_extents from used set since the freelist doesn't
       // know they are allocated.
       for (auto e = bluefs_extents.begin(); e != bluefs_extents.end(); ++e) {
-        apply(
+        apply_for_bitset_range(
           e.get_start(), e.get_len(), fm->get_alloc_size(), used_blocks,
           [&](uint64_t pos, mempool_dynamic_bitset &bs) {
            ceph_assert(pos < bs.size());
@@ -8626,7 +8626,7 @@ int BlueStore::_fsck_on_open(BlueStore::FSCKDepth depth, bool repair)
       uint64_t offset, length;
       while (fm->enumerate_next(db, &offset, &length)) {
         bool intersects = false;
-        apply(
+        apply_for_bitset_range(
           offset, length, fm->get_alloc_size(), used_blocks,
           [&](uint64_t pos, mempool_dynamic_bitset &bs) {
            ceph_assert(pos < bs.size());
index b9b3a4e0535a237eccc023009a96c5f7d2d9b9d8..876a9c2b24fb1aea8fee33052d48285027ec4e62 100755 (executable)
@@ -18,7 +18,7 @@
 #include "include/intarith.h"
 
 template <class Bitset, class Func>
-void apply(uint64_t off,
+void apply_for_bitset_range(uint64_t off,
   uint64_t len,
   uint64_t granularity,
   Bitset &bitset,