/linux-6.12.1/drivers/md/ |
D | md-bitmap.c | 149 struct bitmap { struct 215 static int __bitmap_resize(struct bitmap *bitmap, sector_t blocks, argument 218 static inline char *bmname(struct bitmap *bitmap) in bmname() argument 220 return bitmap->mddev ? mdname(bitmap->mddev) : "mdX"; in bmname() 223 static bool __bitmap_enabled(struct bitmap *bitmap) in __bitmap_enabled() argument 225 return bitmap->storage.filemap && in __bitmap_enabled() 226 !test_bit(BITMAP_STALE, &bitmap->flags); in __bitmap_enabled() 231 struct bitmap *bitmap = mddev->bitmap; in bitmap_enabled() local 233 if (!bitmap) in bitmap_enabled() 236 return __bitmap_enabled(bitmap); in bitmap_enabled() [all …]
|
/linux-6.12.1/drivers/iommu/iommufd/ |
D | iova_bitmap.c | 106 u8 __user *bitmap; member 130 static unsigned long iova_bitmap_offset_to_index(struct iova_bitmap *bitmap, in iova_bitmap_offset_to_index() argument 133 unsigned long pgsize = 1 << bitmap->mapped.pgshift; in iova_bitmap_offset_to_index() 135 return iova / (BITS_PER_TYPE(*bitmap->bitmap) * pgsize); in iova_bitmap_offset_to_index() 141 static unsigned long iova_bitmap_index_to_offset(struct iova_bitmap *bitmap, in iova_bitmap_index_to_offset() argument 144 unsigned long pgshift = bitmap->mapped.pgshift; in iova_bitmap_index_to_offset() 146 return (index * BITS_PER_TYPE(*bitmap->bitmap)) << pgshift; in iova_bitmap_index_to_offset() 152 static unsigned long iova_bitmap_mapped_iova(struct iova_bitmap *bitmap) in iova_bitmap_mapped_iova() argument 154 unsigned long skip = bitmap->mapped_base_index; in iova_bitmap_mapped_iova() 156 return bitmap->iova + iova_bitmap_index_to_offset(bitmap, skip); in iova_bitmap_mapped_iova() [all …]
|
/linux-6.12.1/fs/xfs/scrub/ |
D | bitmap.c | 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() 72 struct xbitmap64 *bitmap, 80 while ((bn = xbitmap64_tree_iter_first(&bitmap->xb_root, start, last))) { 85 xbitmap64_tree_remove(bn, &bitmap->xb_root); 87 xbitmap64_tree_insert(bn, &bitmap->xb_root); 96 xbitmap64_tree_insert(new_bn, &bitmap->xb_root); 99 xbitmap64_tree_remove(bn, &bitmap->xb_root); 101 xbitmap64_tree_insert(bn, &bitmap->xb_root); 104 xbitmap64_tree_remove(bn, &bitmap->xb_root); [all …]
|
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 …]
|
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 …]
|
D | agino_bitmap.h | 15 static inline void xagino_bitmap_init(struct xagino_bitmap *bitmap) in xagino_bitmap_init() argument 17 xbitmap32_init(&bitmap->aginobitmap); in xagino_bitmap_init() 20 static inline void xagino_bitmap_destroy(struct xagino_bitmap *bitmap) in xagino_bitmap_destroy() argument 22 xbitmap32_destroy(&bitmap->aginobitmap); in xagino_bitmap_destroy() 25 static inline int xagino_bitmap_clear(struct xagino_bitmap *bitmap, in xagino_bitmap_clear() argument 28 return xbitmap32_clear(&bitmap->aginobitmap, agino, len); in xagino_bitmap_clear() 31 static inline int xagino_bitmap_set(struct xagino_bitmap *bitmap, in xagino_bitmap_set() argument 34 return xbitmap32_set(&bitmap->aginobitmap, agino, len); in xagino_bitmap_set() 37 static inline bool xagino_bitmap_test(struct xagino_bitmap *bitmap, in xagino_bitmap_test() argument 40 return xbitmap32_test(&bitmap->aginobitmap, agino, len); in xagino_bitmap_test() [all …]
|
D | ino_bitmap.h | 15 static inline void xino_bitmap_init(struct xino_bitmap *bitmap) in xino_bitmap_init() argument 17 xbitmap64_init(&bitmap->inobitmap); in xino_bitmap_init() 20 static inline void xino_bitmap_destroy(struct xino_bitmap *bitmap) in xino_bitmap_destroy() argument 22 xbitmap64_destroy(&bitmap->inobitmap); in xino_bitmap_destroy() 25 static inline int xino_bitmap_set(struct xino_bitmap *bitmap, xfs_ino_t ino) in xino_bitmap_set() argument 27 return xbitmap64_set(&bitmap->inobitmap, ino, 1); in xino_bitmap_set() 30 static inline int xino_bitmap_test(struct xino_bitmap *bitmap, xfs_ino_t ino) in xino_bitmap_test() argument 34 return xbitmap64_test(&bitmap->inobitmap, ino, &len); in xino_bitmap_test()
|
D | dab_bitmap.h | 15 static inline void xdab_bitmap_init(struct xdab_bitmap *bitmap) in xdab_bitmap_init() argument 17 xbitmap32_init(&bitmap->dabitmap); in xdab_bitmap_init() 20 static inline void xdab_bitmap_destroy(struct xdab_bitmap *bitmap) in xdab_bitmap_destroy() argument 22 xbitmap32_destroy(&bitmap->dabitmap); in xdab_bitmap_destroy() 25 static inline int xdab_bitmap_set(struct xdab_bitmap *bitmap, in xdab_bitmap_set() argument 28 return xbitmap32_set(&bitmap->dabitmap, dabno, len); in xdab_bitmap_set() 31 static inline bool xdab_bitmap_test(struct xdab_bitmap *bitmap, in xdab_bitmap_test() argument 34 return xbitmap32_test(&bitmap->dabitmap, dabno, len); in xdab_bitmap_test()
|
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()
|
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()
|
/linux-6.12.1/lib/ |
D | find_bit_benchmark.c | 29 static DECLARE_BITMAP(bitmap, BITMAP_LEN) __initdata; 36 static int __init test_find_first_bit(void *bitmap, unsigned long len) in test_find_first_bit() argument 43 i = find_first_bit(bitmap, len); in test_find_first_bit() 44 __clear_bit(i, bitmap); in test_find_first_bit() 52 static int __init test_find_first_and_bit(void *bitmap, const void *bitmap2, unsigned long len) in test_find_first_and_bit() argument 58 bitmap_copy(cp, bitmap, BITMAP_LEN); in test_find_first_and_bit() 71 static int __init test_find_next_bit(const void *bitmap, unsigned long len) in test_find_next_bit() argument 78 i = find_next_bit(bitmap, BITMAP_LEN, i) + 1; in test_find_next_bit() 85 static int __init test_find_next_zero_bit(const void *bitmap, unsigned long len) in test_find_next_zero_bit() argument 92 i = find_next_zero_bit(bitmap, len, i) + 1; in test_find_next_zero_bit() [all …]
|
D | idr.c | 386 struct ida_bitmap *bitmap, *alloc = NULL; in ida_alloc_range() local 397 bitmap = xas_find_marked(&xas, max / IDA_BITMAP_BITS, XA_FREE_MARK); in ida_alloc_range() 403 if (xa_is_value(bitmap)) { in ida_alloc_range() 404 unsigned long tmp = xa_to_value(bitmap); in ida_alloc_range() 416 bitmap = alloc; in ida_alloc_range() 417 if (!bitmap) in ida_alloc_range() 418 bitmap = kzalloc(sizeof(*bitmap), GFP_NOWAIT); in ida_alloc_range() 419 if (!bitmap) in ida_alloc_range() 421 bitmap->bitmap[0] = tmp; in ida_alloc_range() 422 xas_store(&xas, bitmap); in ida_alloc_range() [all …]
|
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()
|
D | bitmap.c | 338 unsigned int __bitmap_weight(const unsigned long *bitmap, unsigned int bits) in __bitmap_weight() argument 340 return BITMAP_WEIGHT(bitmap[idx], bits); in __bitmap_weight() 743 void bitmap_free(const unsigned long *bitmap) in bitmap_free() argument 745 kfree(bitmap); in bitmap_free() 751 unsigned long *bitmap = data; in devm_bitmap_free() local 753 bitmap_free(bitmap); in devm_bitmap_free() 759 unsigned long *bitmap; in devm_bitmap_alloc() local 762 bitmap = bitmap_alloc(nbits, flags); in devm_bitmap_alloc() 763 if (!bitmap) in devm_bitmap_alloc() 766 ret = devm_add_action_or_reset(dev, devm_bitmap_free, bitmap); in devm_bitmap_alloc() [all …]
|
/linux-6.12.1/drivers/net/ethernet/mellanox/mlx4/ |
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-6.12.1/fs/afs/ |
D | dir_edit.c | 25 u64 bitmap; in afs_find_contig_bits() local 29 bitmap = (u64)block->hdr.bitmap[0] << 0 * 8; in afs_find_contig_bits() 30 bitmap |= (u64)block->hdr.bitmap[1] << 1 * 8; in afs_find_contig_bits() 31 bitmap |= (u64)block->hdr.bitmap[2] << 2 * 8; in afs_find_contig_bits() 32 bitmap |= (u64)block->hdr.bitmap[3] << 3 * 8; in afs_find_contig_bits() 33 bitmap |= (u64)block->hdr.bitmap[4] << 4 * 8; in afs_find_contig_bits() 34 bitmap |= (u64)block->hdr.bitmap[5] << 5 * 8; in afs_find_contig_bits() 35 bitmap |= (u64)block->hdr.bitmap[6] << 6 * 8; in afs_find_contig_bits() 36 bitmap |= (u64)block->hdr.bitmap[7] << 7 * 8; in afs_find_contig_bits() 37 bitmap >>= 1; /* The first entry is metadata */ in afs_find_contig_bits() [all …]
|
/linux-6.12.1/drivers/net/ethernet/mellanox/mlx5/core/steering/ |
D | dr_buddy.c | 19 buddy->bitmap = kcalloc(buddy->max_order + 1, in mlx5dr_buddy_init() 20 sizeof(*buddy->bitmap), in mlx5dr_buddy_init() 26 if (!buddy->bitmap || !buddy->num_free) in mlx5dr_buddy_init() 34 buddy->bitmap[i] = bitmap_zalloc(size, GFP_KERNEL); in mlx5dr_buddy_init() 35 if (!buddy->bitmap[i]) in mlx5dr_buddy_init() 43 bitmap_set(buddy->bitmap[buddy->max_order], 0, 1); in mlx5dr_buddy_init() 51 bitmap_free(buddy->bitmap[i]); in mlx5dr_buddy_init() 55 kfree(buddy->bitmap); in mlx5dr_buddy_init() 66 bitmap_free(buddy->bitmap[i]); in mlx5dr_buddy_cleanup() 69 kfree(buddy->bitmap); in mlx5dr_buddy_cleanup() [all …]
|
/linux-6.12.1/arch/powerpc/sysdev/ |
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(size, SMP_CACHE_BYTES); in msi_bitmap_alloc() 128 if (!bmp->bitmap) in msi_bitmap_alloc() 132 kmemleak_not_leak(bmp->bitmap); in msi_bitmap_alloc() [all …]
|
/linux-6.12.1/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/ |
D | mlx5hws_buddy.c | 13 buddy->bitmap = kcalloc(buddy->max_order + 1, in hws_buddy_init() 14 sizeof(*buddy->bitmap), in hws_buddy_init() 16 if (!buddy->bitmap) in hws_buddy_init() 30 buddy->bitmap[i] = bitmap_zalloc(s, GFP_KERNEL); in hws_buddy_init() 31 if (!buddy->bitmap[i]) { in hws_buddy_init() 37 bitmap_set(buddy->bitmap[buddy->max_order], 0, 1); in hws_buddy_init() 44 bitmap_free(buddy->bitmap[i]); in hws_buddy_init() 49 kfree(buddy->bitmap); in hws_buddy_init() 76 bitmap_free(buddy->bitmap[i]); in mlx5hws_buddy_cleanup() 79 kfree(buddy->bitmap); in mlx5hws_buddy_cleanup() [all …]
|
/linux-6.12.1/drivers/s390/cio/ |
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-6.12.1/drivers/gpu/drm/xe/ |
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 …]
|
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-6.12.1/drivers/gpu/drm/i915/selftests/ |
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-6.12.1/include/linux/ |
D | iova_bitmap.h | 14 typedef int (*iova_bitmap_fn_t)(struct iova_bitmap *bitmap, 22 void iova_bitmap_free(struct iova_bitmap *bitmap); 23 int iova_bitmap_for_each(struct iova_bitmap *bitmap, void *opaque, 25 void iova_bitmap_set(struct iova_bitmap *bitmap, 36 static inline void iova_bitmap_free(struct iova_bitmap *bitmap) in iova_bitmap_free() argument 40 static inline int iova_bitmap_for_each(struct iova_bitmap *bitmap, void *opaque, in iova_bitmap_for_each() argument 46 static inline void iova_bitmap_set(struct iova_bitmap *bitmap, in iova_bitmap_set() argument
|
/linux-6.12.1/fs/hfs/ |
D | bitmap.c | 29 static u32 hfs_find_set_zero_bits(__be32 *bitmap, u32 size, u32 offset, u32 *max) in hfs_find_set_zero_bits() argument 40 curr = bitmap + (offset / 32); in hfs_find_set_zero_bits() 41 end = bitmap + ((size + 31) / 32); in hfs_find_set_zero_bits() 70 start = (curr - bitmap) * 32 + i; in hfs_find_set_zero_bits() 108 *max = (curr - bitmap) * 32 + i - start; in hfs_find_set_zero_bits() 141 void *bitmap; in hfs_vbm_search_free() local 149 bitmap = HFS_SB(sb)->bitmap; in hfs_vbm_search_free() 151 pos = hfs_find_set_zero_bits(bitmap, HFS_SB(sb)->fs_ablocks, goal, num_bits); in hfs_vbm_search_free() 154 pos = hfs_find_set_zero_bits(bitmap, goal, 0, num_bits); in hfs_vbm_search_free() 210 curr = HFS_SB(sb)->bitmap + (start / 32); in hfs_clear_vbm_bits()
|