| /linux/drivers/md/ |
| H A D | md-bitmap.c | 3 * bitmap.c two-level bitmap (C) Peter T. Breuer (ptb@ot.uc3m.es) 2003 5 * bitmap_create - sets up the bitmap structure 6 * bitmap_destroy - destroys the bitmap structure 9 * - added disk storage for bitmap 10 * - changes to allow various bitmap chunk sizes 34 #include "md-bitmap.h" 38 * in-memory bitmap: 126 * bitmap structures: 129 /* the in-memory bitmap i 152 struct bitmap { global() struct 154 bitmap_countsbitmap global() argument 167 mddevbitmap global() argument 172 bitmap_storagebitmap global() argument 175 need_syncbitmap global() argument 197 behind_writes_usedbitmap global() argument 202 daemon_lastrunbitmap global() argument 207 last_end_syncbitmap global() argument 221 cluster_slotbitmap global() argument 224 bmname(struct bitmap * bitmap) bmname() argument 231 struct bitmap *bitmap = data; bitmap_enabled() local 254 md_bitmap_checkpage(struct bitmap_counts * bitmap,unsigned long page,int create,int no_hijack) md_bitmap_checkpage() argument 316 md_bitmap_checkfree(struct bitmap_counts * bitmap,unsigned long page) md_bitmap_checkfree() argument 428 __write_sb_page(struct md_rdev * rdev,struct bitmap * bitmap,unsigned long pg_index,struct page * page) __write_sb_page() argument 485 write_sb_page(struct bitmap * bitmap,unsigned long pg_index,struct page * page,bool wait) write_sb_page() argument 509 struct bitmap *bitmap = bh->b_private; end_bitmap_write() local 517 write_file_page(struct bitmap * bitmap,struct page * page,int wait) write_file_page() argument 559 read_file_page(struct file * file,unsigned long index,struct bitmap * bitmap,unsigned long count,struct page * page) read_file_page() argument 620 write_file_page(struct bitmap * bitmap,struct page * page,int wait) write_file_page() argument 624 read_file_page(struct file * file,unsigned long index,struct bitmap * bitmap,unsigned long count,struct page * page) read_file_page() argument 641 filemap_write_page(struct bitmap * bitmap,unsigned long pg_index,bool wait) filemap_write_page() argument 663 md_bitmap_wait_writes(struct bitmap * bitmap) md_bitmap_wait_writes() argument 684 struct bitmap *bitmap = data; bitmap_update_sb() local 721 bitmap_print_sb(struct bitmap * bitmap) bitmap_print_sb() argument 760 md_bitmap_new_disk_sb(struct bitmap * bitmap) md_bitmap_new_disk_sb() argument 819 md_bitmap_read_sb(struct bitmap * bitmap) md_bitmap_read_sb() argument 1097 md_bitmap_file_kick(struct bitmap * bitmap) md_bitmap_file_kick() argument 1119 set_page_attr(struct bitmap * bitmap,int pnum,enum bitmap_page_attr attr) set_page_attr() argument 1125 clear_page_attr(struct bitmap * bitmap,int pnum,enum bitmap_page_attr attr) clear_page_attr() argument 1131 test_page_attr(struct bitmap * bitmap,int pnum,enum bitmap_page_attr attr) test_page_attr() argument 1137 test_and_clear_page_attr(struct bitmap * bitmap,int pnum,enum bitmap_page_attr attr) test_and_clear_page_attr() argument 1150 md_bitmap_file_set_bit(struct bitmap * bitmap,sector_t block) md_bitmap_file_set_bit() argument 1181 md_bitmap_file_clear_bit(struct bitmap * bitmap,sector_t block) md_bitmap_file_clear_bit() argument 1211 md_bitmap_file_test_bit(struct bitmap * bitmap,sector_t block) md_bitmap_file_test_bit() argument 1235 __bitmap_unplug(struct bitmap * bitmap) __bitmap_unplug() argument 1270 struct bitmap *bitmap; global() member 1283 bitmap_unplug_async(struct bitmap * bitmap) bitmap_unplug_async() argument 1299 struct bitmap *bitmap = mddev->bitmap; bitmap_unplug() local 1323 md_bitmap_init_from_disk(struct bitmap * bitmap,sector_t start) md_bitmap_init_from_disk() argument 1449 struct bitmap *bitmap = mddev->bitmap; bitmap_write_all() local 1463 md_bitmap_count_page(struct bitmap_counts * bitmap,sector_t offset,int inc) md_bitmap_count_page() argument 1472 md_bitmap_set_pending(struct bitmap_counts * bitmap,sector_t offset) md_bitmap_set_pending() argument 1510 struct bitmap *bitmap; bitmap_daemon_work() local 1629 md_bitmap_get_counter(struct bitmap_counts * bitmap,sector_t offset,sector_t * blocks,int create) md_bitmap_get_counter() argument 1682 struct bitmap *bitmap = mddev->bitmap; bitmap_start_write() local 1743 struct bitmap *bitmap = mddev->bitmap; bitmap_end_write() local 1788 __bitmap_start_sync(struct bitmap * bitmap,sector_t offset,sector_t * blocks,bool degraded) __bitmap_start_sync() argument 1837 __bitmap_end_sync(struct bitmap * bitmap,sector_t offset,sector_t * blocks,bool aborted) __bitmap_end_sync() argument 1878 struct bitmap *bitmap = mddev->bitmap; bitmap_close_sync() local 1894 struct bitmap *bitmap = mddev->bitmap; bitmap_cond_end_sync() local 1924 struct bitmap *bitmap = mddev->bitmap; bitmap_sync_with_cluster() local 1940 md_bitmap_set_memory_bits(struct bitmap * bitmap,sector_t offset,int needed) md_bitmap_set_memory_bits() argument 1971 struct bitmap *bitmap = mddev->bitmap; bitmap_dirty_bits() local 1992 struct bitmap *bitmap = mddev->bitmap; bitmap_flush() local 2017 struct bitmap *bitmap = data; md_bitmap_free() local 2051 struct bitmap *bitmap = mddev->bitmap; bitmap_start_behind_write() local 2065 struct bitmap *bitmap = mddev->bitmap; bitmap_end_behind_write() local 2076 struct bitmap *bitmap = mddev->bitmap; bitmap_wait_behind_writes() local 2090 struct bitmap *bitmap = mddev->bitmap; bitmap_destroy() local 2116 struct bitmap *bitmap; __bitmap_create() local 2204 struct bitmap *bitmap = __bitmap_create(mddev, -1); bitmap_create() local 2218 struct bitmap *bitmap = mddev->bitmap; bitmap_load() local 2274 struct bitmap *bitmap; bitmap_get_from_slot() local 2300 struct bitmap *bitmap; bitmap_copy_from_slot() local 2340 struct bitmap *bitmap = data; bitmap_set_pages() local 2349 struct bitmap *bitmap = data; bitmap_get_stats() local 2374 __bitmap_resize(struct bitmap * bitmap,sector_t blocks,int chunksize,bool init) __bitmap_resize() argument 2584 struct bitmap *bitmap = mddev->bitmap; bitmap_resize() local 2765 struct bitmap *bitmap; space_store() local 2954 struct bitmap *bitmap; can_clear_show() local 2969 struct bitmap *bitmap = mddev->bitmap; can_clear_store() local 2996 struct bitmap *bitmap; behind_writes_used_show() local 3012 struct bitmap *bitmap = mddev->bitmap; behind_writes_used_reset() local [all...] |
| /linux/drivers/iommu/iommufd/ |
| H A D | iova_bitmap.c | 14 * struct iova_bitmap_map - A bitmap representing an IOVA range 16 * Main data structure for tracking mapped user pages of bitmap data. 24 * The user does not need to exact location of the bits in the bitmap. 26 * records the IOVA *range* in the bitmap by setting the corresponding 29 * The bitmap is an array of u64 whereas each bit represents an IOVA of 30 * range of (1 << pgshift). Thus formula for the bitmap data to be set is: 50 /* pinned pages representing the bitmap data */ 55 * struct iova_bitmap - The IOVA bitmap object 57 * Main data structure for iterating over the bitmap data. 60 * It uses a windowing scheme and pins the bitmap i 106 u8 __user *bitmap; global() member 130 iova_bitmap_offset_to_index(struct iova_bitmap * bitmap,unsigned long iova) iova_bitmap_offset_to_index() argument 140 iova_bitmap_index_to_offset(struct iova_bitmap * bitmap,unsigned long index) iova_bitmap_index_to_offset() argument 151 iova_bitmap_mapped_iova(struct iova_bitmap * bitmap) iova_bitmap_mapped_iova() argument 165 iova_bitmap_get(struct iova_bitmap * bitmap) iova_bitmap_get() argument 219 iova_bitmap_put(struct iova_bitmap * bitmap) iova_bitmap_put() argument 247 struct iova_bitmap *bitmap; iova_bitmap_alloc() local 283 iova_bitmap_free(struct iova_bitmap * bitmap) iova_bitmap_free() argument 302 iova_bitmap_mapped_remaining(struct iova_bitmap * bitmap) iova_bitmap_mapped_remaining() argument 318 iova_bitmap_mapped_length(struct iova_bitmap * bitmap) iova_bitmap_mapped_length() argument 355 iova_bitmap_advance_to(struct iova_bitmap * bitmap,unsigned long iova) iova_bitmap_advance_to() argument 384 iova_bitmap_for_each(struct iova_bitmap * bitmap,void * opaque,iova_bitmap_fn_t fn) iova_bitmap_for_each() argument 401 iova_bitmap_set(struct iova_bitmap * bitmap,unsigned long iova,size_t length) iova_bitmap_set() argument [all...] |
| /linux/fs/xfs/scrub/ |
| H A D | bitmap.c | 15 #include "scrub/bitmap.h" 19 /* u64 bitmap */ 61 /* Iterate each interval of a bitmap. Do not change the bitmap. */ in INTERVAL_TREE_DEFINE() 62 #define for_each_xbitmap64_extent(bn, bitmap) \ in INTERVAL_TREE_DEFINE() argument 63 for ((bn) = rb_entry_safe(rb_first(&(bitmap)->xb_root.rb_root), \ in INTERVAL_TREE_DEFINE() 69 /* Clear a range of this bitmap. */ 72 struct xbitmap64 *bitmap, 83 while ((bn = xbitmap64_tree_iter_first(&bitmap->xb_root, start, last))) { 88 xbitmap64_tree_remove(bn, &bitmap 121 xbitmap64_set(struct xbitmap64 * bitmap,uint64_t start,uint64_t len) xbitmap64_set() argument 186 xbitmap64_destroy(struct xbitmap64 * bitmap) xbitmap64_destroy() argument 199 xbitmap64_init(struct xbitmap64 * bitmap) xbitmap64_init() argument 220 xbitmap64_disunion(struct xbitmap64 * bitmap,struct xbitmap64 * sub) xbitmap64_disunion() argument 242 xbitmap64_hweight(struct xbitmap64 * bitmap) xbitmap64_hweight() argument 256 xbitmap64_walk(struct xbitmap64 * bitmap,xbitmap64_walk_fn fn,void * priv) xbitmap64_walk() argument 275 xbitmap64_empty(struct xbitmap64 * bitmap) xbitmap64_empty() argument 283 xbitmap64_test(struct xbitmap64 * bitmap,uint64_t start,uint64_t * len) xbitmap64_test() argument 342 for_each_xbitmap32_extent(bn,bitmap) INTERVAL_TREE_DEFINE() argument 401 xbitmap32_set(struct xbitmap32 * bitmap,uint32_t start,uint32_t len) xbitmap32_set() argument 466 xbitmap32_destroy(struct xbitmap32 * bitmap) xbitmap32_destroy() argument 479 xbitmap32_init(struct xbitmap32 * bitmap) xbitmap32_init() argument 500 xbitmap32_disunion(struct xbitmap32 * bitmap,struct xbitmap32 * sub) xbitmap32_disunion() argument 522 xbitmap32_hweight(struct xbitmap32 * bitmap) xbitmap32_hweight() argument 536 xbitmap32_walk(struct xbitmap32 * bitmap,xbitmap32_walk_fn fn,void * priv) xbitmap32_walk() argument 555 xbitmap32_empty(struct xbitmap32 * bitmap) xbitmap32_empty() argument 563 xbitmap32_test(struct xbitmap32 * bitmap,uint32_t start,uint32_t * len) xbitmap32_test() argument 585 xbitmap32_count_set_regions(struct xbitmap32 * bitmap) xbitmap32_count_set_regions() argument [all...] |
| H A D | agb_bitmap.h | 15 static inline void xagb_bitmap_init(struct xagb_bitmap *bitmap) in xagb_bitmap_init() argument 17 xbitmap32_init(&bitmap->agbitmap); in xagb_bitmap_init() 20 static inline void xagb_bitmap_destroy(struct xagb_bitmap *bitmap) in xagb_bitmap_destroy() argument 22 xbitmap32_destroy(&bitmap->agbitmap); in xagb_bitmap_destroy() 25 static inline int xagb_bitmap_clear(struct xagb_bitmap *bitmap, in xagb_bitmap_clear() argument 28 return xbitmap32_clear(&bitmap->agbitmap, start, len); in xagb_bitmap_clear() 30 static inline int xagb_bitmap_set(struct xagb_bitmap *bitmap, in xagb_bitmap_set() argument 33 return xbitmap32_set(&bitmap->agbitmap, start, len); in xagb_bitmap_set() 36 static inline bool xagb_bitmap_test(struct xagb_bitmap *bitmap, in xagb_bitmap_test() argument 39 return xbitmap32_test(&bitmap->agbitmap, start, len); in xagb_bitmap_test() [all …]
|
| H A D | bitmap.h | 15 void xbitmap64_init(struct xbitmap64 *bitmap); 16 void xbitmap64_destroy(struct xbitmap64 *bitmap); 18 int xbitmap64_clear(struct xbitmap64 *bitmap, uint64_t start, uint64_t len); 19 int xbitmap64_set(struct xbitmap64 *bitmap, uint64_t start, uint64_t len); 20 int xbitmap64_disunion(struct xbitmap64 *bitmap, struct xbitmap64 *sub); 21 uint64_t xbitmap64_hweight(struct xbitmap64 *bitmap); 31 int xbitmap64_walk(struct xbitmap64 *bitmap, xbitmap64_walk_fn fn, 34 bool xbitmap64_empty(struct xbitmap64 *bitmap); 35 bool xbitmap64_test(struct xbitmap64 *bitmap, uint64_t start, uint64_t *len); 43 void xbitmap32_init(struct xbitmap32 *bitmap); [all …]
|
| H A D | off_bitmap.h | 15 static inline void xoff_bitmap_init(struct xoff_bitmap *bitmap) in xoff_bitmap_init() argument 17 xbitmap64_init(&bitmap->offbitmap); in xoff_bitmap_init() 20 static inline void xoff_bitmap_destroy(struct xoff_bitmap *bitmap) in xoff_bitmap_destroy() argument 22 xbitmap64_destroy(&bitmap->offbitmap); in xoff_bitmap_destroy() 25 static inline int xoff_bitmap_set(struct xoff_bitmap *bitmap, in xoff_bitmap_set() argument 28 return xbitmap64_set(&bitmap->offbitmap, off, len); in xoff_bitmap_set() 31 static inline int xoff_bitmap_walk(struct xoff_bitmap *bitmap, in xoff_bitmap_walk() argument 34 return xbitmap64_walk(&bitmap->offbitmap, fn, priv); in xoff_bitmap_walk()
|
| H A D | fsb_bitmap.h | 15 static inline void xfsb_bitmap_init(struct xfsb_bitmap *bitmap) in xfsb_bitmap_init() argument 17 xbitmap64_init(&bitmap->fsbitmap); in xfsb_bitmap_init() 20 static inline void xfsb_bitmap_destroy(struct xfsb_bitmap *bitmap) in xfsb_bitmap_destroy() argument 22 xbitmap64_destroy(&bitmap->fsbitmap); in xfsb_bitmap_destroy() 25 static inline int xfsb_bitmap_set(struct xfsb_bitmap *bitmap, in xfsb_bitmap_set() argument 28 return xbitmap64_set(&bitmap->fsbitmap, start, len); in xfsb_bitmap_set() 31 static inline int xfsb_bitmap_walk(struct xfsb_bitmap *bitmap, in xfsb_bitmap_walk() argument 34 return xbitmap64_walk(&bitmap->fsbitmap, fn, priv); in xfsb_bitmap_walk()
|
| H A D | rtb_bitmap.h | 15 static inline void xrtb_bitmap_init(struct xrtb_bitmap *bitmap) in xrtb_bitmap_init() argument 17 xbitmap64_init(&bitmap->rtbitmap); in xrtb_bitmap_init() 20 static inline void xrtb_bitmap_destroy(struct xrtb_bitmap *bitmap) in xrtb_bitmap_destroy() argument 22 xbitmap64_destroy(&bitmap->rtbitmap); in xrtb_bitmap_destroy() 25 static inline int xrtb_bitmap_set(struct xrtb_bitmap *bitmap, in xrtb_bitmap_set() argument 28 return xbitmap64_set(&bitmap->rtbitmap, start, len); in xrtb_bitmap_set() 31 static inline int xrtb_bitmap_walk(struct xrtb_bitmap *bitmap, in xrtb_bitmap_walk() argument 34 return xbitmap64_walk(&bitmap->rtbitmap, fn, priv); in xrtb_bitmap_walk()
|
| H A D | rgb_bitmap.h | 15 static inline void xrgb_bitmap_init(struct xrgb_bitmap *bitmap) in xrgb_bitmap_init() argument 17 xbitmap32_init(&bitmap->rgbitmap); in xrgb_bitmap_init() 20 static inline void xrgb_bitmap_destroy(struct xrgb_bitmap *bitmap) in xrgb_bitmap_destroy() argument 22 xbitmap32_destroy(&bitmap->rgbitmap); in xrgb_bitmap_destroy() 25 static inline int xrgb_bitmap_set(struct xrgb_bitmap *bitmap, in xrgb_bitmap_set() argument 28 return xbitmap32_set(&bitmap->rgbitmap, start, len); in xrgb_bitmap_set() 31 static inline int xrgb_bitmap_walk(struct xrgb_bitmap *bitmap, in xrgb_bitmap_walk() argument 34 return xbitmap32_walk(&bitmap->rgbitmap, fn, priv); in xrgb_bitmap_walk()
|
| /linux/lib/ |
| H A D | find_bit_benchmark.c | 29 static DECLARE_BITMAP(bitmap, BITMAP_LEN) __initdata; 35 static int __init test_find_first_bit(const void *bitmap, unsigned long len) in test_find_first_bit() argument 41 bitmap_copy(cp, bitmap, BITMAP_LEN); in test_find_first_bit() 54 static int __init test_find_first_and_bit(const void *bitmap, const void *bitmap2, in test_find_first_and_bit() argument 61 bitmap_copy(cp, bitmap, BITMAP_LEN); in test_find_first_and_bit() 74 static int __init test_find_next_bit(const void *bitmap, unsigned long len) in test_find_next_bit() argument 81 i = find_next_bit(bitmap, BITMAP_LEN, i) + 1; in test_find_next_bit() 88 static int __init test_find_next_zero_bit(const void *bitmap, unsigned long len) in test_find_next_zero_bit() argument 95 i = find_next_zero_bit(bitmap, len, i) + 1; in test_find_next_zero_bit() 102 static int __init test_find_last_bit(const void *bitmap, unsigned long len) in test_find_last_bit() argument [all …]
|
| H A D | idr.c | 388 struct ida_bitmap *bitmap, *alloc = NULL; in ida_alloc_range() local 399 bitmap = xas_find_marked(&xas, max / IDA_BITMAP_BITS, XA_FREE_MARK); in ida_alloc_range() 405 if (xa_is_value(bitmap)) { in ida_alloc_range() 406 unsigned long tmp = xa_to_value(bitmap); in ida_alloc_range() 418 bitmap = alloc; in ida_alloc_range() 419 if (!bitmap) in ida_alloc_range() 420 bitmap = kzalloc_obj(*bitmap, GFP_NOWAIT); in ida_alloc_range() 421 if (!bitmap) in ida_alloc_range() 423 bitmap->bitmap[0] = tmp; in ida_alloc_range() 424 xas_store(&xas, bitmap); in ida_alloc_range() [all …]
|
| H A D | memweight.c | 15 const unsigned char *bitmap = ptr; in memweight() local 17 for (; bytes > 0 && ((unsigned long)bitmap) % sizeof(long); in memweight() 18 bytes--, bitmap++) in memweight() 19 ret += hweight8(*bitmap); in memweight() 24 ret += bitmap_weight((unsigned long *)bitmap, in memweight() 27 bitmap += longs * sizeof(long); in memweight() 34 for (; bytes > 0; bytes--, bitmap++) in memweight() 35 ret += hweight8(*bitmap); in memweight()
|
| H A D | bitmap.c | 356 unsigned int __bitmap_weight(const unsigned long *bitmap, unsigned int bits) in __bitmap_weight() argument 358 return BITMAP_WEIGHT(bitmap[idx], bits); in __bitmap_weight() 779 void bitmap_free(const unsigned long *bitmap) in bitmap_free() argument 781 kfree(bitmap); in bitmap_free() 787 unsigned long *bitmap = data; in devm_bitmap_free() local 789 bitmap_free(bitmap); in devm_bitmap_free() 795 unsigned long *bitmap; in devm_bitmap_alloc() local 798 bitmap = bitmap_alloc(nbits, flags); in devm_bitmap_alloc() 799 if (!bitmap) in devm_bitmap_alloc() 802 ret = devm_add_action_or_reset(dev, devm_bitmap_free, bitmap); in devm_bitmap_alloc() [all …]
|
| /linux/drivers/net/ethernet/mellanox/mlx4/ |
| H A D | alloc.c | 44 u32 mlx4_bitmap_alloc(struct mlx4_bitmap *bitmap) in mlx4_bitmap_alloc() argument 48 spin_lock(&bitmap->lock); in mlx4_bitmap_alloc() 50 obj = find_next_zero_bit(bitmap->table, bitmap->max, bitmap->last); in mlx4_bitmap_alloc() 51 if (obj >= bitmap->max) { in mlx4_bitmap_alloc() 52 bitmap->top = (bitmap->top + bitmap->max + bitmap->reserved_top) in mlx4_bitmap_alloc() 53 & bitmap->mask; in mlx4_bitmap_alloc() 54 obj = find_first_zero_bit(bitmap->table, bitmap->max); in mlx4_bitmap_alloc() 57 if (obj < bitmap->max) { in mlx4_bitmap_alloc() 58 set_bit(obj, bitmap->table); in mlx4_bitmap_alloc() 59 bitmap->last = (obj + 1); in mlx4_bitmap_alloc() [all …]
|
| /linux/tools/testing/selftests/bpf/libarena/selftests/ |
| H A D | test_parallel_bitmap.bpf.c | 8 #include <libarena/bitmap.h> 16 static struct arena_bitmap __arena *bitmap; 60 * odds. Both should be able to operate on the bitmap oblivious of the 66 if (bmp_test_and_clear_bit(bit, bitmap)) in bitmap_test_bit_sequence() 69 if (bmp_test_and_set_bit(bit, bitmap)) in bitmap_test_bit_sequence() 71 if (!bmp_test_bit(bit, bitmap)) in bitmap_test_bit_sequence() 74 if (!bmp_test_and_set_bit(bit, bitmap)) in bitmap_test_bit_sequence() 76 if (!bmp_test_bit(bit, bitmap)) in bitmap_test_bit_sequence() 79 if (!bmp_test_and_clear_bit(bit, bitmap)) in bitmap_test_bit_sequence() 81 if (bmp_test_bit(bit, bitmap)) in bitmap_test_bit_sequence() 15 static struct arena_bitmap __arena *bitmap; global() variable [all...] |
| /linux/fs/afs/ |
| H A D | dir_edit.c | 26 u64 bitmap; in afs_find_contig_bits() local 30 bitmap = (u64)block->hdr.bitmap[0] << 0 * 8; in afs_find_contig_bits() 31 bitmap |= (u64)block->hdr.bitmap[1] << 1 * 8; in afs_find_contig_bits() 32 bitmap |= (u64)block->hdr.bitmap[2] << 2 * 8; in afs_find_contig_bits() 33 bitmap |= (u64)block->hdr.bitmap[3] << 3 * 8; in afs_find_contig_bits() 34 bitmap |= (u64)block->hdr.bitmap[4] << 4 * 8; in afs_find_contig_bits() 35 bitmap |= (u64)block->hdr.bitmap[5] << 5 * 8; in afs_find_contig_bits() 36 bitmap |= (u64)block->hdr.bitmap[6] << 6 * 8; in afs_find_contig_bits() 37 bitmap |= (u64)block->hdr.bitmap[7] << 7 * 8; in afs_find_contig_bits() 38 bitmap >>= 1; /* The first entry is metadata */ in afs_find_contig_bits() [all …]
|
| /linux/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/ |
| H A D | pool.c | 196 unsigned long *bitmap; in hws_pool_create_and_init_bitmap() local 198 bitmap = bitmap_zalloc(1 << log_range, GFP_KERNEL); in hws_pool_create_and_init_bitmap() 199 if (!bitmap) in hws_pool_create_and_init_bitmap() 202 bitmap_fill(bitmap, 1 << log_range); in hws_pool_create_and_init_bitmap() 204 return bitmap; in hws_pool_create_and_init_bitmap() 209 unsigned long *bitmap; in hws_pool_bitmap_init() local 211 bitmap = hws_pool_create_and_init_bitmap(pool->alloc_log_sz); in hws_pool_bitmap_init() 212 if (!bitmap) { in hws_pool_bitmap_init() 221 bitmap_free(bitmap); in hws_pool_bitmap_init() 225 pool->db.bitmap = bitmap; in hws_pool_bitmap_init() [all …]
|
| H A D | buddy.c | 13 buddy->bitmap = kzalloc_objs(*buddy->bitmap, buddy->max_order + 1); in hws_buddy_init() 14 if (!buddy->bitmap) in hws_buddy_init() 26 buddy->bitmap[i] = bitmap_zalloc(s, GFP_KERNEL); in hws_buddy_init() 27 if (!buddy->bitmap[i]) { in hws_buddy_init() 33 bitmap_set(buddy->bitmap[buddy->max_order], 0, 1); in hws_buddy_init() 40 bitmap_free(buddy->bitmap[i]); in hws_buddy_init() 45 kfree(buddy->bitmap); in hws_buddy_init() 72 bitmap_free(buddy->bitmap[i]); in mlx5hws_buddy_cleanup() 75 kfree(buddy->bitmap); in mlx5hws_buddy_cleanup() [all...] |
| /linux/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/ |
| H A D | dr_buddy.c | 19 buddy->bitmap = kzalloc_objs(*buddy->bitmap, buddy->max_order + 1); in mlx5dr_buddy_init() 22 if (!buddy->bitmap || !buddy->num_free) in mlx5dr_buddy_init() 30 buddy->bitmap[i] = bitmap_zalloc(size, GFP_KERNEL); in mlx5dr_buddy_init() 31 if (!buddy->bitmap[i]) in mlx5dr_buddy_init() 39 bitmap_set(buddy->bitmap[buddy->max_order], 0, 1); in mlx5dr_buddy_init() 47 bitmap_free(buddy->bitmap[i]); in mlx5dr_buddy_init() 51 kfree(buddy->bitmap); in mlx5dr_buddy_init() 62 bitmap_free(buddy->bitmap[i]); in mlx5dr_buddy_cleanup() 65 kfree(buddy->bitmap); in mlx5dr_buddy_cleanup() 81 seg = find_first_bit(buddy->bitmap[order_iter], m); in dr_buddy_find_free_seg() [all …]
|
| /linux/arch/powerpc/sysdev/ |
| H A D | msi_bitmap.c | 22 offset = bitmap_find_next_zero_area(bmp->bitmap, bmp->irq_count, 0, in msi_bitmap_alloc_hwirqs() 27 bitmap_set(bmp->bitmap, offset, num); in msi_bitmap_alloc_hwirqs() 48 bitmap_clear(bmp->bitmap, offset, num); in msi_bitmap_free_hwirqs() 60 bitmap_allocate_region(bmp->bitmap, hwirq, 0); in msi_bitmap_reserve_hwirq() 96 bitmap_allocate_region(bmp->bitmap, 0, get_count_order(bmp->irq_count)); in msi_bitmap_reserve_dt_hwirqs() 104 bitmap_release_region(bmp->bitmap, *p + j, 0); in msi_bitmap_reserve_dt_hwirqs() 125 bmp->bitmap = kzalloc(size, GFP_KERNEL); in msi_bitmap_alloc() 127 bmp->bitmap = memblock_alloc_or_panic(size, SMP_CACHE_BYTES); in msi_bitmap_alloc() 129 kmemleak_not_leak(bmp->bitmap); in msi_bitmap_alloc() 132 if (!bmp->bitmap) { in msi_bitmap_alloc() [all …]
|
| /linux/drivers/s390/cio/ |
| H A D | idset.c | 16 unsigned long bitmap[]; member 33 memset(set->bitmap, 0, idset_bitmap_size(num_ssid, num_id)); in idset_new() 45 memset(set->bitmap, 0xff, in idset_fill() 51 set_bit(ssid * set->num_id + id, set->bitmap); in idset_add() 56 clear_bit(ssid * set->num_id + id, set->bitmap); in idset_del() 61 return test_bit(ssid * set->num_id + id, set->bitmap); in idset_contains() 84 bitmap_clear(set->bitmap, pos, set->num_id - schid.sch_no); in idset_sch_del_subseq() 94 return bitmap_empty(set->bitmap, set->num_ssid * set->num_id); in idset_is_empty() 101 bitmap_or(to->bitmap, to->bitmap, from->bitmap, len); in idset_add_set()
|
| /linux/drivers/gpu/drm/xe/ |
| H A D | xe_guc_id_mgr.c | 44 unsigned int weight = bitmap_weight(idm->bitmap, idm->total); in __fini_idm() 55 bitmap_free(idm->bitmap); in __fini_idm() 56 idm->bitmap = NULL; in __fini_idm() 80 idm_assert(idm, !idm->bitmap); in xe_guc_id_mgr_init() 91 idm->bitmap = bitmap_zalloc(limit, GFP_KERNEL); in xe_guc_id_mgr_init() 92 if (!idm->bitmap) in xe_guc_id_mgr_init() 105 static unsigned int find_last_zero_area(unsigned long *bitmap, in find_last_zero_area() argument 112 for_each_clear_bitrange(rs, re, bitmap, total) { in find_last_zero_area() 142 id = find_last_zero_area(idm->bitmap, idm->total, count); in idm_reserve_chunk_locked() 148 id = bitmap_find_next_zero_area(idm->bitmap, idm->total, 0, count, 0); in idm_reserve_chunk_locked() [all …]
|
| H A D | xe_guc_db_mgr.c | 58 weight = bitmap_weight(dbm->bitmap, dbm->count); in __fini_dbm() 67 bitmap_free(dbm->bitmap); in __fini_dbm() 68 dbm->bitmap = NULL; in __fini_dbm() 94 dbm_assert(dbm, !dbm->bitmap); in xe_guc_db_mgr_init() 100 dbm->bitmap = bitmap_zalloc(count, GFP_KERNEL); in xe_guc_db_mgr_init() 101 if (!dbm->bitmap) in xe_guc_db_mgr_init() 129 used = bitmap_weight(dbm->bitmap, dbm->count); in dbm_reserve_chunk_locked() 134 index = bitmap_find_next_zero_area(dbm->bitmap, dbm->count, 0, count, 0); in dbm_reserve_chunk_locked() 138 bitmap_set(dbm->bitmap, index, count); in dbm_reserve_chunk_locked() 156 dbm_assert(dbm, test_bit(start + n, dbm->bitmap)); in dbm_release_chunk_locked() [all …]
|
| /linux/drivers/gpu/drm/i915/selftests/ |
| H A D | i915_syncmap.c | 62 for_each_set_bit(i, (unsigned long *)&p->bitmap, KSYNCMAP) { in __sync_print() 77 for_each_set_bit(i, (unsigned long *)&p->bitmap, KSYNCMAP) { in __sync_print() 80 last << 1 | ((p->bitmap >> (i + 1)) ? 1 : 0), in __sync_print() 183 if (hweight32((*sync)->bitmap) != 1) { in check_one() 185 (*sync)->bitmap, hweight32((*sync)->bitmap)); in check_one() 189 err = check_seqno((*sync), ilog2((*sync)->bitmap), seqno); in check_one() 252 if (hweight32((*sync)->bitmap) != 1) { in check_leaf() 254 context, (*sync)->bitmap, hweight32((*sync)->bitmap)); in check_leaf() 258 err = check_seqno((*sync), ilog2((*sync)->bitmap), seqno); in check_leaf() 314 if (hweight32(join->bitmap) != 2) { in igt_syncmap_join_above() [all …]
|
| /linux/fs/nfs/ |
| H A D | nfs4xdr.c | 414 1 /* bitmap size */ + \ 415 1 /* notification bitmap length */ + \ 416 1 /* notification bitmap, word 0 */) 421 1 /* notification bitmap length */ + \ 422 1 /* notification bitmap, word 0 */ + \ 995 const __u32 *bitmap, size_t len) in xdr_encode_bitmap4() argument 1000 while (len > 0 && bitmap[len-1] == 0) in xdr_encode_bitmap4() 1002 ret = xdr_stream_encode_uint32_array(xdr, bitmap, len); in xdr_encode_bitmap4() 1008 static size_t mask_bitmap4(const __u32 *bitmap, const __u32 *mask, in mask_bitmap4() argument 1014 while (len > 0 && (bitmap[le in mask_bitmap4() 1259 encode_getattr(struct xdr_stream * xdr,const __u32 * bitmap,const __u32 * mask,size_t len,struct compound_hdr * hdr) encode_getattr() argument 1718 __u32 bitmap[2]; encode_setacl() local 1748 uint32_t bitmap[3] = { 0 }; encode_delegattr() local 3310 decode_bitmap4(struct xdr_stream * xdr,uint32_t * bitmap,size_t sz) decode_bitmap4() argument 3322 decode_attr_bitmap(struct xdr_stream * xdr,uint32_t * bitmap) decode_attr_bitmap() argument 3341 decode_attr_supported(struct xdr_stream * xdr,uint32_t * bitmap,uint32_t * bitmask) decode_attr_supported() argument 3356 decode_attr_type(struct xdr_stream * xdr,uint32_t * bitmap,uint32_t * type) decode_attr_type() argument 3381 decode_attr_fh_expire_type(struct xdr_stream * xdr,uint32_t * bitmap,uint32_t * type) decode_attr_fh_expire_type() argument 3399 decode_attr_change(struct xdr_stream * xdr,uint32_t * bitmap,uint64_t * change) decode_attr_change() argument 3420 decode_attr_size(struct xdr_stream * xdr,uint32_t * bitmap,uint64_t * size) decode_attr_size() argument 3440 decode_attr_link_support(struct xdr_stream * xdr,uint32_t * bitmap,uint32_t * res) decode_attr_link_support() argument 3458 decode_attr_symlink_support(struct xdr_stream * xdr,uint32_t * bitmap,uint32_t * res) decode_attr_symlink_support() argument 3476 decode_attr_fsid(struct xdr_stream * xdr,uint32_t * bitmap,struct nfs_fsid * fsid) decode_attr_fsid() argument 3500 decode_attr_lease_time(struct xdr_stream * xdr,uint32_t * bitmap,uint32_t * res) decode_attr_lease_time() argument 3518 decode_attr_error(struct xdr_stream * xdr,uint32_t * bitmap,int32_t * res) decode_attr_error() argument 3535 decode_attr_exclcreat_supported(struct xdr_stream * xdr,uint32_t * bitmap,uint32_t * bitmask) decode_attr_exclcreat_supported() argument 3550 decode_attr_filehandle(struct xdr_stream * xdr,uint32_t * bitmap,struct nfs_fh * fh) decode_attr_filehandle() argument 3582 decode_attr_aclsupport(struct xdr_stream * xdr,uint32_t * bitmap,uint32_t * res) decode_attr_aclsupport() argument 3600 decode_attr_case_insensitive(struct xdr_stream * xdr,uint32_t * bitmap,uint32_t * res) decode_attr_case_insensitive() argument 3618 decode_attr_case_preserving(struct xdr_stream * xdr,uint32_t * bitmap,uint32_t * res) decode_attr_case_preserving() argument 3636 decode_attr_fileid(struct xdr_stream * xdr,uint32_t * bitmap,uint64_t * fileid) decode_attr_fileid() argument 3656 decode_attr_mounted_on_fileid(struct xdr_stream * xdr,uint32_t * bitmap,uint64_t * fileid) decode_attr_mounted_on_fileid() argument 3676 decode_attr_files_avail(struct xdr_stream * xdr,uint32_t * bitmap,uint64_t * res) decode_attr_files_avail() argument 3695 decode_attr_files_free(struct xdr_stream * xdr,uint32_t * bitmap,uint64_t * res) decode_attr_files_free() argument 3714 decode_attr_files_total(struct xdr_stream * xdr,uint32_t * bitmap,uint64_t * res) decode_attr_files_total() argument 3775 decode_attr_fs_locations(struct xdr_stream * xdr,uint32_t * bitmap,struct nfs4_fs_locations * res) decode_attr_fs_locations() argument 3851 decode_attr_maxfilesize(struct xdr_stream * xdr,uint32_t * bitmap,uint64_t * res) decode_attr_maxfilesize() argument 3870 decode_attr_maxlink(struct xdr_stream * xdr,uint32_t * bitmap,uint32_t * maxlink) decode_attr_maxlink() argument 3889 decode_attr_maxname(struct xdr_stream * xdr,uint32_t * bitmap,uint32_t * maxname) decode_attr_maxname() argument 3908 decode_attr_maxread(struct xdr_stream * xdr,uint32_t * bitmap,uint32_t * res) decode_attr_maxread() argument 3931 decode_attr_maxwrite(struct xdr_stream * xdr,uint32_t * bitmap,uint32_t * res) decode_attr_maxwrite() argument 3954 decode_attr_mode(struct xdr_stream * xdr,uint32_t * bitmap,umode_t * mode) decode_attr_mode() argument 3976 decode_attr_nlink(struct xdr_stream * xdr,uint32_t * bitmap,uint32_t * nlink) decode_attr_nlink() argument 4009 decode_attr_owner(struct xdr_stream * xdr,uint32_t * bitmap,const struct nfs_server * server,kuid_t * uid,struct nfs4_string * owner_name) decode_attr_owner() argument 4043 decode_attr_group(struct xdr_stream * xdr,uint32_t * bitmap,const struct nfs_server * server,kgid_t * gid,struct nfs4_string * group_name) decode_attr_group() argument 4077 decode_attr_rdev(struct xdr_stream * xdr,uint32_t * bitmap,dev_t * rdev) decode_attr_rdev() argument 4104 decode_attr_space_avail(struct xdr_stream * xdr,uint32_t * bitmap,uint64_t * res) decode_attr_space_avail() argument 4123 decode_attr_space_free(struct xdr_stream * xdr,uint32_t * bitmap,uint64_t * res) decode_attr_space_free() argument 4142 decode_attr_space_total(struct xdr_stream * xdr,uint32_t * bitmap,uint64_t * res) decode_attr_space_total() argument 4161 decode_attr_space_used(struct xdr_stream * xdr,uint32_t * bitmap,uint64_t * used) decode_attr_space_used() argument 4204 decode_attr_time_access(struct xdr_stream * xdr,uint32_t * bitmap,struct timespec64 * time) decode_attr_time_access() argument 4222 decode_attr_time_create(struct xdr_stream * xdr,uint32_t * bitmap,struct timespec64 * time) decode_attr_time_create() argument 4240 decode_attr_time_metadata(struct xdr_stream * xdr,uint32_t * bitmap,struct timespec64 * time) decode_attr_time_metadata() argument 4258 decode_attr_time_delta(struct xdr_stream * xdr,uint32_t * bitmap,struct timespec64 * time) decode_attr_time_delta() argument 4276 decode_attr_security_label(struct xdr_stream * xdr,uint32_t * bitmap,struct nfs4_label * label) decode_attr_security_label() argument 4325 decode_attr_time_modify(struct xdr_stream * xdr,uint32_t * bitmap,struct timespec64 * time) decode_attr_time_modify() argument 4343 decode_attr_xattrsupport(struct xdr_stream * xdr,uint32_t * bitmap,uint32_t * res) decode_attr_xattrsupport() argument 4362 decode_attr_open_arguments(struct xdr_stream * xdr,uint32_t * bitmap,struct nfs4_open_caps * res) decode_attr_open_arguments() argument 4384 decode_attr_uncacheable_file_data(struct xdr_stream * xdr,uint32_t * bitmap,uint32_t * res,uint64_t * flags) decode_attr_uncacheable_file_data() argument 4547 uint32_t attrlen, bitmap[3] = {0}; decode_server_caps() local 4585 uint32_t attrlen, bitmap[3] = {0}; decode_statfs() local 4622 uint32_t attrlen, bitmap[3] = {0}; decode_pathconf() local 4644 decode_threshold_hint(struct xdr_stream * xdr,uint32_t * bitmap,uint64_t * res,uint32_t hint_bit) decode_threshold_hint() argument 4665 uint32_t bitmap[3] = {0,}, attrlen; decode_first_threshold_item4() local 4714 decode_attr_mdsthreshold(struct xdr_stream * xdr,uint32_t * bitmap,struct nfs4_threshold * res) decode_attr_mdsthreshold() argument 4744 decode_getfattr_attrs(struct xdr_stream * xdr,uint32_t * bitmap,struct nfs_fattr * fattr,struct nfs_fh * fh,struct nfs4_fs_locations * fs_loc,const struct nfs_server * server) decode_getfattr_attrs() argument 4890 bitmap[3] = {0}; decode_getfattr_generic() local 4960 decode_attr_pnfstype(struct xdr_stream * xdr,uint32_t * bitmap,struct nfs_fsinfo * fsinfo) decode_attr_pnfstype() argument 4978 decode_attr_layout_blksize(struct xdr_stream * xdr,uint32_t * bitmap,uint32_t * res) decode_attr_layout_blksize() argument 4998 decode_attr_clone_blksize(struct xdr_stream * xdr,uint32_t * bitmap,uint32_t * res) decode_attr_clone_blksize() argument 5016 decode_attr_change_attr_type(struct xdr_stream * xdr,uint32_t * bitmap,enum nfs4_change_attr_type * res) decode_attr_change_attr_type() argument 5044 uint32_t attrlen, bitmap[3]; decode_fsinfo() local 5529 bitmap[3] = {0}; decode_getacl() local 6040 u32 bitmap[1]; decode_get_dir_delegation() local 7642 uint32_t bitmap[3] = {0}; nfs4_decode_dirent() local [all...] |