*/
virtual extent_types_t get_type() const = 0;
+ virtual bool is_logical() const {
+ return false;
+ }
+
friend std::ostream &operator<<(std::ostream &, extent_state_t);
virtual std::ostream &print_detail(std::ostream &out) const { return out; }
std::ostream &print(std::ostream &out) const {
template <typename... T>
LogicalCachedExtent(T&&... t) : CachedExtent(std::forward<T>(t)...) {}
- void set_pin(LBAPinRef &&pin) { this->pin = std::move(pin); }
+ void set_pin(LBAPinRef &&npin) {
+ assert(!pin);
+ pin = std::move(npin);
+ }
+
+ bool has_pin() const {
+ return !!pin;
+ }
LBAPin &get_pin() {
assert(pin);
apply_delta(bl);
set_last_committed_crc(get_crc32c());
}
+
+ bool is_logical() const final {
+ return true;
+ }
protected:
virtual void apply_delta(const ceph::bufferlist &bl) = 0;