Home
last modified time | relevance | path

Searched full:bitmap (Results 1 – 25 of 1383) sorted by relevance

12345678910>>...56

/linux/lib/
H A Dfind_bit_benchmark.c14 * - randomly filled bitmap with approximately equal number of set and
16 * - sparse bitmap with few set bits at random positions.
29 static DECLARE_BITMAP(bitmap, BITMAP_LEN) __initdata;
34 * all other tests for the same bitmap because it sets all bits of bitmap to 1.
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
[all …]
H A Dbitmap.c3 * lib/bitmap.c
4 * Helper functions for bitmap.h.
7 #include <linux/bitmap.h>
15 * DOC: bitmap introduction
19 * given bitmap does _not_ need to be an exact multiple of
23 * of a bitmap are 'don't care'. The implementation makes
26 * The bitmap operations that return Boolean (bitmap_empty,
82 * __bitmap_shift_right - logical right shift of the bits in a bitmap
83 * @dst : destination bitmap
84 * @src : source bitmap
[all …]
H A Dbitmap-str.c3 #include <linux/bitmap.h>
16 * bitmap_parse_user - convert an ASCII hex string in a user buffer into a bitmap
21 * @maskp: pointer to bitmap array that will contain result.
22 * @nmaskbits: size of bitmap, in bits.
43 * bitmap_print_to_pagebuf - convert bitmap to list or hex format ASCII string
44 * @list: indicates whether the bitmap must be list
46 * @maskp: pointer to bitmap to convert
47 * @nmaskbits: size of bitmap, in bits
69 * bitmap_print_to_buf - convert bitmap to list or hex format ASCII string
70 * @list: indicates whether the bitmap must be list
[all …]
H A Dmemweight.c4 #include <linux/bitmap.h>
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()
/linux/drivers/net/ethernet/mellanox/mlx4/
H A Dalloc.c38 #include <linux/bitmap.h>
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()
[all …]
/linux/fs/xfs/scrub/
H A Dbitmap.h9 /* u64 bitmap */
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);
24 * Return codes for the bitmap iterator functions are 0 to continue iterating,
27 * iteration, because neither bitmap iterator ever generates that error code on
28 * its own. Callers must not modify the bitmap while walking it.
[all …]
H A Dagb_bitmap.h15 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 Doff_bitmap.h15 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 Dfsb_bitmap.h15 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 Drtb_bitmap.h15 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 Drgb_bitmap.h15 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/fs/afs/
H A Ddir_edit.c20 * There are 64 slots, which means we can load the entire bitmap into a
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()
[all …]
/linux/rust/kernel/
H A Dbitmap.rs5 //! Rust API for bitmap.
7 //! C headers: [`include/linux/bitmap.h`](srctree/include/linux/bitmap.h).
17 /// Represents a C bitmap. Wraps underlying C bitmap API.
24 pub struct Bitmap { struct
28 impl Bitmap { argument
29 /// Borrows a C bitmap.
35 /// * the array must not be freed for the lifetime of this [`Bitmap`]
37 pub unsafe fn from_raw<'a>(ptr: *const usize, nbits: usize) -> &'a Bitmap { in from_raw() argument
44 // We are casting `*const [()]` to `*const Bitmap`. The `Bitmap` in from_raw()
50 // pointer as `&Bitmap` is safe given the caller's guarantees. in from_raw()
[all …]
/linux/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/
H A Dpool.c196 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()
213 mlx5hws_err(pool->ctx, "Failed to create bitmap order: %zu\n", in hws_pool_bitmap_init()
221 bitmap_free(bitmap); in hws_pool_bitmap_init()
[all …]
/linux/fs/btrfs/tests/
H A Dfree-space-tests.c95 test_msg("running bitmap only tests"); in test_bitmaps()
99 test_err("couldn't create a bitmap entry %d", ret); in test_bitmaps()
105 test_err("error removing bitmap full range %d", ret); in test_bitmaps()
110 test_err("left some space in bitmap"); in test_bitmaps()
116 test_err("couldn't add to our bitmap entry %d", ret); in test_bitmaps()
127 * The first bitmap we have starts at offset 0 so the next one is just in test_bitmaps()
128 * at the end of the first bitmap. in test_bitmaps()
164 test_msg("running bitmap and extent tests"); in test_bitmaps_and_extents()
168 * bitmap, but the free space completely in the extent and then in test_bitmaps_and_extents()
169 * completely in the bitmap. in test_bitmaps_and_extents()
[all …]
/linux/drivers/block/drbd/
H A Ddrbd_bitmap.c15 #include <linux/bitmap.h>
41 * 1 << (38 - 3) bitmap bytes needed
43 * (that's 32 GiB of bitmap for 1 PiB storage)
52 * 22 --> we need that much 4KiB pages of bitmap.
61 * bitmap storage and IO:
62 * Bitmap is stored little endian on disk, and is kept little endian in
63 * core memory. Currently we still hold the full bitmap in core as long
67 * We plan to reduce the amount of in-core bitmap pages by paging them in
115 struct drbd_bitmap *b = device->bitmap; in __bm_print_lock_info()
118 drbd_err(device, "FIXME %s[%d] in %s, bitmap locked for '%s' by %s[%d]\n", in __bm_print_lock_info()
[all …]
/linux/drivers/firmware/efi/libstub/
H A Dunaccepted_memory.c49 * If unaccepted memory is present, allocate a bitmap to track what in allocate_unaccepted_bitmap()
52 * One bit in the bitmap represents 2MiB in the address space: in allocate_unaccepted_bitmap()
53 * A 4k bitmap can track 64GiB of physical address space. in allocate_unaccepted_bitmap()
59 * The bitmap will be populated in setup_e820() according to the memory in allocate_unaccepted_bitmap()
77 memset(unaccepted_table->bitmap, 0, bitmap_size); in allocate_unaccepted_bitmap()
90 * The accepted memory bitmap only works at unit_size granularity. Take
104 * Ensure that at least one bit will be set in the bitmap by in process_unaccepted_memory()
107 * have been represented in the bitmap. But, results in simpler in process_unaccepted_memory()
116 * represented in the bitmap. The 2MB->4MB region can be represented in in process_unaccepted_memory()
117 * the bitmap. But, the 0MB->4MB region is <2*unit_size and will be in process_unaccepted_memory()
[all …]
/linux/fs/hfs/
H A Dbitmap.c2 * linux/fs/hfs/bitmap.c
10 * This file contains the code to modify the volume bitmap:
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()
116 * Search for 'num_bits' consecutive cleared bits in the bitmap blocks of
127 * returned range. If the bitmap is fragmented, this will be less than
141 void *bitmap; in hfs_vbm_search_free() local
[all …]
/linux/net/ethtool/
H A Dbitset.c4 #include <linux/bitmap.h>
26 * ethnl_bitmap32_clear() - Clear u32 based bitmap
27 * @dst: bitmap to clear
30 * @mod: set if bitmap was modified
32 * Clear @nbits bits of a bitmap with indices @start <= i < @end
79 * @map: bitmap to test
116 * ethnl_bitmap32_update() - Modify u32 based bitmap according to value/mask
118 * @dst: bitmap to update
119 * @nbits: bit size of the bitmap
122 * @mod: set to true if bitmap is modified, preserve if not
[all …]
/linux/drivers/net/wireless/intel/iwlwifi/fw/api/
H A Dnvm-reg.h571 * @oem_uhb_allow_bitmap: bitmap of UHB enabled MCC sets
582 * @oem_uhb_allow_bitmap: bitmap of UHB enabled MCC sets
583 * @oem_11ax_allow_bitmap: bitmap of 11ax allowed MCCs.
595 * @config_bitmap: Bitmap of the config commands. Each bit will trigger a
597 * @oem_uhb_allow_bitmap: Bitmap of UHB enabled MCC sets.
598 * @oem_11ax_allow_bitmap: Bitmap of 11ax allowed MCCs. There are two bits
601 * @oem_unii4_allow_bitmap: Bitmap of unii4 allowed MCCs.There are two bits
614 * @config_bitmap: Bitmap of the config commands. Each bit will trigger a
616 * @oem_uhb_allow_bitmap: Bitmap of UHB enabled MCC sets.
617 * @oem_11ax_allow_bitmap: Bitmap of 11ax allowed MCCs. There are two bits
[all …]
/linux/include/linux/
H A Dsbitmap.h47 * struct sbitmap - Scalable bitmap.
54 * @depth: Number of bits used in the whole bitmap.
64 * @map_nr: Number of words (cachelines) being used for the bitmap.
74 * @map: Allocated bitmap.
101 * struct sbitmap_queue - Scalable bitmap with the added ability to wait on free
111 * @sb: Scalable bitmap.
156 * @sb: Bitmap to initialize.
158 * @shift: Use 2^@shift bits per word in the bitmap; if a negative number if
183 * @sb: Bitmap to free.
194 * @sb: Bitmap to resize.
[all …]
/linux/drivers/s390/cio/
H A Didset.c8 #include <linux/bitmap.h>
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/arch/x86/kernel/
H A Dioport.c3 * This contains the io-permission bitmap code - written by obz, with changes
9 #include <linux/bitmap.h>
27 * Take a refcount on current's bitmap. It can be used by in io_bitmap_share()
28 * both tasks as long as none of them changes the bitmap. in io_bitmap_share()
69 * This changes the io permissions bitmap in the current task.
85 * IO bitmap up. ioperm() is much less timing critical than clone(), in ksys_ioperm()
90 /* No point to allocate a bitmap just to clear permissions */ in ksys_ioperm()
97 memset(iobm->bitmap, 0xff, sizeof(iobm->bitmap)); in ksys_ioperm()
102 * If the bitmap is not shared, then nothing can take a refcount as in ksys_ioperm()
115 * Store the bitmap pointer (might be the same if the task already in ksys_ioperm()
[all …]
/linux/fs/nfs/
H A Dnfs4xdr.c400 1 /* bitmap size */ + \
401 1 /* notification bitmap length */ + \
402 1 /* notification bitmap, word 0 */)
407 1 /* notification bitmap length */ + \
408 1 /* notification bitmap, word 0 */ + \
991 const __u32 *bitmap, size_t len) in xdr_encode_bitmap4() argument
996 while (len > 0 && bitmap[len-1] == 0) in xdr_encode_bitmap4()
998 ret = xdr_stream_encode_uint32_array(xdr, bitmap, len); in xdr_encode_bitmap4()
1004 static size_t mask_bitmap4(const __u32 *bitmap, const __u32 *mask, in mask_bitmap4() argument
1010 while (len > 0 && (bitmap[len-1] == 0 || mask[len-1] == 0)) in mask_bitmap4()
[all …]
/linux/Documentation/filesystems/ext4/
H A Dgroup_descr.rst39 number, and the group descriptor structure. Both block and inode bitmap
41 entire bitmap.
56 - Lower 32-bits of location of block bitmap.
60 - Lower 32-bits of location of inode bitmap.
84 - Lower 32-bits of location of snapshot exclusion bitmap.
88 - Lower 16-bits of the block bitmap checksum.
92 - Lower 16-bits of the inode bitmap checksum.
116 - Upper 32-bits of location of block bitmap.
120 - Upper 32-bits of location of inodes bitmap.
144 - Upper 32-bits of location of snapshot exclusion bitmap.
[all …]

12345678910>>...56