/linux-6.12.1/drivers/md/ |
D | md-bitmap.c | 3 * 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 33 #include "md-bitmap.h" 36 /* version 4 insists the bitmap is in little-endian order 45 * in-memory bitmap: 123 * bitmap structures: 126 /* the in-memory bitmap is represented by bitmap_pages */ [all …]
|
/linux-6.12.1/drivers/iommu/iommufd/ |
D | iova_bitmap.c | 14 * 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-6.12.1/fs/xfs/scrub/ |
D | bitmap.c | 15 #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 …]
|
D | bitmap.h | 9 /* 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 …]
|
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 | 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 …]
|
/linux-6.12.1/lib/ |
D | find_bit_benchmark.c | 14 * - 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 …]
|
D | idr.c | 2 #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 …]
|
D | bitmap.c | 3 * 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 …]
|
D | bitmap-str.c | 3 #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 …]
|
/linux-6.12.1/drivers/net/ethernet/mellanox/mlx4/ |
D | alloc.c | 38 #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-6.12.1/fs/afs/ |
D | dir_edit.c | 19 * There are 64 slots, which means we can load the entire bitmap into a 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() [all …]
|
/linux-6.12.1/include/linux/ |
D | bitmap.h | 15 #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 [all …]
|
/linux-6.12.1/arch/powerpc/sysdev/ |
D | msi_bitmap.c | 9 #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 size is 0x%x bytes\n", size); in msi_bitmap_alloc() [all …]
|
/linux-6.12.1/drivers/gpu/drm/panfrost/ |
D | panfrost_regs.h | 93 #define GPU_SHADER_PRESENT_LO 0x100 /* (RO) Shader core present bitmap, low word */ 94 #define GPU_SHADER_PRESENT_HI 0x104 /* (RO) Shader core present bitmap, high word */ 95 #define GPU_TILER_PRESENT_LO 0x110 /* (RO) Tiler core present bitmap, low word */ 96 #define GPU_TILER_PRESENT_HI 0x114 /* (RO) Tiler core present bitmap, high word */ 98 #define GPU_L2_PRESENT_LO 0x120 /* (RO) Level 2 cache present bitmap, low word */ 99 #define GPU_L2_PRESENT_HI 0x124 /* (RO) Level 2 cache present bitmap, high word */ 105 #define GPU_STACK_PRESENT_LO 0xE00 /* (RO) Core stack present bitmap, low word */ 106 #define GPU_STACK_PRESENT_HI 0xE04 /* (RO) Core stack present bitmap, high word */ 108 #define SHADER_READY_LO 0x140 /* (RO) Shader core ready bitmap, low word */ 109 #define SHADER_READY_HI 0x144 /* (RO) Shader core ready bitmap, high word */ [all …]
|
/linux-6.12.1/fs/btrfs/tests/ |
D | free-space-tests.c | 95 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-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/block/drbd/ |
D | drbd_bitmap.c | 15 #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-6.12.1/drivers/firmware/efi/libstub/ |
D | unaccepted_memory.c | 49 * 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-6.12.1/fs/hfs/ |
D | bitmap.c | 2 * 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-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/fs/reiserfs/ |
D | resize.c | 23 struct reiserfs_bitmap_info *bitmap; in reiserfs_resize() local 63 …("reiserfs_resize: unable to resize a reiserfs without distributed bitmap (fs version < 3.5.12)\n"… in reiserfs_resize() 67 /* count used bits in last bitmap block */ in reiserfs_resize() 71 /* count bitmap blocks in new fs */ in reiserfs_resize() 93 * the bitmap node pointers from the old journal bitmap in reiserfs_resize() 119 * allocate additional bitmap blocks, reallocate in reiserfs_resize() 120 * array of bitmap block pointers in reiserfs_resize() 122 bitmap = in reiserfs_resize() 125 if (!bitmap) { in reiserfs_resize() 134 bitmap[i] = old_bitmap[i]; in reiserfs_resize() [all …]
|
/linux-6.12.1/drivers/s390/cio/ |
D | idset.c | 8 #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-6.12.1/arch/x86/kernel/ |
D | ioport.c | 3 * 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-6.12.1/drivers/net/wireless/intel/iwlwifi/fw/api/ |
D | nvm-reg.h | 522 * @oem_uhb_allow_bitmap: bitmap of UHB enabled MCC sets 533 * @oem_uhb_allow_bitmap: bitmap of UHB enabled MCC sets 534 * @oem_11ax_allow_bitmap: bitmap of 11ax allowed MCCs. 546 * @config_bitmap: Bitmap of the config commands. Each bit will trigger a 548 * @oem_uhb_allow_bitmap: Bitmap of UHB enabled MCC sets. 549 * @oem_11ax_allow_bitmap: Bitmap of 11ax allowed MCCs. There are two bits 552 * @oem_unii4_allow_bitmap: Bitmap of unii4 allowed MCCs.There are two bits 565 * @config_bitmap: Bitmap of the config commands. Each bit will trigger a 567 * @oem_uhb_allow_bitmap: Bitmap of UHB enabled MCC sets. 568 * @oem_11ax_allow_bitmap: Bitmap of 11ax allowed MCCs. There are two bits [all …]
|