Skip to content

Commit

Permalink
Merge pull request #45049 from liu-chunmei/crimson-clang-warning-cleanup
Browse files Browse the repository at this point in the history
crimson: eliminate clang build warning in crimson

Reviewed-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Reviewed-by: Ronen Friedman <rfriedma@redhat.com>
  • Loading branch information
athanatos committed Feb 16, 2022
2 parents 88eb23e + 3d7d6db commit 74b7fe8
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/crimson/os/seastore/lba_manager/btree/lba_btree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ LBABtree::find_insertion_ret LBABtree::find_insertion(
return iter.prev(
c
).si_then([laddr, &iter](auto p) {
boost::ignore_unused(laddr); // avoid clang warning;
assert(p.leaf.node->get_node_meta().begin <= laddr);
assert(p.get_key() < laddr);
// Note, this is specifically allowed to violate the iterator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ OMapInnerNode::list(
start,
config.with_reduced_max(result.size())
).si_then([&, config](auto &&child_ret) mutable {
boost::ignore_unused(config); // avoid clang warning;
auto &[child_complete, child_result] = child_ret;
if (result.size() && child_result.size()) {
assert(child_result.begin()->first > result.rbegin()->first);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ class NodeExtentAccessorT {
})
);
}).si_then([this, c] {
boost::ignore_unused(c); // avoid clang warning;
assert(!c.t.is_conflicted());
return *mut;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ class TreeBuilder {
return tree->insert(
t, p_kv->key, {p_kv->value.get_payload_size()}
).si_then([&t, this, p_kv](auto ret) {
boost::ignore_unused(this); // avoid clang warning;
auto success = ret.second;
auto cursor = std::move(ret.first);
initialize_cursor_from_item(t, p_kv->key, p_kv->value, cursor, success);
Expand Down Expand Up @@ -401,6 +402,9 @@ class TreeBuilder {
p_kv->value);
return tree->erase(t, p_kv->key
).si_then([&t, this, p_kv] (auto size) {
boost::ignore_unused(t); // avoid clang warning;
boost::ignore_unused(this);
boost::ignore_unused(p_kv);
ceph_assert(size == 1);
#ifndef NDEBUG
return tree->contains(t, p_kv->key
Expand Down
4 changes: 3 additions & 1 deletion src/crimson/os/seastore/seastore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ SeaStore::mount_ertr::future<> SeaStore::mount()
oss << root << "/block." << dtype << "." << std::to_string(id);
auto sm = std::make_unique<
segment_manager::block::BlockSegmentManager>(oss.str());
return sm->mount().safe_then([this, sm=std::move(sm), magic]() mutable {
return sm->mount().safe_then(
[this, sm=std::move(sm), magic]() mutable {
boost::ignore_unused(magic); // avoid clang warning;
assert(sm->get_magic() == magic);
transaction_manager->add_segment_manager(sm.get());
secondaries.emplace_back(std::move(sm));
Expand Down
1 change: 1 addition & 0 deletions src/crimson/os/seastore/seastore_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <optional>
#include <iostream>
#include <vector>
#include <boost/core/ignore_unused.hpp>

#include "include/byteorder.h"
#include "include/denc.h"
Expand Down
1 change: 0 additions & 1 deletion src/crimson/tools/store_nbd/fs_driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ seastar::future<> FSDriver::mkfs()
return init(
).then([this] {
assert(fs);
}).then([this] {
return fs->start();
}).then([this] {
uuid_d uuid;
Expand Down
1 change: 1 addition & 0 deletions src/crimson/tools/store_nbd/tm_driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ seastar::future<> TMDriver::write(
logger().debug("dec_ref complete");
return tm->alloc_extent<TestBlock>(t, offset, ptr.length());
}).si_then([this, offset, &t, &ptr](auto ext) {
boost::ignore_unused(offset); // avoid clang warning;
assert(ext->get_laddr() == (size_t)offset);
assert(ext->get_bptr().length() == ptr.length());
ext->get_bptr().swap(ptr);
Expand Down

0 comments on commit 74b7fe8

Please sign in to comment.