]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os: do not capture unused variables
authorKefu Chai <kchai@redhat.com>
Wed, 16 Jun 2021 10:34:36 +0000 (18:34 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 16 Jun 2021 11:09:04 +0000 (19:09 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/os/seastore/random_block_manager/nvme_manager.cc
src/crimson/os/seastore/random_block_manager/nvmedevice.cc

index af521abdb8c8f0d6c836751ce5339b3befc5627d..44853c1ef670528c02b3f2da8a173937b4e9f6bd 100644 (file)
@@ -69,7 +69,7 @@ NVMeManager::mkfs_ertr::future<> NVMeManager::initialize_blk_alloc_area() {
             start,
             end,
             bitmap_op_types_t::ALL_CLEAR
-           ).safe_then([this, b_block, start]() mutable {
+           ).safe_then([this, b_block]() mutable {
       /*
        * Set rest of the block bitmap, which is not used, to 1
        * To do so, we only mark 1 to empty bitmap blocks
@@ -120,7 +120,7 @@ NVMeManager::mkfs_ertr::future<> NVMeManager::mkfs(mkfs_config_t config)
   logger().debug("path {}", path);
   return _open_device(path).safe_then([this, &config]() {
     return read_rbm_header(config.start
-       ).safe_then([this, &config](auto super) {
+       ).safe_then([](auto super) {
          logger().debug(" already exists ");
          return mkfs_ertr::now();
        }).handle_error(
@@ -185,7 +185,7 @@ NVMeManager::find_block_ret NVMeManager::find_free_block(Transaction &t, size_t
            addr,
            bp
            ).safe_then(
-             [&bp, &addr, size, &allocated, &t, &alloc_extent, this]() mutable {
+             [&bp, &addr, size, &allocated, &alloc_extent, this]() mutable {
              logger().debug("find_free_list: allocate {}, addr {}", allocated, addr);
              rbm_bitmap_block_t b_block(super.block_size);
              bufferlist bl_bitmap_block;
@@ -225,7 +225,7 @@ NVMeManager::find_block_ret NVMeManager::find_free_block(Transaction &t, size_t
              }
              return find_block_ertr::make_ready_future<bool>(false);
              });
-       }).safe_then([&allocated, &alloc_extent, &t, size, this] () {
+       }).safe_then([&allocated, &alloc_extent, size, this] () {
          logger().debug(" allocated: {} size {} ",
                          allocated * super.block_size, size);
          if (allocated * super.block_size < size) {
@@ -258,7 +258,7 @@ NVMeManager::allocate_ertr::future<> NVMeManager::alloc_extent(
    *
    */
   return find_free_block(t, size
-      ).safe_then([this, &t, size] (auto alloc_extent) mutable
+      ).safe_then([] (auto alloc_extent) mutable
        -> allocate_ertr::future<> {
        logger().debug("after find_free_block: allocated {}", alloc_extent);
        if (!alloc_extent.empty()) {
@@ -374,7 +374,7 @@ NVMeManager::write_ertr::future<> NVMeManager::rbm_sync_block_bitmap_by_range(
        return device->read(
            next_addr,
            bptr).safe_then(
-             [bptr, bl_bitmap_block, start, end, op, addr, this]() mutable {
+             [bptr, bl_bitmap_block, end, op, addr, this]() mutable {
              rbm_bitmap_block_t b_block(super.block_size);
              bufferlist block;
              block.append(bptr);
@@ -432,7 +432,7 @@ NVMeManager::write_ertr::future<> NVMeManager::sync_allocation(
          [&, this] (auto &alloc_blocks) mutable {
     return crimson::do_for_each(
        alloc_blocks,
-       [this, &alloc_blocks](auto &alloc) {
+       [this](auto &alloc) {
          return crimson::do_for_each(
              alloc.alloc_blk_ids,
              [this, &alloc] (auto &range) -> write_ertr::future<> {
@@ -533,10 +533,7 @@ NVMeManager::open_ertr::future<> NVMeManager::_open_device(
     const std::string path)
 {
   ceph_assert(device);
-  return device->open(path, seastar::open_flags::rw
-      ).safe_then([this] {
-       return open_ertr::now();
-  });
+  return device->open(path, seastar::open_flags::rw);
 }
 
 NVMeManager::write_ertr::future<> NVMeManager::write_rbm_header()
@@ -554,7 +551,7 @@ NVMeManager::write_ertr::future<> NVMeManager::write_rbm_header()
   iter.copy(bl.length(), bp.c_str());
 
   return device->write(super.start, bp
-      ).safe_then([this]() {
+      ).safe_then([] {
        return write_ertr::now();
        });
 }
index 518fe93d3f63da551ba1e9c720883044119105dc..4402c85c8477b9ef7ac4c8af2b81608c618dbbbb 100644 (file)
@@ -51,7 +51,7 @@ write_ertr::future<> PosixNVMeDevice::write(
   assert((length % block_size) == 0);
 
   return device.dma_write(offset, bptr.c_str(), length).handle_exception(
-    [length](auto e) -> write_ertr::future<size_t> {
+    [](auto e) -> write_ertr::future<size_t> {
       logger().error("write: dma_write got error{}", e);
       return crimson::ct_error::input_output_error::make();
     }).then([length](auto result) -> write_ertr::future<> {
@@ -75,7 +75,7 @@ read_ertr::future<> PosixNVMeDevice::read(
   assert((length % block_size) == 0);
 
   return device.dma_read(offset, bptr.c_str(), length).handle_exception(
-    [length](auto e) -> read_ertr::future<size_t> {
+    [](auto e) -> read_ertr::future<size_t> {
       logger().error("read: dma_read got error{}", e);
       return crimson::ct_error::input_output_error::make();
     }).then([length](auto result) -> read_ertr::future<> {