From: Samuel Just Date: Wed, 15 Jul 2020 23:43:49 +0000 (-0700) Subject: crimson/os/seastore/cached_extent: add has_pin and is_logical helpers X-Git-Tag: v16.1.0~1513^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a70ec1741996072a38abeffb82df08ea569abca7;p=ceph.git crimson/os/seastore/cached_extent: add has_pin and is_logical helpers Signed-off-by: Samuel Just --- diff --git a/src/crimson/os/seastore/cached_extent.h b/src/crimson/os/seastore/cached_extent.h index 66d8e46858c..77a298b7534 100644 --- a/src/crimson/os/seastore/cached_extent.h +++ b/src/crimson/os/seastore/cached_extent.h @@ -108,6 +108,10 @@ public: */ 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 { @@ -526,7 +530,14 @@ public: template LogicalCachedExtent(T&&... t) : CachedExtent(std::forward(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); @@ -543,6 +554,10 @@ public: 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;