success = allocated = node->total;
while(requested) {
void **slots = (void**)&node->slot;
- unsigned int max_off = MAPLE_NODE_SLOTS - 1;
+ unsigned int max_req = MAPLE_NODE_SLOTS - 1;
if (node->slot[0]) {
unsigned int offset = node->node_count + 1;
slots = (void**)&node->slot[offset];
- max_off -= offset;
+ max_req -= offset;
}
- count = min(requested, max_off);
+ count = min(requested, max_req);
count = mt_alloc_bulk(gfp, count, slots);
if (!count)
goto nomem;
{
if (mt_in_rcu(mas->tree))
mte_free(used);
- else {
+ else
mas_push_node(mas, used);
- }
}
// Free the allocations.
unsigned long index = mas->min;
void *entry = NULL;
- while (mas_search_cont(mas, index, max, entry)) {
+ while (mas_search_cont(mas, index, max, entry))
entry = _mas_next(mas, max, &index);
- if (!entry)
- entry = NULL;
- }
if (entry)
mas->index = index;