Home
last modified time | relevance | path

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

12345678910>>...56

/linux/drivers/md/
H A Dmd-bitmap.c3 * 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 is represented by bitmap_pages */
151 /* the main bitmap structure - one per mddev */
[all …]
/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/fs/xfs/scrub/
H A Dbitmap.c15 #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,
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);
[all …]
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()
/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/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>
336 * each entry. The XA_FREE_MARK is only cleared when all bits in the bitmap
343 * leaf bitmap before doing a radix tree lookup.
346 * leaf, instead of allocating a 128-byte bitmap, we store the bits
348 * because we can always convert them into a bitmap entry.
351 * single 128-byte bitmap, we currently switch to a 576-byte node, put
352 * the 128-byte bitmap in the first entry and then start allocating extra
354 * data as a bitmap before moving to that scheme. I do not believe this
363 * RCU head in the bitmap, which adds a 2-pointer overhead to each 128-byte
364 * bitmap, which is excessive.
[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/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).
15 /// Represents a C bitmap. Wraps underlying C bitmap API.
22 pub struct Bitmap { struct
26 impl Bitmap { impl
27 /// Borrows a C bitmap.
33 /// * the array must not be freed for the lifetime of this [`Bitmap`]
35 pub unsafe fn from_raw<'a>(ptr: *const usize, nbits: usize) -> &'a Bitmap { in from_raw() argument
42 // We are casting `*const [()]` to `*const Bitmap`. The `Bitmap` in from_raw()
48 // 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 …]
H A Dbuddy.c13 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/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/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/
H A Ddr_buddy.c19 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/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()
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/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