From 17d6a993fc17d533460c5f40f3908c708e057c18 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 23 May 2024 18:45:17 +0200 Subject: Merging upstream version 18.2.3. Signed-off-by: Daniel Baumann --- src/librbd/ObjectMap.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/librbd/ObjectMap.h') diff --git a/src/librbd/ObjectMap.h b/src/librbd/ObjectMap.h index 8b5b352ef..35ea4cb88 100644 --- a/src/librbd/ObjectMap.h +++ b/src/librbd/ObjectMap.h @@ -45,6 +45,12 @@ public: return m_object_map.size(); } + template + auto with_object_map(F&& f, Args&&... args) const { + std::shared_lock locker(m_lock); + return std::forward(f)(m_object_map, std::forward(args)...); + } + inline void set_state(uint64_t object_no, uint8_t new_state, const boost::optional ¤t_state) { std::unique_lock locker{m_lock}; -- cgit v1.2.3