Lines Matching full:zones

226 	struct mlx4_zone_allocator *zones = kmalloc(sizeof(*zones), GFP_KERNEL);  in mlx4_zone_allocator_create()  local
228 if (NULL == zones) in mlx4_zone_allocator_create()
231 INIT_LIST_HEAD(&zones->entries); in mlx4_zone_allocator_create()
232 INIT_LIST_HEAD(&zones->prios); in mlx4_zone_allocator_create()
233 spin_lock_init(&zones->lock); in mlx4_zone_allocator_create()
234 zones->last_uid = 0; in mlx4_zone_allocator_create()
235 zones->mask = 0; in mlx4_zone_allocator_create()
236 zones->flags = flags; in mlx4_zone_allocator_create()
238 return zones; in mlx4_zone_allocator_create()
426 struct mlx4_zone_allocator *zones, u32 uid) in __mlx4_find_zone_by_uid() argument
430 list_for_each_entry(zone, &zones->entries, list) { in __mlx4_find_zone_by_uid()
438 struct mlx4_bitmap *mlx4_zone_get_bitmap(struct mlx4_zone_allocator *zones, u32 uid) in mlx4_zone_get_bitmap() argument
443 spin_lock(&zones->lock); in mlx4_zone_get_bitmap()
445 zone = __mlx4_find_zone_by_uid(zones, uid); in mlx4_zone_get_bitmap()
449 spin_unlock(&zones->lock); in mlx4_zone_get_bitmap()
454 int mlx4_zone_remove_one(struct mlx4_zone_allocator *zones, u32 uid) in mlx4_zone_remove_one() argument
459 spin_lock(&zones->lock); in mlx4_zone_remove_one()
461 zone = __mlx4_find_zone_by_uid(zones, uid); in mlx4_zone_remove_one()
471 spin_unlock(&zones->lock); in mlx4_zone_remove_one()
479 struct mlx4_zone_allocator *zones, u32 obj) in __mlx4_find_zone_by_uid_unique() argument
490 list_for_each_entry(zone, &zones->entries, list) { in __mlx4_find_zone_by_uid_unique()
492 u32 mobj = (obj - zone->offset) & zones->mask; in __mlx4_find_zone_by_uid_unique()
508 u32 mlx4_zone_alloc_entries(struct mlx4_zone_allocator *zones, u32 uid, int count, in mlx4_zone_alloc_entries() argument
514 spin_lock(&zones->lock); in mlx4_zone_alloc_entries()
516 zone = __mlx4_find_zone_by_uid(zones, uid); in mlx4_zone_alloc_entries()
524 spin_unlock(&zones->lock); in mlx4_zone_alloc_entries()
529 u32 mlx4_zone_free_entries(struct mlx4_zone_allocator *zones, u32 uid, u32 obj, u32 count) in mlx4_zone_free_entries() argument
534 spin_lock(&zones->lock); in mlx4_zone_free_entries()
536 zone = __mlx4_find_zone_by_uid(zones, uid); in mlx4_zone_free_entries()
546 spin_unlock(&zones->lock); in mlx4_zone_free_entries()
551 u32 mlx4_zone_free_entries_unique(struct mlx4_zone_allocator *zones, u32 obj, u32 count) in mlx4_zone_free_entries_unique() argument
556 if (!(zones->flags & MLX4_ZONE_ALLOC_FLAGS_NO_OVERLAP)) in mlx4_zone_free_entries_unique()
559 spin_lock(&zones->lock); in mlx4_zone_free_entries_unique()
561 zone = __mlx4_find_zone_by_uid_unique(zones, obj); in mlx4_zone_free_entries_unique()
572 spin_unlock(&zones->lock); in mlx4_zone_free_entries_unique()