}
int StupidAllocator::allocate(
- uint64_t need_size, uint64_t alloc_unit, int64_t hint,
+ uint64_t want_size, uint64_t alloc_unit, int64_t hint,
uint64_t *offset, uint32_t *length)
{
std::lock_guard<std::mutex> l(lock);
- dout(10) << __func__ << " need_size " << need_size
+ dout(10) << __func__ << " want_size " << want_size
<< " alloc_unit " << alloc_unit
<< " hint " << hint
<< dendl;
- uint64_t want = MAX(alloc_unit, need_size);
+ uint64_t want = MAX(alloc_unit, want_size);
int bin = _choose_bin(want);
int orig_bin = bin;
for (bin = orig_bin; bin < (int)free.size(); ++bin) {
p = free[bin].lower_bound(hint);
while (p != free[bin].end()) {
- if (aligned_len(p, alloc_unit) >= need_size) {
+ if (aligned_len(p, alloc_unit) >= want_size) {
goto found;
}
++p;
p = free[bin].begin();
auto end = hint ? free[bin].lower_bound(hint) : free[bin].end();
while (p != end) {
- if (aligned_len(p, alloc_unit) >= need_size) {
+ if (aligned_len(p, alloc_unit) >= want_size) {
goto found;
}
++p;
if (skew)
skew = alloc_unit - skew;
*offset = p.get_start() + skew;
- *length = MIN(MAX(alloc_unit, need_size), p.get_len() - skew);
+ *length = MIN(MAX(alloc_unit, want_size), p.get_len() - skew);
if (g_conf->bluestore_debug_small_allocations) {
uint64_t max =
alloc_unit * (rand() % g_conf->bluestore_debug_small_allocations);
void unreserve(uint64_t unused);
int allocate(
- uint64_t need_size, uint64_t alloc_unit, int64_t hint,
+ uint64_t want_size, uint64_t alloc_unit, int64_t hint,
uint64_t *offset, uint32_t *length);
int release(