Home
last modified time | relevance | path

Searched refs:bitmap (Results 1 – 25 of 392) sorted by relevance

12345678910>>...16

/Linux-v4.19/drivers/md/
Dmd-bitmap.c34 static inline char *bmname(struct bitmap *bitmap) in bmname() argument
36 return bitmap->mddev ? mdname(bitmap->mddev) : "mdX"; in bmname()
49 static int md_bitmap_checkpage(struct bitmap_counts *bitmap, in md_bitmap_checkpage() argument
51 __releases(bitmap->lock) in md_bitmap_checkpage()
52 __acquires(bitmap->lock) in md_bitmap_checkpage()
56 if (page >= bitmap->pages) { in md_bitmap_checkpage()
64 if (bitmap->bp[page].hijacked) /* it's hijacked, don't try to alloc */ in md_bitmap_checkpage()
67 if (bitmap->bp[page].map) /* page is already allocated, just return */ in md_bitmap_checkpage()
75 spin_unlock_irq(&bitmap->lock); in md_bitmap_checkpage()
90 spin_lock_irq(&bitmap->lock); in md_bitmap_checkpage()
[all …]
Dmd-bitmap.h180 struct bitmap { struct
239 struct bitmap *md_bitmap_create(struct mddev *mddev, int slot);
244 void md_bitmap_print_sb(struct bitmap *bitmap);
245 void md_bitmap_update_sb(struct bitmap *bitmap);
246 void md_bitmap_status(struct seq_file *seq, struct bitmap *bitmap);
248 int md_bitmap_setallbits(struct bitmap *bitmap);
249 void md_bitmap_write_all(struct bitmap *bitmap);
251 void md_bitmap_dirty_bits(struct bitmap *bitmap, unsigned long s, unsigned long e);
254 int md_bitmap_startwrite(struct bitmap *bitmap, sector_t offset,
256 void md_bitmap_endwrite(struct bitmap *bitmap, sector_t offset,
[all …]
/Linux-v4.19/drivers/infiniband/hw/hns/
Dhns_roce_alloc.c38 int hns_roce_bitmap_alloc(struct hns_roce_bitmap *bitmap, unsigned long *obj) in hns_roce_bitmap_alloc() argument
42 spin_lock(&bitmap->lock); in hns_roce_bitmap_alloc()
43 *obj = find_next_zero_bit(bitmap->table, bitmap->max, bitmap->last); in hns_roce_bitmap_alloc()
44 if (*obj >= bitmap->max) { in hns_roce_bitmap_alloc()
45 bitmap->top = (bitmap->top + bitmap->max + bitmap->reserved_top) in hns_roce_bitmap_alloc()
46 & bitmap->mask; in hns_roce_bitmap_alloc()
47 *obj = find_first_zero_bit(bitmap->table, bitmap->max); in hns_roce_bitmap_alloc()
50 if (*obj < bitmap->max) { in hns_roce_bitmap_alloc()
51 set_bit(*obj, bitmap->table); in hns_roce_bitmap_alloc()
52 bitmap->last = (*obj + 1); in hns_roce_bitmap_alloc()
[all …]
/Linux-v4.19/lib/
Dfind_bit_benchmark.c37 static DECLARE_BITMAP(bitmap, BITMAP_LEN) __initdata;
44 static int __init test_find_first_bit(void *bitmap, unsigned long len) in test_find_first_bit() argument
51 i = find_first_bit(bitmap, len); in test_find_first_bit()
52 __clear_bit(i, bitmap); in test_find_first_bit()
60 static int __init test_find_next_bit(const void *bitmap, unsigned long len) in test_find_next_bit() argument
67 i = find_next_bit(bitmap, BITMAP_LEN, i) + 1; in test_find_next_bit()
74 static int __init test_find_next_zero_bit(const void *bitmap, unsigned long len) in test_find_next_zero_bit() argument
81 i = find_next_zero_bit(bitmap, len, i) + 1; in test_find_next_zero_bit()
88 static int __init test_find_last_bit(const void *bitmap, unsigned long len) in test_find_last_bit() argument
96 l = find_last_bit(bitmap, len); in test_find_last_bit()
[all …]
Didr.c371 struct ida_bitmap *bitmap; in ida_get_new_above() local
398 bitmap = rcu_dereference_raw(*slot); in ida_get_new_above()
399 if (radix_tree_exception(bitmap)) { in ida_get_new_above()
400 unsigned long tmp = (unsigned long)bitmap; in ida_get_new_above()
408 bitmap = this_cpu_xchg(ida_bitmap, NULL); in ida_get_new_above()
409 if (!bitmap) in ida_get_new_above()
411 bitmap->bitmap[0] = tmp >> RADIX_TREE_EXCEPTIONAL_SHIFT; in ida_get_new_above()
412 rcu_assign_pointer(*slot, bitmap); in ida_get_new_above()
415 if (bitmap) { in ida_get_new_above()
416 bit = find_next_zero_bit(bitmap->bitmap, in ida_get_new_above()
[all …]
Dmemweight.c15 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()
Dbitmap.c239 int __bitmap_weight(const unsigned long *bitmap, unsigned int bits) in __bitmap_weight() argument
245 w += hweight_long(bitmap[k]); in __bitmap_weight()
248 w += hweight_long(bitmap[k] & BITMAP_LAST_WORD_MASK(bits)); in __bitmap_weight()
990 static int __reg_op(unsigned long *bitmap, unsigned int pos, int order, int reg_op) in __reg_op() argument
1022 if (bitmap[index + i] & mask) in __reg_op()
1030 bitmap[index + i] |= mask; in __reg_op()
1035 bitmap[index + i] &= ~mask; in __reg_op()
1056 int bitmap_find_free_region(unsigned long *bitmap, unsigned int bits, int order) in bitmap_find_free_region() argument
1061 if (!__reg_op(bitmap, pos, order, REG_OP_ISFREE)) in bitmap_find_free_region()
1063 __reg_op(bitmap, pos, order, REG_OP_ALLOC); in bitmap_find_free_region()
[all …]
/Linux-v4.19/drivers/net/ethernet/mellanox/mlx4/
Dalloc.c44 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-v4.19/fs/afs/
Ddir_edit.c29 u64 bitmap; in afs_find_contig_bits() local
33 bitmap = (u64)block->hdr.bitmap[0] << 0 * 8; in afs_find_contig_bits()
34 bitmap |= (u64)block->hdr.bitmap[1] << 1 * 8; in afs_find_contig_bits()
35 bitmap |= (u64)block->hdr.bitmap[2] << 2 * 8; in afs_find_contig_bits()
36 bitmap |= (u64)block->hdr.bitmap[3] << 3 * 8; in afs_find_contig_bits()
37 bitmap |= (u64)block->hdr.bitmap[4] << 4 * 8; in afs_find_contig_bits()
38 bitmap |= (u64)block->hdr.bitmap[5] << 5 * 8; in afs_find_contig_bits()
39 bitmap |= (u64)block->hdr.bitmap[6] << 6 * 8; in afs_find_contig_bits()
40 bitmap |= (u64)block->hdr.bitmap[7] << 7 * 8; in afs_find_contig_bits()
41 bitmap >>= 1; /* The first entry is metadata */ in afs_find_contig_bits()
[all …]
/Linux-v4.19/arch/powerpc/sysdev/
Dmsi_bitmap.c26 offset = bitmap_find_next_zero_area(bmp->bitmap, bmp->irq_count, 0, in msi_bitmap_alloc_hwirqs()
31 bitmap_set(bmp->bitmap, offset, num); in msi_bitmap_alloc_hwirqs()
52 bitmap_clear(bmp->bitmap, offset, num); in msi_bitmap_free_hwirqs()
64 bitmap_allocate_region(bmp->bitmap, hwirq, 0); in msi_bitmap_reserve_hwirq()
100 bitmap_allocate_region(bmp->bitmap, 0, get_count_order(bmp->irq_count)); in msi_bitmap_reserve_dt_hwirqs()
108 bitmap_release_region(bmp->bitmap, *p + j, 0); in msi_bitmap_reserve_dt_hwirqs()
129 bmp->bitmap = kzalloc(size, GFP_KERNEL); in msi_bitmap_alloc()
131 bmp->bitmap = memblock_virt_alloc(size, 0); in msi_bitmap_alloc()
133 kmemleak_not_leak(bmp->bitmap); in msi_bitmap_alloc()
136 if (!bmp->bitmap) { in msi_bitmap_alloc()
[all …]
/Linux-v4.19/fs/xfs/scrub/
Dbitmap.h19 void xfs_bitmap_init(struct xfs_bitmap *bitmap);
20 void xfs_bitmap_destroy(struct xfs_bitmap *bitmap);
22 #define for_each_xfs_bitmap_extent(bex, n, bitmap) \ argument
23 list_for_each_entry_safe((bex), (n), &(bitmap)->list, list)
25 #define for_each_xfs_bitmap_block(b, bex, n, bitmap) \ argument
26 list_for_each_entry_safe((bex), (n), &(bitmap)->list, list) \
29 int xfs_bitmap_set(struct xfs_bitmap *bitmap, uint64_t start, uint64_t len);
30 int xfs_bitmap_disunion(struct xfs_bitmap *bitmap, struct xfs_bitmap *sub);
31 int xfs_bitmap_set_btcur_path(struct xfs_bitmap *bitmap,
33 int xfs_bitmap_set_btblocks(struct xfs_bitmap *bitmap,
Dbitmap.c27 struct xfs_bitmap *bitmap, in xfs_bitmap_set() argument
40 list_add_tail(&bmr->list, &bitmap->list); in xfs_bitmap_set()
48 struct xfs_bitmap *bitmap) in xfs_bitmap_destroy() argument
53 for_each_xfs_bitmap_extent(bmr, n, bitmap) { in xfs_bitmap_destroy()
62 struct xfs_bitmap *bitmap) in xfs_bitmap_init() argument
64 INIT_LIST_HEAD(&bitmap->list); in xfs_bitmap_init()
105 struct xfs_bitmap *bitmap, in xfs_bitmap_disunion() argument
117 if (list_empty(&bitmap->list) || list_empty(&sub->list)) in xfs_bitmap_disunion()
121 list_sort(NULL, &bitmap->list, xfs_bitmap_range_cmp); in xfs_bitmap_disunion()
134 lp = bitmap->list.next; in xfs_bitmap_disunion()
[all …]
/Linux-v4.19/drivers/gpu/drm/i915/selftests/
Dintel_breadcrumbs.c32 const unsigned long *bitmap, in check_rbtree() argument
45 n = find_first_bit(bitmap, count); in check_rbtree()
50 if (!test_bit(idx, bitmap)) { in check_rbtree()
62 n = find_next_bit(bitmap, count, n + 1); in check_rbtree()
69 const unsigned long *bitmap, in check_completion() argument
76 if (intel_wait_complete(&waiters[n]) != !!test_bit(n, bitmap)) in check_completion()
82 test_bit(n, bitmap) ? "active" : "complete"); in check_completion()
114 unsigned long *bitmap; in igt_random_insert_remove() local
124 bitmap = kcalloc(DIV_ROUND_UP(count, BITS_PER_LONG), sizeof(*bitmap), in igt_random_insert_remove()
126 if (!bitmap) in igt_random_insert_remove()
[all …]
Di915_syncmap.c62 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)), 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-v4.19/fs/btrfs/tests/
Dextent-io-tests.c264 static int check_eb_bitmap(unsigned long *bitmap, struct extent_buffer *eb, in check_eb_bitmap() argument
272 bit = !!test_bit(i, bitmap); in check_eb_bitmap()
289 static int __test_eb_bitmaps(unsigned long *bitmap, struct extent_buffer *eb, in __test_eb_bitmaps() argument
296 memset(bitmap, 0, len); in __test_eb_bitmaps()
298 if (memcmp_extent_buffer(eb, bitmap, 0, len) != 0) { in __test_eb_bitmaps()
303 bitmap_set(bitmap, 0, len * BITS_PER_BYTE); in __test_eb_bitmaps()
305 ret = check_eb_bitmap(bitmap, eb, len); in __test_eb_bitmaps()
311 bitmap_clear(bitmap, 0, len * BITS_PER_BYTE); in __test_eb_bitmaps()
313 ret = check_eb_bitmap(bitmap, eb, len); in __test_eb_bitmaps()
321 bitmap_set(bitmap, in __test_eb_bitmaps()
[all …]
/Linux-v4.19/drivers/s390/cio/
Didset.c16 unsigned long bitmap[0]; member
32 memset(set->bitmap, 0, bitmap_size(num_ssid, num_id)); in idset_new()
44 memset(set->bitmap, 0xff, bitmap_size(set->num_ssid, set->num_id)); in idset_fill()
49 set_bit(ssid * set->num_id + id, set->bitmap); in idset_add()
54 clear_bit(ssid * set->num_id + id, set->bitmap); in idset_del()
59 return test_bit(ssid * set->num_id + id, set->bitmap); in idset_contains()
66 bitnum = find_first_bit(set->bitmap, set->num_ssid * set->num_id); in idset_get_first()
94 bitmap_clear(set->bitmap, pos, set->num_id - schid.sch_no); in idset_sch_del_subseq()
104 return bitmap_empty(set->bitmap, set->num_ssid * set->num_id); in idset_is_empty()
111 bitmap_or(to->bitmap, to->bitmap, from->bitmap, len); in idset_add_set()
/Linux-v4.19/net/dsa/
Dswitch.c108 const unsigned long *bitmap) in dsa_switch_mdb_prepare_bitmap() argument
115 for_each_set_bit(port, bitmap, ds->num_ports) { in dsa_switch_mdb_prepare_bitmap()
126 const unsigned long *bitmap) in dsa_switch_mdb_add_bitmap() argument
130 for_each_set_bit(port, bitmap, ds->num_ports) in dsa_switch_mdb_add_bitmap()
142 bitmap_zero(ds->bitmap, ds->num_ports); in dsa_switch_mdb_add()
144 set_bit(info->port, ds->bitmap); in dsa_switch_mdb_add()
147 set_bit(port, ds->bitmap); in dsa_switch_mdb_add()
150 return dsa_switch_mdb_prepare_bitmap(ds, mdb, ds->bitmap); in dsa_switch_mdb_add()
152 dsa_switch_mdb_add_bitmap(ds, mdb, ds->bitmap); in dsa_switch_mdb_add()
174 const unsigned long *bitmap) in dsa_switch_vlan_prepare_bitmap() argument
[all …]
/Linux-v4.19/fs/hfs/
Dbitmap.c29 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()
/Linux-v4.19/drivers/pci/endpoint/
Dpci-epc-mem.c53 unsigned long *bitmap; in __pci_epc_mem_init() local
71 bitmap = kzalloc(bitmap_size, GFP_KERNEL); in __pci_epc_mem_init()
72 if (!bitmap) { in __pci_epc_mem_init()
77 mem->bitmap = bitmap; in __pci_epc_mem_init()
107 kfree(mem->bitmap); in pci_epc_mem_exit()
133 pageno = bitmap_find_free_region(mem->bitmap, mem->pages, order); in pci_epc_mem_alloc_addr()
140 bitmap_release_region(mem->bitmap, pageno, order); in pci_epc_mem_alloc_addr()
167 bitmap_release_region(mem->bitmap, pageno, order); in pci_epc_mem_free_addr()
/Linux-v4.19/fs/nfs/
Dnfs4xdr.c976 const __u32 *bitmap, size_t len) in xdr_encode_bitmap4() argument
981 while (len > 0 && bitmap[len-1] == 0) in xdr_encode_bitmap4()
983 ret = xdr_stream_encode_uint32_array(xdr, bitmap, len); in xdr_encode_bitmap4()
989 static size_t mask_bitmap4(const __u32 *bitmap, const __u32 *mask, in mask_bitmap4() argument
995 while (len > 0 && (bitmap[len-1] == 0 || mask[len-1] == 0)) in mask_bitmap4()
998 tmp = bitmap[i] & mask[i]; in mask_bitmap4()
1243 const __u32 *bitmap, const __u32 *mask, size_t len, in encode_getattr() argument
1252 len = mask_bitmap4(bitmap, mask, masked_bitmap, len); in encode_getattr()
1253 bitmap = masked_bitmap; in encode_getattr()
1255 xdr_encode_bitmap4(xdr, bitmap, len); in encode_getattr()
[all …]
/Linux-v4.19/include/linux/
Dbitmap.h113 extern void bitmap_free(const unsigned long *bitmap);
119 extern int __bitmap_empty(const unsigned long *bitmap, unsigned int nbits);
120 extern int __bitmap_full(const unsigned long *bitmap, unsigned int nbits);
141 extern int __bitmap_weight(const unsigned long *bitmap, unsigned int nbits);
191 extern int bitmap_find_free_region(unsigned long *bitmap, unsigned int bits, int order);
192 extern void bitmap_release_region(unsigned long *bitmap, unsigned int pos, int order);
193 extern int bitmap_allocate_region(unsigned long *bitmap, unsigned int pos, int order);
200 extern unsigned int bitmap_ord_to_pos(const unsigned long *bitmap, unsigned int ord, unsigned int n…
257 extern void bitmap_from_arr32(unsigned long *bitmap, const u32 *buf,
259 extern void bitmap_to_arr32(u32 *buf, const unsigned long *bitmap,
[all …]
/Linux-v4.19/tools/lib/
Dbitmap.c10 int __bitmap_weight(const unsigned long *bitmap, int bits) in __bitmap_weight() argument
15 w += hweight_long(bitmap[k]); in __bitmap_weight()
18 w += hweight_long(bitmap[k] & BITMAP_LAST_WORD_MASK(bits)); in __bitmap_weight()
33 size_t bitmap_scnprintf(unsigned long *bitmap, int nbits, in bitmap_scnprintf() argument
41 rbot = cur = find_first_bit(bitmap, nbits); in bitmap_scnprintf()
44 cur = find_next_bit(bitmap, nbits, cur + 1); in bitmap_scnprintf()
/Linux-v4.19/drivers/block/drbd/
Ddrbd_bitmap.c127 struct drbd_bitmap *b = device->bitmap; in __bm_print_lock_info()
138 struct drbd_bitmap *b = device->bitmap; in drbd_bm_lock()
165 struct drbd_bitmap *b = device->bitmap; in drbd_bm_unlock()
171 if (!(BM_LOCKED_MASK & device->bitmap->bm_flags)) in drbd_bm_unlock()
225 struct drbd_bitmap *b = device->bitmap; in bm_page_lock_io()
232 struct drbd_bitmap *b = device->bitmap; in bm_page_unlock_io()
235 wake_up(&device->bitmap->bm_io_wait); in bm_page_unlock_io()
254 device->bitmap->n_bitmap_hints = 0; in drbd_bm_reset_al_hints()
268 struct drbd_bitmap *b = device->bitmap; in drbd_bm_mark_for_writeout()
270 if (page_nr >= device->bitmap->bm_number_of_pages) { in drbd_bm_mark_for_writeout()
[all …]
/Linux-v4.19/fs/ocfs2/
Docfs2.h884 static inline void _ocfs2_set_bit(unsigned int bit, unsigned long *bitmap) in _ocfs2_set_bit() argument
886 __set_bit_le(bit, bitmap); in _ocfs2_set_bit()
890 static inline void _ocfs2_clear_bit(unsigned int bit, unsigned long *bitmap) in _ocfs2_clear_bit() argument
892 __clear_bit_le(bit, bitmap); in _ocfs2_clear_bit()
914 static inline void ocfs2_set_bit_unaligned(int bit, void *bitmap) in ocfs2_set_bit_unaligned() argument
916 bitmap = correct_addr_and_bit_unaligned(&bit, bitmap); in ocfs2_set_bit_unaligned()
917 ocfs2_set_bit(bit, bitmap); in ocfs2_set_bit_unaligned()
920 static inline void ocfs2_clear_bit_unaligned(int bit, void *bitmap) in ocfs2_clear_bit_unaligned() argument
922 bitmap = correct_addr_and_bit_unaligned(&bit, bitmap); in ocfs2_clear_bit_unaligned()
923 ocfs2_clear_bit(bit, bitmap); in ocfs2_clear_bit_unaligned()
[all …]
/Linux-v4.19/arch/powerpc/platforms/4xx/
Dmsi.c54 struct msi_bitmap bitmap; member
65 err = msi_bitmap_alloc(&msi_data->bitmap, msi_irqs, in ppc4xx_msi_init_allocator()
70 err = msi_bitmap_reserve_dt_hwirqs(&msi_data->bitmap); in ppc4xx_msi_init_allocator()
72 msi_bitmap_free(&msi_data->bitmap); in ppc4xx_msi_init_allocator()
97 int_no = msi_bitmap_alloc_hwirqs(&msi_data->bitmap, 1); in ppc4xx_setup_msi_irqs()
107 msi_bitmap_free_hwirqs(&msi_data->bitmap, int_no, 1); in ppc4xx_setup_msi_irqs()
137 msi_bitmap_free_hwirqs(&msi_data->bitmap, hwirq, 1); in ppc4xx_teardown_msi_irqs()
220 if (msi->bitmap.bitmap) in ppc4xx_of_msi_remove()
221 msi_bitmap_free(&msi->bitmap); in ppc4xx_of_msi_remove()

12345678910>>...16