Lines Matching refs:zones
227 struct mlx4_zone_allocator *zones = kmalloc(sizeof(*zones), GFP_KERNEL); in mlx4_zone_allocator_create() local
229 if (NULL == zones) in mlx4_zone_allocator_create()
232 INIT_LIST_HEAD(&zones->entries); in mlx4_zone_allocator_create()
233 INIT_LIST_HEAD(&zones->prios); in mlx4_zone_allocator_create()
234 spin_lock_init(&zones->lock); in mlx4_zone_allocator_create()
235 zones->last_uid = 0; in mlx4_zone_allocator_create()
236 zones->mask = 0; in mlx4_zone_allocator_create()
237 zones->flags = flags; in mlx4_zone_allocator_create()
239 return zones; in mlx4_zone_allocator_create()
429 struct mlx4_zone_allocator *zones, u32 uid) in __mlx4_find_zone_by_uid() argument
433 list_for_each_entry(zone, &zones->entries, list) { in __mlx4_find_zone_by_uid()
441 struct mlx4_bitmap *mlx4_zone_get_bitmap(struct mlx4_zone_allocator *zones, u32 uid) in mlx4_zone_get_bitmap() argument
446 spin_lock(&zones->lock); in mlx4_zone_get_bitmap()
448 zone = __mlx4_find_zone_by_uid(zones, uid); in mlx4_zone_get_bitmap()
452 spin_unlock(&zones->lock); in mlx4_zone_get_bitmap()
457 int mlx4_zone_remove_one(struct mlx4_zone_allocator *zones, u32 uid) in mlx4_zone_remove_one() argument
462 spin_lock(&zones->lock); in mlx4_zone_remove_one()
464 zone = __mlx4_find_zone_by_uid(zones, uid); in mlx4_zone_remove_one()
474 spin_unlock(&zones->lock); in mlx4_zone_remove_one()
482 struct mlx4_zone_allocator *zones, u32 obj) in __mlx4_find_zone_by_uid_unique() argument
493 list_for_each_entry(zone, &zones->entries, list) { in __mlx4_find_zone_by_uid_unique()
495 u32 mobj = (obj - zone->offset) & zones->mask; in __mlx4_find_zone_by_uid_unique()
511 u32 mlx4_zone_alloc_entries(struct mlx4_zone_allocator *zones, u32 uid, int count, in mlx4_zone_alloc_entries() argument
517 spin_lock(&zones->lock); in mlx4_zone_alloc_entries()
519 zone = __mlx4_find_zone_by_uid(zones, uid); in mlx4_zone_alloc_entries()
527 spin_unlock(&zones->lock); in mlx4_zone_alloc_entries()
532 u32 mlx4_zone_free_entries(struct mlx4_zone_allocator *zones, u32 uid, u32 obj, u32 count) in mlx4_zone_free_entries() argument
537 spin_lock(&zones->lock); in mlx4_zone_free_entries()
539 zone = __mlx4_find_zone_by_uid(zones, uid); in mlx4_zone_free_entries()
549 spin_unlock(&zones->lock); in mlx4_zone_free_entries()
554 u32 mlx4_zone_free_entries_unique(struct mlx4_zone_allocator *zones, u32 obj, u32 count) in mlx4_zone_free_entries_unique() argument
559 if (!(zones->flags & MLX4_ZONE_ALLOC_FLAGS_NO_OVERLAP)) in mlx4_zone_free_entries_unique()
562 spin_lock(&zones->lock); in mlx4_zone_free_entries_unique()
564 zone = __mlx4_find_zone_by_uid_unique(zones, obj); in mlx4_zone_free_entries_unique()
575 spin_unlock(&zones->lock); in mlx4_zone_free_entries_unique()