From 8e95904e25a8b1fc731ba3ef57f0949987a0b4f9 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 10 Apr 2018 12:55:55 -0500 Subject: [PATCH] os/ObjectMap: add get_db() accessor This is just to let us get at the underlying KeyValueDB for DBObjectMap. It is not really better or worse than adding accessors for things like GetEstimatedSize() to ObjectMap. Signed-off-by: Sage Weil (cherry picked from commit 6c82e66dde715e5e4e12261655c5e7b521871453) --- src/os/ObjectMap.h | 1 + src/os/filestore/DBObjectMap.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/os/ObjectMap.h b/src/os/ObjectMap.h index 4db3f17dc4ba5..31d413d7fee26 100644 --- a/src/os/ObjectMap.h +++ b/src/os/ObjectMap.h @@ -162,6 +162,7 @@ public: return ObjectMapIterator(); } + virtual KeyValueDB *get_db() { return nullptr; } ObjectMap(CephContext* cct) : cct(cct) {} virtual ~ObjectMap() {} diff --git a/src/os/filestore/DBObjectMap.h b/src/os/filestore/DBObjectMap.h index 4d9bda912cbde..15d74aa87af2c 100644 --- a/src/os/filestore/DBObjectMap.h +++ b/src/os/filestore/DBObjectMap.h @@ -59,6 +59,8 @@ class DBObjectMap : public ObjectMap { public: boost::scoped_ptr db; + KeyValueDB *get_db() override { return db.get(); } + /** * Serializes access to next_seq as well as the in_use set */ -- 2.39.5