mirror of
https://github.com/ceph/ceph
synced 2025-02-24 19:47:44 +00:00
Merge pull request #58356 from xxhdx1985126/wip-seastore-onode-name
crimson/os/seastore/onode: add hobject_t into Onode Reviewed-by: Yingxin Cheng <yingxin.cheng@intel.com>
This commit is contained in:
commit
520c8dfc0c
@ -10,6 +10,7 @@ std::ostream& operator<<(std::ostream &out, const Onode &rhs)
|
||||
{
|
||||
auto &layout = rhs.get_layout();
|
||||
return out << "Onode("
|
||||
<< "hobj=" << rhs.hobj << ", "
|
||||
<< "size=" << static_cast<uint32_t>(layout.size)
|
||||
<< ")";
|
||||
}
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <boost/intrusive_ptr.hpp>
|
||||
#include <boost/smart_ptr/intrusive_ref_counter.hpp>
|
||||
|
||||
#include "common/hobject.h"
|
||||
#include "include/byteorder.h"
|
||||
#include "seastore_types.h"
|
||||
|
||||
@ -56,10 +57,12 @@ protected:
|
||||
virtual laddr_t get_hint() const = 0;
|
||||
const uint32_t default_metadata_offset = 0;
|
||||
const uint32_t default_metadata_range = 0;
|
||||
const hobject_t hobj;
|
||||
public:
|
||||
Onode(uint32_t ddr, uint32_t dmr)
|
||||
Onode(uint32_t ddr, uint32_t dmr, const hobject_t &hobj)
|
||||
: default_metadata_offset(ddr),
|
||||
default_metadata_range(dmr)
|
||||
default_metadata_range(dmr),
|
||||
hobj(hobj)
|
||||
{}
|
||||
|
||||
virtual bool is_alive() const = 0;
|
||||
@ -85,6 +88,7 @@ public:
|
||||
laddr_t get_data_hint() const {
|
||||
return get_hint();
|
||||
}
|
||||
friend std::ostream& operator<<(std::ostream &out, const Onode &rhs);
|
||||
};
|
||||
|
||||
|
||||
|
@ -151,6 +151,7 @@ FLTreeOnodeManager::get_onode_ret FLTreeOnodeManager::get_onode(
|
||||
auto val = OnodeRef(new FLTreeOnode(
|
||||
default_data_reservation,
|
||||
default_metadata_range,
|
||||
hoid.hobj,
|
||||
cursor.value()));
|
||||
return get_onode_iertr::make_ready_future<OnodeRef>(
|
||||
val
|
||||
@ -173,6 +174,7 @@ FLTreeOnodeManager::get_or_create_onode(
|
||||
auto onode = new FLTreeOnode(
|
||||
default_data_reservation,
|
||||
default_metadata_range,
|
||||
hoid.hobj,
|
||||
cursor.value());
|
||||
if (created) {
|
||||
DEBUGT("created onode for entry for {}", trans, hoid);
|
||||
|
@ -36,13 +36,13 @@ struct FLTreeOnode final : Onode, Value {
|
||||
FLTreeOnode& operator=(const FLTreeOnode&) = delete;
|
||||
|
||||
template <typename... T>
|
||||
FLTreeOnode(uint32_t ddr, uint32_t dmr, T&&... args)
|
||||
: Onode(ddr, dmr),
|
||||
FLTreeOnode(uint32_t ddr, uint32_t dmr, const hobject_t &hobj, T&&... args)
|
||||
: Onode(ddr, dmr, hobj),
|
||||
Value(std::forward<T>(args)...) {}
|
||||
|
||||
template <typename... T>
|
||||
FLTreeOnode(T&&... args)
|
||||
: Onode(0, 0),
|
||||
FLTreeOnode(const hobject_t &hobj, T&&... args)
|
||||
: Onode(0, 0, hobj),
|
||||
Value(std::forward<T>(args)...) {}
|
||||
|
||||
struct Recorder : public ValueDeltaRecorder {
|
||||
|
@ -92,7 +92,7 @@ class Btree {
|
||||
ValueImpl value() {
|
||||
assert(!is_end());
|
||||
return p_tree->value_builder.build_value(
|
||||
*p_tree->nm, p_tree->value_builder, p_cursor);
|
||||
get_ghobj().hobj, *p_tree->nm, p_tree->value_builder, p_cursor);
|
||||
}
|
||||
|
||||
bool operator==(const Cursor& o) const { return operator<=>(o) == 0; }
|
||||
|
@ -312,11 +312,12 @@ struct ValueBuilderImpl final : public ValueBuilder {
|
||||
return ret;
|
||||
}
|
||||
|
||||
ValueImpl build_value(NodeExtentManager& nm,
|
||||
ValueImpl build_value(const hobject_t &hobj,
|
||||
NodeExtentManager& nm,
|
||||
const ValueBuilder& vb,
|
||||
Ref<tree_cursor_t>& p_cursor) const {
|
||||
assert(vb.get_header_magic() == get_header_magic());
|
||||
return ValueImpl(nm, vb, p_cursor);
|
||||
return ValueImpl(hobj, nm, vb, p_cursor);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -176,7 +176,11 @@ class TestValue final : public Value {
|
||||
}
|
||||
};
|
||||
|
||||
TestValue(NodeExtentManager& nm, const ValueBuilder& vb, Ref<tree_cursor_t>& p_cursor)
|
||||
TestValue(
|
||||
const hobject_t &hobj,
|
||||
NodeExtentManager& nm,
|
||||
const ValueBuilder& vb,
|
||||
Ref<tree_cursor_t>& p_cursor)
|
||||
: Value(nm, vb, p_cursor) {}
|
||||
~TestValue() override = default;
|
||||
|
||||
|
@ -26,7 +26,7 @@ class TestOnode final : public Onode {
|
||||
bool dirty = false;
|
||||
|
||||
public:
|
||||
TestOnode(uint32_t ddr, uint32_t dmr) : Onode(ddr, dmr) {}
|
||||
TestOnode(uint32_t ddr, uint32_t dmr) : Onode(ddr, dmr, hobject_t()) {}
|
||||
const onode_layout_t &get_layout() const final {
|
||||
return layout;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user