uint64_t BlueFS::_get_total(unsigned id) const
{
ceph_assert(id < bdev.size());
- ceph_assert(id < block_reserved.size());
- return get_block_device_size(id) - block_reserved[id];
+ return get_block_device_size(id);
}
uint64_t BlueFS::get_total(unsigned id)
if (!bdev[i] || !alloc[i]) {
continue;
}
- auto total = get_total(i) + block_reserved[i];
+ auto total = get_total(i);
auto free = get_free(i);
out << i << " : device size 0x" << std::hex << total
bdev[id]->get_size(),
super.bluefs_max_alloc_size[id],
name);
- alloc[id]->init_add_free(
- block_reserved[id],
- _get_total(id));
+ auto reserved = block_reserved[id];
+ alloc[id]->init_add_free(reserved, _get_total(id) - reserved);
}
}
}
ASSERT_EQ(0, fs.mkfs(fsid, { BlueFS::BDEV_DB, false, false }));
ASSERT_EQ(0, fs.mount());
ASSERT_EQ(0, fs.maybe_verify_layout({ BlueFS::BDEV_DB, false, false }));
- ASSERT_EQ(fs.get_total(BlueFS::BDEV_DB), size - SUPER_RESERVED);
- ASSERT_LT(fs.get_free(BlueFS::BDEV_DB), size - SUPER_RESERVED);
+ ASSERT_EQ(fs.get_total(BlueFS::BDEV_DB), size);
+ ASSERT_LT(fs.get_free(BlueFS::BDEV_DB), size);
fs.umount();
}