|
@@ -61,9 +61,10 @@ int hns_roce_bitmap_alloc(struct hns_roce_bitmap *bitmap, unsigned long *obj)
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-void hns_roce_bitmap_free(struct hns_roce_bitmap *bitmap, unsigned long obj)
|
|
|
+void hns_roce_bitmap_free(struct hns_roce_bitmap *bitmap, unsigned long obj,
|
|
|
+ int rr)
|
|
|
{
|
|
|
- hns_roce_bitmap_free_range(bitmap, obj, 1);
|
|
|
+ hns_roce_bitmap_free_range(bitmap, obj, 1, rr);
|
|
|
}
|
|
|
|
|
|
int hns_roce_bitmap_alloc_range(struct hns_roce_bitmap *bitmap, int cnt,
|
|
@@ -106,7 +107,8 @@ int hns_roce_bitmap_alloc_range(struct hns_roce_bitmap *bitmap, int cnt,
|
|
|
}
|
|
|
|
|
|
void hns_roce_bitmap_free_range(struct hns_roce_bitmap *bitmap,
|
|
|
- unsigned long obj, int cnt)
|
|
|
+ unsigned long obj, int cnt,
|
|
|
+ int rr)
|
|
|
{
|
|
|
int i;
|
|
|
|
|
@@ -116,7 +118,8 @@ void hns_roce_bitmap_free_range(struct hns_roce_bitmap *bitmap,
|
|
|
for (i = 0; i < cnt; i++)
|
|
|
clear_bit(obj + i, bitmap->table);
|
|
|
|
|
|
- bitmap->last = min(bitmap->last, obj);
|
|
|
+ if (!rr)
|
|
|
+ bitmap->last = min(bitmap->last, obj);
|
|
|
bitmap->top = (bitmap->top + bitmap->max + bitmap->reserved_top)
|
|
|
& bitmap->mask;
|
|
|
spin_unlock(&bitmap->lock);
|