Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / os / bluestore / FreelistManager.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #include "FreelistManager.h"
5 #include "BitmapFreelistManager.h"
6
7 FreelistManager *FreelistManager::create(
8   CephContext* cct,
9   string type,
10   KeyValueDB *kvdb,
11   string prefix)
12 {
13   // a bit of a hack... we hard-code the prefixes here.  we need to
14   // put the freelistmanagers in different prefixes because the merge
15   // op is per prefix, has to done pre-db-open, and we don't know the
16   // freelist type until after we open the db.
17   assert(prefix == "B");
18   if (type == "bitmap")
19     return new BitmapFreelistManager(cct, kvdb, "B", "b");
20   return NULL;
21 }
22
23 void FreelistManager::setup_merge_operators(KeyValueDB *db)
24 {
25   BitmapFreelistManager::setup_merge_operator(db, "b");
26 }