Home
last modified time | relevance | path

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

12345678910>>...58

/linux/drivers/iommu/iommufd/
H A Diova_bitmap.c14 * 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 in relatively
[all …]
/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 Didr.c2 #include <linux/bitmap.h>
334 * each entry. The XA_FREE_MARK is only cleared when all bits in the bitmap
341 * leaf bitmap before doing a radix tree lookup.
344 * leaf, instead of allocating a 128-byte bitmap, we store the bits
346 * because we can always convert them into a bitmap entry.
349 * single 128-byte bitmap, we currently switch to a 576-byte node, put
350 * the 128-byte bitmap in the first entry and then start allocating extra
352 * data as a bitmap before moving to that scheme. I do not believe this
361 * RCU head in the bitmap, which adds a 2-pointer overhead to each 128-byte
362 * bitmap, which is excessive.
[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()
/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/include/linux/
H A Dbitmap.h15 #include <linux/bitmap-str.h>
21 * longs. The bitmap interface and available operations are listed
22 * here, in bitmap.h
25 * lib/bitmap.c. Functions implementations that are architecture
29 * See lib/bitmap.c for more details.
33 * DOC: bitmap overview
35 * The available bitmap operations and their rough meaning in the
36 * case that the bitmap is a single unsigned long are thus:
57 * bitmap_weight_and(src1, src2, nbits) Hamming Weight of and'ed bitmap
58 * bitmap_weight_andnot(src1, src2, nbits) Hamming Weight of andnot'ed bitmap
299 bitmap_from_arr32(bitmap,buf,nbits) global() argument
302 bitmap_to_arr32(buf,bitmap,nbits) global() argument
315 bitmap_from_arr64(bitmap,buf,nbits) global() argument
317 bitmap_to_arr64(buf,bitmap,nbits) global() argument
636 bitmap_next_set_region(unsigned long * bitmap,unsigned int * rs,unsigned int * re,unsigned int end) bitmap_next_set_region() argument
653 bitmap_release_region(unsigned long * bitmap,unsigned int pos,int order) bitmap_release_region() argument
670 bitmap_allocate_region(unsigned long * bitmap,unsigned int pos,int order) bitmap_allocate_region() argument
695 bitmap_find_free_region(unsigned long * bitmap,unsigned int bits,int order) bitmap_find_free_region() argument
[all...]
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/arch/powerpc/sysdev/
H A Dmsi_bitmap.c9 #include <linux/bitmap.h>
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()
66 * @bmp: pointer to the MSI bitmap.
70 * are reserved in the bitmap.
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()
121 pr_debug("msi_bitmap: allocator bitmap siz in msi_bitmap_alloc()
[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/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()
63 * This changes the io permissions bitmap in the current task.
79 * IO bitmap up. ioperm() is much less timing critical than clone(), in ksys_ioperm()
84 /* No point to allocate a bitmap just to clear permissions */ in ksys_ioperm()
91 memset(iobm->bitmap, 0xff, sizeof(iobm->bitmap)); in ksys_ioperm()
96 * If the bitmap is not shared, then nothing can take a refcount as in ksys_ioperm()
109 * 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/fs/ocfs2/
H A Dreservations.h45 * bitmap is provided. */
75 * ocfs2_resmap_init() - Initialize fields of a reservations bitmap
83 * ocfs2_resmap_restart() - "restart" a reservation bitmap
84 * @resmap: reservations bitmap
85 * @clen: Number of valid bits in the bitmap
86 * @disk_bitmap: the disk bitmap this resmap should refer to.
88 * Re-initialize the parameters of a reservation bitmap. This is
93 * reservations based on the new bitmap.
99 * ocfs2_resmap_uninit() - uninitialize a reservation bitmap structure
106 * @resmap: reservations bitmap
[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 …]
/linux/tools/include/linux/
H A Dbitmap.h15 unsigned int __bitmap_weight(const unsigned long *bitmap, int bits);
83 * bitmap_zalloc - Allocate bitmap
92 * bitmap_free - Free bitmap
93 * @bitmap: pointer to bitmap
95 static inline void bitmap_free(unsigned long *bitmap) in bitmap_free() argument
97 free(bitmap); in bitmap_free()
101 * bitmap_scnprintf - print bitmap list into buffer
102 * @bitmap: bitmap
103 * @nbits: size of bitmap
107 size_t bitmap_scnprintf(unsigned long *bitmap, unsigned int nbits,
[all …]

12345678910>>...58