Refine actions taken in close_db_environment. Its role is to close
db handle and environment when db was used in special modes - repair/reshard,
and is not actually open to typical r/w.
Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
if (db) {
_close_db();
}
+ _close_around_db();
+}
+
+void BlueStore::_close_around_db()
+{
if (bluefs) {
_close_bluefs();
}
int BlueStore::close_db_environment()
{
- _close_db_and_around();
+ if (db) {
+ delete db;
+ db = nullptr;
+ }
+ _close_around_db();
return 0;
}
*/
int _open_db_and_around(bool read_only, bool to_repair = false);
void _close_db_and_around();
+ void _close_around_db();
int _prepare_db_environment(bool create, bool read_only,
std::string* kv_dir, std::string* kv_backend);