#define dout_subsys ceph_subsys_bluestore
-Allocator *Allocator::create(string type)
+Allocator *Allocator::create(string type, int64_t size)
{
if (type == "stupid")
return new StupidAllocator;
virtual uint64_t get_free() = 0;
virtual void shutdown() = 0;
-
- static Allocator *create(string type);
+ static Allocator *create(string type, int64_t size);
};
#endif
dout(20) << __func__ << dendl;
alloc.resize(MAX_BDEV);
for (unsigned id = 0; id < bdev.size(); ++id) {
- if (!bdev[id])
+ if (!bdev[id]) {
continue;
- alloc[id] = Allocator::create(g_conf->bluestore_allocator);
+ }
+ assert(bdev[id]->get_size());
+ alloc[id] = Allocator::create(g_conf->bluestore_allocator, bdev[id]->get_size());
interval_set<uint64_t>& p = block_all[id];
for (interval_set<uint64_t>::iterator q = p.begin(); q != p.end(); ++q) {
alloc[id]->init_add_free(q.get_start(), q.get_len());
int BlueStore::_open_alloc()
{
assert(alloc == NULL);
- alloc = Allocator::create(g_conf->bluestore_allocator);
+ assert(bdev->get_size());
+ alloc = Allocator::create(g_conf->bluestore_allocator, bdev->get_size());
uint64_t num = 0, bytes = 0;
fm->enumerate_reset();
uint64_t offset, length;