From 6c82e66dde715e5e4e12261655c5e7b521871453 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 --- 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 8d0a39e4234..0d0b4bd5ff0 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 7746483c3d3..0a61322cd6d 100644 --- a/src/os/filestore/DBObjectMap.h +++ b/src/os/filestore/DBObjectMap.h @@ -58,6 +58,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 */