}
reuse->total = 1;
- if ((head) && !(((unsigned long)head & 0x1))) {
+ if ((head) && !((unsigned long)head & 0x1)) {
head->request_count = 0;
reuse->slot[0] = head;
reuse->total += head->total;
}
- reuse->node_count = 0;
mas->alloc = reuse;
done:
- if (requested)
+ if (requested > 1)
mas_set_alloc_req(mas, requested - 1);
}
max_req -= offset;
}
- count = min(requested, max_req);
- count = mt_alloc_bulk(gfp, count, slots);
+ count = mt_alloc_bulk(gfp, min(requested, max_req),
+ slots);
if (!count)
goto nomem;
}
mas->mas_flags &= ~MA_STATE_BULK;
- while (mas->alloc && !(((unsigned long)mas->alloc & 0x1))) {
+ while (mas->alloc && !((unsigned long)mas->alloc & 0x1)) {
node = mas->alloc;
- mas->alloc = mas->alloc->slot[0];
+ mas->alloc = node->slot[0];
if (node->node_count > 0)
mt_free_bulk(node->node_count,
(void __rcu **)&node->slot[1]);