From bd6471fdc9bef83a916021aadb37f797b98fedbb Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 15 Jun 2016 05:17:30 -0400 Subject: [PATCH] os/bluestore: drop old bluestore_extent_t Signed-off-by: Sage Weil --- src/os/bluestore/bluestore_types.cc | 33 --------------------- src/os/bluestore/bluestore_types.h | 46 ----------------------------- src/test/encoding/types.h | 1 - 3 files changed, 80 deletions(-) diff --git a/src/os/bluestore/bluestore_types.cc b/src/os/bluestore/bluestore_types.cc index 6ba849520cb..cc0e1a6bd1d 100644 --- a/src/os/bluestore/bluestore_types.cc +++ b/src/os/bluestore/bluestore_types.cc @@ -98,39 +98,6 @@ void bluestore_cnode_t::generate_test_instances(list& 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& 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 diff --git a/src/os/bluestore/bluestore_types.h b/src/os/bluestore/bluestore_types.h index f47e8175360..db6f8661676 100644 --- a/src/os/bluestore/bluestore_types.h +++ b/src/os/bluestore/bluestore_types.h @@ -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& 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; diff --git a/src/test/encoding/types.h b/src/test/encoding/types.h index 7a274ad82f1..2594e4ac3f2 100644 --- a/src/test/encoding/types.h +++ b/src/test/encoding/types.h @@ -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)