mirror of
https://github.com/ceph/ceph
synced 2024-12-28 14:34:13 +00:00
os/bluestore: drop old bluestore_extent_t
Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
80d789f1a1
commit
bd6471fdc9
@ -98,39 +98,6 @@ void bluestore_cnode_t::generate_test_instances(list<bluestore_cnode_t*>& o)
|
||||
o.push_back(new bluestore_cnode_t(123));
|
||||
}
|
||||
|
||||
// bluestore_extent_t
|
||||
|
||||
string bluestore_extent_t::get_flags_string(unsigned flags)
|
||||
{
|
||||
string s;
|
||||
if (flags & FLAG_SHARED) {
|
||||
s = "shared";
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
void bluestore_extent_t::dump(Formatter *f) const
|
||||
{
|
||||
f->dump_unsigned("offset", offset);
|
||||
f->dump_unsigned("length", length);
|
||||
f->dump_unsigned("flags", flags);
|
||||
}
|
||||
|
||||
void bluestore_extent_t::generate_test_instances(list<bluestore_extent_t*>& o)
|
||||
{
|
||||
o.push_back(new bluestore_extent_t());
|
||||
o.push_back(new bluestore_extent_t(123, 456));
|
||||
o.push_back(new bluestore_extent_t(789, 1024, 322));
|
||||
}
|
||||
|
||||
ostream& operator<<(ostream& out, const bluestore_extent_t& e)
|
||||
{
|
||||
out << e.offset << "~" << e.length;
|
||||
if (e.flags)
|
||||
out << ":" << bluestore_extent_t::get_flags_string(e.flags);
|
||||
return out;
|
||||
}
|
||||
|
||||
// bluestore_extent_ref_map_t
|
||||
|
||||
void bluestore_extent_ref_map_t::_check() const
|
||||
|
@ -54,52 +54,6 @@ struct bluestore_cnode_t {
|
||||
};
|
||||
WRITE_CLASS_ENCODER(bluestore_cnode_t)
|
||||
|
||||
/// extent: a byte extent back by the block device
|
||||
struct bluestore_extent_t {
|
||||
enum {
|
||||
FLAG_SHARED = 2, ///< extent is shared by another object, and refcounted
|
||||
};
|
||||
static string get_flags_string(unsigned flags);
|
||||
|
||||
uint64_t offset;
|
||||
uint32_t length;
|
||||
uint32_t flags; /// or reserved
|
||||
|
||||
bluestore_extent_t(uint64_t o=0, uint32_t l=0, uint32_t f=0)
|
||||
: offset(o), length(l), flags(f) {}
|
||||
|
||||
uint64_t end() const {
|
||||
return offset + length;
|
||||
}
|
||||
|
||||
bool has_flag(unsigned f) const {
|
||||
return flags & f;
|
||||
}
|
||||
void set_flag(unsigned f) {
|
||||
flags |= f;
|
||||
}
|
||||
void clear_flag(unsigned f) {
|
||||
flags &= ~f;
|
||||
}
|
||||
|
||||
void encode(bufferlist& bl) const {
|
||||
::encode(offset, bl);
|
||||
::encode(length, bl);
|
||||
::encode(flags, bl);
|
||||
}
|
||||
void decode(bufferlist::iterator& p) {
|
||||
::decode(offset, p);
|
||||
::decode(length, p);
|
||||
::decode(flags, p);
|
||||
}
|
||||
void dump(Formatter *f) const;
|
||||
static void generate_test_instances(list<bluestore_extent_t*>& o);
|
||||
};
|
||||
WRITE_CLASS_ENCODER(bluestore_extent_t)
|
||||
|
||||
ostream& operator<<(ostream& out, const bluestore_extent_t& bp);
|
||||
|
||||
|
||||
/// pextent: physical extent
|
||||
struct bluestore_pextent_t {
|
||||
const static uint64_t INVALID_OFFSET = ~0ull;
|
||||
|
@ -119,7 +119,6 @@ TYPE(SequencerPosition)
|
||||
#include "os/bluestore/bluestore_types.h"
|
||||
TYPE(bluestore_cnode_t)
|
||||
TYPE(bluestore_compression_header_t)
|
||||
TYPE(bluestore_extent_t)
|
||||
TYPE(bluestore_extent_ref_map_t)
|
||||
TYPE(bluestore_overlay_t)
|
||||
TYPE(bluestore_pextent_t)
|
||||
|
Loading…
Reference in New Issue
Block a user