diff options
author | Radosław Zarzyński <rzarzyns@redhat.com> | 2023-09-07 12:07:13 +0200 |
---|---|---|
committer | Radoslaw Zarzynski <rzarzyns@redhat.com> | 2024-01-09 16:09:53 +0100 |
commit | e6d3659021dc17cdb5712d58787f3aaf54ebe8a4 (patch) | |
tree | 8c0d9246f00fa12e5e8d2da06171b154f4d5c2f8 /src/crimson/osd/pg_backend.h | |
parent | fix a crash due to RecoveryMessages life-time mgmt (diff) | |
download | ceph-e6d3659021dc17cdb5712d58787f3aaf54ebe8a4.tar.xz ceph-e6d3659021dc17cdb5712d58787f3aaf54ebe8a4.zip |
osd: refactor accessors of RecoveryBackend::temp_contents
1. Move some of them to .cc and
2. switch their implementations to use lower-layer methods
instead of touching `temp_contents` directly.
Signed-off-by: Radosław Zarzyński <rzarzyns@redhat.com>
Diffstat (limited to 'src/crimson/osd/pg_backend.h')
-rw-r--r-- | src/crimson/osd/pg_backend.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/crimson/osd/pg_backend.h b/src/crimson/osd/pg_backend.h index 981a983075b..de7223173f1 100644 --- a/src/crimson/osd/pg_backend.h +++ b/src/crimson/osd/pg_backend.h @@ -450,4 +450,22 @@ private: std::vector<pg_log_entry_t>&& log_entries) = 0; friend class ReplicatedRecoveryBackend; friend class ::crimson::osd::PG; + +protected: + boost::container::flat_set<hobject_t> temp_contents; + + template <class... Args> + void add_temp_obj(Args&&... args) { + temp_contents.insert(std::forward<Args>(args)...); + } + void clear_temp_obj(const hobject_t &oid) { + temp_contents.erase(oid); + } + template <class T> + void clear_temp_objs(const T &cont) { + for (const auto& oid : cont) { + clear_temp_obj(oid); + } + } + friend class RecoveryBackend; }; |