Skip to content

Commit

Permalink
Merge pull request ceph#42705 from tchaikov/wip-clang-fixes
Browse files Browse the repository at this point in the history
crimson, test/crimson, msg: clang fixes

Reviewed-by: Samuel Just <[email protected]>
  • Loading branch information
tchaikov authored Aug 6, 2021
2 parents b626a04 + e638979 commit ca83705
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ class TreeBuilder {
seastar::stop_iteration::yes);
}
auto p_kv = **ref_kv_iter;
return tree->find(t, p_kv->key).si_then([this, cursors, ref_kv_iter](auto cursor) {
return tree->find(t, p_kv->key).si_then([cursors, ref_kv_iter](auto cursor) {
auto p_kv = **ref_kv_iter;
validate_cursor_from_item(p_kv->key, p_kv->value, cursor);
cursors->emplace(p_kv->key, cursor);
Expand Down
2 changes: 2 additions & 0 deletions src/msg/async/compression_onwire.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#ifndef CEPH_COMPRESSION_ONWIRE_H
#define CEPH_COMPRESSION_ONWIRE_H

#include <optional>

#include "compressor/Compressor.h"
#include "include/buffer.h"

Expand Down
20 changes: 15 additions & 5 deletions src/test/crimson/seastore/onode_tree/test_staged_fltree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,9 @@ TEST_F(b_dummy_tree_test_t, 3_random_insert_erase_leaf_node)
for (auto& [k, val] : insert_history) {
auto& [v, c] = val;
// validate values in tree keep intact
auto cursor = INTR_R(tree.find, t, k).unsafe_get0();
auto cursor = with_trans_intr(t, [this, &k=k](auto& tr) {
return tree.find(tr, k);
}).unsafe_get0();
EXPECT_NE(cursor, tree.end());
validate_cursor_from_item(k, v, cursor);
// validate values in cursors keep intact
Expand Down Expand Up @@ -423,7 +425,9 @@ TEST_F(b_dummy_tree_test_t, 3_random_insert_erase_leaf_node)
// randomized erase until empty
std::random_shuffle(kvs.begin(), kvs.end());
for (auto& [k, v] : kvs) {
auto e_size = INTR_R(tree.erase, t, k).unsafe_get0();
auto e_size = with_trans_intr(t, [this, &k=k](auto& tr) {
return tree.erase(tr, k);
}).unsafe_get0();
ASSERT_EQ(e_size, 1);
}
auto cursor = INTR(tree.begin, t).unsafe_get0();
Expand Down Expand Up @@ -543,7 +547,9 @@ class TestTree {

for (auto& [k, val] : insert_history) {
auto& [v, c] = val;
auto result = INTR_R(tree_clone.find, t_clone, k).unsafe_get0();
auto result = with_trans_intr(t_clone, [&tree_clone, &k=k] (auto& tr) {
return tree_clone.find(tr, k);
}).unsafe_get0();
EXPECT_NE(result, tree_clone.end());
validate_cursor_from_item(k, v, result);
}
Expand All @@ -555,7 +561,9 @@ class TestTree {

// erase and merge
logger().info("\n\nERASE-MERGE {}:", key_hobj_t(key));
auto nxt_cursor = INTR(cursor.erase<true>, t_clone).unsafe_get0();
auto nxt_cursor = with_trans_intr(t_clone, [&cursor=cursor](auto& tr) {
return cursor.erase<true>(tr);
}).unsafe_get0();

{
// track root again to dump
Expand All @@ -577,7 +585,9 @@ class TestTree {

for (auto& [k, val] : insert_history) {
auto& [v, c] = val;
auto result = INTR_R(tree_clone.find, t_clone, k).unsafe_get0();
auto result = with_trans_intr(t_clone, [&tree_clone, &k=k](auto& tr) {
return tree_clone.find(tr, k);
}).unsafe_get0();
EXPECT_NE(result, tree_clone.end());
validate_cursor_from_item(k, v, result);
}
Expand Down
1 change: 0 additions & 1 deletion src/test/crimson/seastore/test_omap_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,6 @@ TEST_F(omap_manager_test_t, replay)
check_mappings(omap_root, *t);
check_mappings(omap_root);
}
i++;
}
logger().debug("finally submitting transaction ");
submit_transaction(std::move(t));
Expand Down

0 comments on commit ca83705

Please sign in to comment.