Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apply-clang-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ while getopts "v" opt; do
esac
done

find ./src -iname '*.h' -o -iname '*.cpp' -o -iname '*.hpp' -o -iname '*.cc' | xargs clang-format -style=file -i -fallback-style=none
find ./src -iname '*.h' -o -iname '*.cpp' -o -iname '*.hpp' -o -iname '*.cc' -o -iname '*.ipp' | xargs clang-format -style=file -i -fallback-style=none

if [ $VALIDATE ]; then
EXIT_CODE=0
Expand Down
23 changes: 12 additions & 11 deletions src/include/homestore/blk.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ struct multi_blk_id : public blk_id {
iterator(multi_blk_id const& mb) : mbid_{mb} {}
std::optional< blk_id > next() {
if (next_blk_ == 0) {
auto bid = r_cast< blk_id const& >(mbid_);
auto bid = reinterpret_cast< blk_id const& >(mbid_);
++next_blk_;
return (bid.is_valid()) ? std::make_optional(blk_id{bid.blk_num(), bid.blk_count(), bid.chunk_num()})
: std::nullopt;
Expand Down Expand Up @@ -229,7 +229,8 @@ std::basic_ostream< charT, traits >& operator<<(std::basic_ostream< charT, trait
}

template < typename charT, typename traits >
std::basic_ostream< charT, traits >& operator<<(std::basic_ostream< charT, traits >& outStream, multi_blk_id const& blk) {
std::basic_ostream< charT, traits >& operator<<(std::basic_ostream< charT, traits >& outStream,
multi_blk_id const& blk) {
return stream_op< charT, traits, multi_blk_id >(outStream, blk);
}

Expand All @@ -248,16 +249,16 @@ ENUM(BlkAllocStatus, uint32_t,
);

struct blk_alloc_hints {
blk_temp_t desired_temp{0}; // Temperature hint for the device
std::optional< uint32_t > reserved_blks; // Reserved blks in a chunk
std::optional< uint32_t > pdev_id_hint; // which physical device to pick (hint if any) -1 for don't care
std::optional< chunk_num_t > chunk_id_hint; // any specific chunk id to pick for this allocation
blk_temp_t desired_temp{0}; // Temperature hint for the device
std::optional< uint32_t > reserved_blks; // Reserved blks in a chunk
std::optional< uint32_t > pdev_id_hint; // which physical device to pick (hint if any) -1 for don't care
std::optional< chunk_num_t > chunk_id_hint; // any specific chunk id to pick for this allocation
std::optional< multi_blk_id > committed_blk_id; // blk id indicates the blk was already allocated and committed,
// don't allocate and commit again
std::optional< stream_id_t > stream_id_hint; // any specific stream to pick
std::optional< uint64_t > application_hint; // hints in uint64 what will be passed opaque to select_chunk
bool can_look_for_other_chunk{true}; // If alloc on device not available can I pick other device
bool is_contiguous{true}; // Should the entire allocation be one contiguous block
// don't allocate and commit again
std::optional< stream_id_t > stream_id_hint; // any specific stream to pick
std::optional< uint64_t > application_hint; // hints in uint64 what will be passed opaque to select_chunk
bool can_look_for_other_chunk{true}; // If alloc on device not available can I pick other device
bool is_contiguous{true}; // Should the entire allocation be one contiguous block
bool partial_alloc_ok{false}; // ok to allocate only portion of nblks? Mutually exclusive with is_contiguous
uint32_t min_blks_per_piece{1}; // blks allocated in a blkid should be atleast this size per entry
uint32_t max_blks_per_piece{max_blks_per_blkid()}; // Number of blks on every entry
Expand Down
7 changes: 4 additions & 3 deletions src/include/homestore/btree/btree.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@ void Btree< K, V >::set_root_node_info(const BtreeLinkInfo& info) {
}

template < typename K, typename V >
uint16_t Btree< K, V >::get_btree_depth() const {return m_btree_depth;}
uint16_t Btree< K, V >::get_btree_depth() const {
return m_btree_depth;
}

template < typename K, typename V >
std::pair<uint64_t,uint64_t> Btree< K, V >::get_num_nodes() const {
std::pair< uint64_t, uint64_t > Btree< K, V >::get_num_nodes() const {
return {m_total_interior_nodes, m_total_leaf_nodes};
}


template < typename K, typename V >
std::pair< btree_status_t, uint64_t > Btree< K, V >::destroy_btree(void* context) {
btree_status_t ret{btree_status_t::success};
Expand Down
4 changes: 2 additions & 2 deletions src/include/homestore/btree/btree_kv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class BtreeLinkInfo : public BtreeValue {
sisl::blob serialize() const override {
sisl::blob b;
b.set_size(sizeof(bnode_link_info));
b.set_bytes(r_cast< const uint8_t* >(&info));
b.set_bytes(reinterpret_cast< const uint8_t* >(&info));
return b;
}
uint32_t serialized_size() const override { return sizeof(bnode_link_info); }
Expand All @@ -278,7 +278,7 @@ class BtreeLinkInfo : public BtreeValue {

void deserialize(const sisl::blob& b, bool copy) override {
DEBUG_ASSERT_EQ(b.size(), sizeof(bnode_link_info), "BtreeLinkInfo deserialize received invalid blob");
auto other = r_cast< bnode_link_info const* >(b.cbytes());
auto other = reinterpret_cast< bnode_link_info const* >(b.cbytes());
set_bnode_id(other->m_bnodeid);
set_link_version(other->m_link_version);
}
Expand Down
Loading
Loading