提交 a2cb4a98 编写于 作者: R Roland Dreier

IB/mlx4: Fix last allocated object tracking in bitmap allocator

Set last allocated object to the object after the one just allocated
before ORing in the extra top bits.  Also handle the case where this
wraps around.
Signed-off-by: NRoland Dreier <rolandd@cisco.com>
上级 d998ccce
......@@ -51,8 +51,8 @@ u32 mlx4_bitmap_alloc(struct mlx4_bitmap *bitmap)
if (obj < bitmap->max) {
set_bit(obj, bitmap->table);
bitmap->last = (obj + 1) & (bitmap->max - 1);
obj |= bitmap->top;
bitmap->last = obj + 1;
} else
obj = -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册