projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d998ccc
)
IB/mlx4: Fix last allocated object tracking in bitmap allocator
author
Roland Dreier
<rolandd@cisco.com>
Tue, 29 May 2007 23:07:09 +0000
(16:07 -0700)
committer
Roland Dreier
<rolandd@cisco.com>
Tue, 29 May 2007 23:07:09 +0000
(16:07 -0700)
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: Roland Dreier <rolandd@cisco.com>
drivers/net/mlx4/alloc.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/net/mlx4/alloc.c
b/drivers/net/mlx4/alloc.c
index dfbd5809d7444a2c7e84403c5eca2dc05518f228..f8d63d39f59246bc80da046ee72963e2303c8644 100644
(file)
--- a/
drivers/net/mlx4/alloc.c
+++ b/
drivers/net/mlx4/alloc.c
@@
-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;