/linux/fs/nilfs2/ |
H A D | bmap.c | 22 struct inode *nilfs_bmap_get_dat(const struct nilfs_bmap *bmap) in nilfs_bmap_get_dat() argument 24 struct the_nilfs *nilfs = bmap->b_inode->i_sb->s_fs_info; in nilfs_bmap_get_dat() 29 static int nilfs_bmap_convert_error(struct nilfs_bmap *bmap, in nilfs_bmap_convert_error() argument 32 struct inode *inode = bmap->b_inode; in nilfs_bmap_convert_error() 62 int nilfs_bmap_lookup_at_level(struct nilfs_bmap *bmap, __u64 key, int level, in nilfs_bmap_lookup_at_level() argument 68 down_read(&bmap->b_sem); in nilfs_bmap_lookup_at_level() 69 ret = bmap->b_ops->bop_lookup(bmap, key, level, ptrp); in nilfs_bmap_lookup_at_level() 73 if (NILFS_BMAP_USE_VBN(bmap)) { in nilfs_bmap_lookup_at_level() 74 ret = nilfs_dat_translate(nilfs_bmap_get_dat(bmap), *ptrp, in nilfs_bmap_lookup_at_level() 90 up_read(&bmap->b_sem); in nilfs_bmap_lookup_at_level() [all …]
|
H A D | direct.c | 111 static int nilfs_direct_insert(struct nilfs_bmap *bmap, __u64 key, __u64 ptr) in nilfs_direct_insert() argument 120 if (nilfs_direct_get_ptr(bmap, key) != NILFS_BMAP_INVALID_PTR) in nilfs_direct_insert() 123 if (NILFS_BMAP_USE_VBN(bmap)) { in nilfs_direct_insert() 124 req.bpr_ptr = nilfs_direct_find_target_v(bmap, key); in nilfs_direct_insert() 125 dat = nilfs_bmap_get_dat(bmap); in nilfs_direct_insert() 127 ret = nilfs_bmap_prepare_alloc_ptr(bmap, &req, dat); in nilfs_direct_insert() 133 nilfs_bmap_commit_alloc_ptr(bmap, &req, dat); in nilfs_direct_insert() 134 nilfs_direct_set_ptr(bmap, key, req.bpr_ptr); in nilfs_direct_insert() 136 if (!nilfs_bmap_dirty(bmap)) in nilfs_direct_insert() 137 nilfs_bmap_set_dirty(bmap); in nilfs_direct_insert() [all …]
|
H A D | bmap.h | 138 #define NILFS_BMAP_USE_VBN(bmap) ((bmap)->b_ptr_type > 0) argument 161 int nilfs_bmap_insert(struct nilfs_bmap *bmap, __u64 key, unsigned long rec); 162 int nilfs_bmap_delete(struct nilfs_bmap *bmap, __u64 key); 163 int nilfs_bmap_seek_key(struct nilfs_bmap *bmap, __u64 start, __u64 *keyp); 164 int nilfs_bmap_last_key(struct nilfs_bmap *bmap, __u64 *keyp); 165 int nilfs_bmap_truncate(struct nilfs_bmap *bmap, __u64 key); 179 static inline int nilfs_bmap_lookup(struct nilfs_bmap *bmap, __u64 key, in nilfs_bmap_lookup() argument 182 return nilfs_bmap_lookup_at_level(bmap, key, 1, ptr); in nilfs_bmap_lookup() 190 static inline int nilfs_bmap_prepare_alloc_ptr(struct nilfs_bmap *bmap, in nilfs_bmap_prepare_alloc_ptr() argument 197 req->bpr_ptr = bmap->b_last_allocated_ptr++; in nilfs_bmap_prepare_alloc_ptr() [all …]
|
/linux/lib/ |
H A D | test_bitmap.c | 76 const unsigned long *exp_bmap, const unsigned long *bmap, in __check_eq_bitmap() argument 79 if (!bitmap_equal(exp_bmap, bmap, nbits)) { in __check_eq_bitmap() 82 nbits, exp_bmap, nbits, bmap); in __check_eq_bitmap() 197 DECLARE_BITMAP(bmap, 1024); in test_zero_clear() 200 memset(bmap, 0xff, 128); in test_zero_clear() 202 expect_eq_pbl("0-22", bmap, 23); in test_zero_clear() 203 expect_eq_pbl("0-1023", bmap, 1024); in test_zero_clear() 206 bitmap_clear(bmap, 0, 9); in test_zero_clear() 207 expect_eq_pbl("9-1023", bmap, 1024); in test_zero_clear() 209 bitmap_zero(bmap, 35); in test_zero_clear() [all …]
|
/linux/fs/xfs/scrub/ |
H A D | dqiterate.c | 32 cursor->bmap.br_startoff = NULLFILEOFF; in xchk_dqiter_init() 60 if (cursor->bmap.br_startoff != NULLFILEOFF && in xchk_dquot_iter_revalidate_bmap() 62 cursor->bmap.br_startoff + cursor->bmap.br_blockcount > fileoff) in xchk_dquot_iter_revalidate_bmap() 67 XFS_MAX_FILEOFF - fileoff, &cursor->bmap, &nmaps, 0); in xchk_dquot_iter_revalidate_bmap() 74 if (cursor->bmap.br_startoff > fileoff) { in xchk_dquot_iter_revalidate_bmap() 75 ASSERT(cursor->bmap.br_startoff == fileoff); in xchk_dquot_iter_revalidate_bmap() 100 fileoff = cursor->bmap.br_startoff + cursor->bmap.br_blockcount; in xchk_dquot_iter_advance_bmap() 108 XFS_MAX_FILEOFF - fileoff, &cursor->bmap, in xchk_dquot_iter_advance_bmap() 117 if (cursor->bmap.br_startoff > fileoff) { in xchk_dquot_iter_advance_bmap() 118 ASSERT(cursor->bmap.br_startoff == fileoff); in xchk_dquot_iter_advance_bmap() [all …]
|
/linux/fs/affs/ |
H A D | bitmap.c | 44 u32 blk, bmap, bit, mask, tmp; in affs_free_block() local 53 bmap = blk / sbi->s_bmap_bits; in affs_free_block() 55 bm = &sbi->s_bitmap[bmap]; in affs_free_block() 60 if (sbi->s_last_bmap != bmap) { in affs_free_block() 66 sbi->s_last_bmap = bmap; in affs_free_block() 122 u32 blk, bmap, bit, mask, mask2, tmp; in affs_alloc_block() local 145 bmap = blk / sbi->s_bmap_bits; in affs_alloc_block() 146 bm = &sbi->s_bitmap[bmap]; in affs_alloc_block() 159 bmap++; in affs_alloc_block() 161 if (bmap < sbi->s_bmap_count) in affs_alloc_block() [all …]
|
/linux/tools/testing/selftests/kvm/x86_64/ |
H A D | vmx_dirty_log_test.c | 84 unsigned long *bmap; in test_vmx_dirty_log() local 129 bmap = bitmap_zalloc(TEST_MEM_PAGES); in test_vmx_dirty_log() 146 kvm_vm_get_dirty_log(vm, TEST_MEM_SLOT_INDEX, bmap); in test_vmx_dirty_log() 148 TEST_ASSERT(test_bit(0, bmap), "Page 0 incorrectly reported clean"); in test_vmx_dirty_log() 151 TEST_ASSERT(!test_bit(0, bmap), "Page 0 incorrectly reported dirty"); in test_vmx_dirty_log() 155 TEST_ASSERT(!test_bit(1, bmap), "Page 1 incorrectly reported dirty"); in test_vmx_dirty_log() 157 TEST_ASSERT(!test_bit(2, bmap), "Page 2 incorrectly reported dirty"); in test_vmx_dirty_log()
|
/linux/include/uapi/linux/netfilter/ |
H A D | xt_TCPOPTSTRIP.h | 7 #define tcpoptstrip_set_bit(bmap, idx) \ argument 8 (bmap[(idx) >> 5] |= 1U << (idx & 31)) 9 #define tcpoptstrip_test_bit(bmap, idx) \ argument 10 (((1U << (idx & 31)) & bmap[(idx) >> 5]) != 0)
|
/linux/drivers/crypto/marvell/octeontx/ |
H A D | otx_cptpf_ucode.c | 60 struct otx_cpt_bitmap bmap = { {0} }; in get_cores_bmap() local 67 return bmap; in get_cores_bmap() 72 bitmap_or(bmap.bits, bmap.bits, in get_cores_bmap() 73 eng_grp->engs[i].bmap, in get_cores_bmap() 75 bmap.size = eng_grp->g->engs_num; in get_cores_bmap() 83 return bmap; in get_cores_bmap() 179 struct otx_cpt_bitmap bmap; in cpt_set_ucode_base() local 182 bmap = get_cores_bmap(&cpt->pdev->dev, eng_grp); in cpt_set_ucode_base() 183 if (!bmap.size) in cpt_set_ucode_base() 196 for_each_set_bit(i, bmap.bits, bmap.size) in cpt_set_ucode_base() [all …]
|
/linux/drivers/net/ethernet/brocade/bna/ |
H A D | bnad_ethtool.c | 602 u32 bmap; in bnad_get_strings() local 614 bmap = bna_tx_rid_mask(&bnad->bna); in bnad_get_strings() 615 for (i = 0; bmap; i++) { in bnad_get_strings() 616 if (bmap & 1) in bnad_get_strings() 618 bmap >>= 1; in bnad_get_strings() 621 bmap = bna_rx_rid_mask(&bnad->bna); in bnad_get_strings() 622 for (i = 0; bmap; i++, bmap >>= 1) { in bnad_get_strings() 623 if (bmap & 1) in bnad_get_strings() 625 bmap >>= 1; in bnad_get_strings() 665 u32 bmap; in bnad_get_stats_count_locked() local [all …]
|
/linux/arch/riscv/kernel/ |
H A D | vendor_extensions.c | 34 struct riscv_isavendorinfo *bmap; in __riscv_isa_vendor_extension_available() local 40 bmap = &riscv_isa_vendor_ext_list_andes.all_harts_isa_bitmap; in __riscv_isa_vendor_extension_available() 49 bmap = &cpu_bmap[cpu]; in __riscv_isa_vendor_extension_available() 54 return test_bit(bit, bmap->isa) ? true : false; in __riscv_isa_vendor_extension_available()
|
/linux/drivers/crypto/marvell/octeontx2/ |
H A D | otx2_cptpf_ucode.c | 32 struct otx2_cpt_bitmap bmap = { {0} }; in get_cores_bmap() local 40 return bmap; in get_cores_bmap() 45 bitmap_or(bmap.bits, bmap.bits, in get_cores_bmap() 46 eng_grp->engs[i].bmap, in get_cores_bmap() 48 bmap.size = eng_grp->g->engs_num; in get_cores_bmap() 56 return bmap; in get_cores_bmap() 193 for_each_set_bit(bit, engs->bmap, eng_grp->g->engs_num) in cptx_set_ucode_base() 219 struct otx2_cpt_bitmap bmap, in cptx_detach_and_disable_cores() argument 227 for_each_set_bit(i, bmap.bits, bmap.size) { in cptx_detach_and_disable_cores() 253 for_each_set_bit(i, bmap.bits, bmap.size) { in cptx_detach_and_disable_cores() [all …]
|
/linux/fs/jfs/ |
H A D | jfs_dmap.c | 64 static void dbAllocBits(struct bmap * bmp, struct dmap * dp, s64 blkno, 70 static int dbAdjCtl(struct bmap * bmp, s64 blkno, int newval, int alloc, 72 static int dbAllocAny(struct bmap * bmp, s64 nblocks, int l2nb, s64 * results); 73 static int dbAllocNext(struct bmap * bmp, struct dmap * dp, s64 blkno, 75 static int dbAllocNear(struct bmap * bmp, struct dmap * dp, s64 blkno, 78 static int dbAllocDmap(struct bmap * bmp, struct dmap * dp, s64 blkno, 80 static int dbAllocDmapLev(struct bmap * bmp, struct dmap * dp, int nblocks, 83 static int dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, 85 static int dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno, 89 static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno); [all …]
|
H A D | file.c | 66 atomic_inc(&jfs_sb->bmap->db_active[ji->active_ag]); in jfs_open() 79 struct bmap *bmap = JFS_SBI(inode->i_sb)->bmap; in jfs_release() local 80 atomic_dec(&bmap->db_active[ji->active_ag]); in jfs_release()
|
H A D | inode.c | 173 struct bmap *bmap = JFS_SBI(inode->i_sb)->bmap; in jfs_evict_inode() local 174 atomic_dec(&bmap->db_active[ji->active_ag]); in jfs_evict_inode() 356 .bmap = jfs_bmap,
|
H A D | jfs_discard.c | 68 struct bmap *bmp; in jfs_ioc_trim() 87 bmp = JFS_SBI(ip->i_sb)->bmap; in jfs_ioc_trim()
|
H A D | jfs_dmap.h | 121 #define BLKTOAG(b,sbi) ((b) >> ((sbi)->bmap->db_agl2size)) 127 ((s64)(a) << (JFS_SBI((ip)->i_sb)->bmap->db_agl2size)) 230 struct bmap { struct
|
/linux/drivers/net/ethernet/qlogic/qed/ |
H A D | qed_rdma.h | 189 struct qed_bmap *bmap, u32 max_count, char *name); 192 qed_rdma_bmap_free(struct qed_hwfn *p_hwfn, struct qed_bmap *bmap, bool check); 196 struct qed_bmap *bmap, u32 *id_num); 199 qed_bmap_set_id(struct qed_hwfn *p_hwfn, struct qed_bmap *bmap, u32 id_num); 202 qed_bmap_release_id(struct qed_hwfn *p_hwfn, struct qed_bmap *bmap, u32 id_num); 205 qed_bmap_test_id(struct qed_hwfn *p_hwfn, struct qed_bmap *bmap, u32 id_num);
|
H A D | qed_rdma.c | 39 struct qed_bmap *bmap, u32 max_count, char *name) in qed_rdma_bmap_alloc() argument 43 bmap->max_count = max_count; in qed_rdma_bmap_alloc() 45 bmap->bitmap = bitmap_zalloc(max_count, GFP_KERNEL); in qed_rdma_bmap_alloc() 46 if (!bmap->bitmap) in qed_rdma_bmap_alloc() 49 snprintf(bmap->name, QED_RDMA_MAX_BMAP_NAME, "%s", name); in qed_rdma_bmap_alloc() 56 struct qed_bmap *bmap, u32 *id_num) in qed_rdma_bmap_alloc_id() argument 58 *id_num = find_first_zero_bit(bmap->bitmap, bmap->max_count); in qed_rdma_bmap_alloc_id() 59 if (*id_num >= bmap->max_count) in qed_rdma_bmap_alloc_id() 62 __set_bit(*id_num, bmap->bitmap); in qed_rdma_bmap_alloc_id() 65 bmap->name, *id_num); in qed_rdma_bmap_alloc_id() [all …]
|
/linux/drivers/net/ethernet/chelsio/libcxgb/ |
H A D | libcxgb_ppm.c | 84 static int ppm_find_unused_entries(unsigned long *bmap, in ppm_find_unused_entries() argument 92 i = bitmap_find_next_zero_area(bmap, max_ppods, start, nr, align_mask); in ppm_find_unused_entries() 95 i = bitmap_find_next_zero_area(bmap, max_ppods, 0, start - 1, in ppm_find_unused_entries() 100 bitmap_set(bmap, i, nr); in ppm_find_unused_entries() 133 i = ppm_find_unused_entries(pool->bmap, ppm->pool_index_max, in ppm_get_cpu_entries() 204 bitmap_clear(pool->bmap, i, count); in ppm_unmark_entries() 351 unsigned int bmap; in ppm_alloc_cpu_pool() local 361 bmap = ppmax / BITS_PER_TYPE(unsigned long); in ppm_alloc_cpu_pool() 362 if (!bmap) in ppm_alloc_cpu_pool() 365 ppmax = (bmap * sizeof(unsigned long)) << 3; in ppm_alloc_cpu_pool() [all …]
|
/linux/tools/testing/selftests/kvm/ |
H A D | dirty_log_test.c | 548 static void vm_dirty_log_verify(enum vm_guest_mode mode, unsigned long *bmap) in vm_dirty_log_verify() argument 561 TEST_ASSERT(test_bit_le(page, bmap), in vm_dirty_log_verify() 567 if (__test_and_clear_bit_le(page, bmap)) { in vm_dirty_log_verify() 691 unsigned long *bmap; in run_test() local 738 bmap = bitmap_zalloc(host_num_pages); in run_test() 785 bmap, host_num_pages, in run_test() 803 vm_dirty_log_verify(mode, bmap); in run_test() 825 free(bmap); in run_test()
|
/linux/arch/sparc/mm/ |
H A D | io-unit.c | 118 nexti: scan = find_next_zero_bit(iounit->bmap, limit, scan); in iounit_get_area() 131 if (test_bit(scan++, iounit->bmap)) in iounit_get_area() 138 set_bit(scan, iounit->bmap); in iounit_get_area() 192 clear_bit(vaddr, iounit->bmap); in iounit_unmap_page() 210 clear_bit(vaddr, iounit->bmap); in iounit_unmap_sg()
|
/linux/include/linux/ |
H A D | hid.h | 1051 unsigned long *bmap = NULL; in hid_map_usage() local 1056 bmap = input->absbit; in hid_map_usage() 1060 bmap = input->relbit; in hid_map_usage() 1064 bmap = input->keybit; in hid_map_usage() 1068 bmap = input->ledbit; in hid_map_usage() 1072 bmap = input->mscbit; in hid_map_usage() 1077 if (unlikely(c > limit || !bmap)) { in hid_map_usage() 1087 *bit = bmap; in hid_map_usage()
|
/linux/drivers/net/ethernet/marvell/octeontx2/af/ |
H A D | rvu.c | 132 if (!rsrc->bmap) in rvu_alloc_rsrc() 135 id = find_first_zero_bit(rsrc->bmap, rsrc->max); in rvu_alloc_rsrc() 139 __set_bit(id, rsrc->bmap); in rvu_alloc_rsrc() 148 if (!rsrc->bmap) in rvu_alloc_rsrc_contig() 151 start = bitmap_find_next_zero_area(rsrc->bmap, rsrc->max, 0, nrsrc, 0); in rvu_alloc_rsrc_contig() 155 bitmap_set(rsrc->bmap, start, nrsrc); in rvu_alloc_rsrc_contig() 161 if (!rsrc->bmap) in rvu_free_rsrc_contig() 166 bitmap_clear(rsrc->bmap, start, nrsrc); in rvu_free_rsrc_contig() 173 if (!rsrc->bmap) in rvu_rsrc_check_contig() 176 start = bitmap_find_next_zero_area(rsrc->bmap, rsrc->max, 0, nrsrc, 0); in rvu_rsrc_check_contig() [all …]
|
H A D | rvu_npc_hash.c | 477 if (test_bit(hash + i * depth, table->mem_table.bmap)) in rvu_npc_exact_alloc_mem_table_entry() 480 set_bit(hash + i * depth, table->mem_table.bmap); in rvu_npc_exact_alloc_mem_table_entry() 493 bitmap_weight(table->mem_table.bmap, table->mem_table.depth)); in rvu_npc_exact_alloc_mem_table_entry() 560 idx = find_first_zero_bit(table->cam_table.bmap, table->cam_table.depth); in rvu_npc_exact_alloc_cam_table_entry() 564 bitmap_weight(table->cam_table.bmap, table->cam_table.depth)); in rvu_npc_exact_alloc_cam_table_entry() 569 set_bit(idx, table->cam_table.bmap); in rvu_npc_exact_alloc_cam_table_entry() 919 if (!test_bit(index, table->cam_table.bmap)) { in rvu_npc_exact_dealloc_table_entry() 927 clear_bit(index, table->cam_table.bmap); in rvu_npc_exact_dealloc_table_entry() 933 if (!test_bit(index + ways * depth, table->mem_table.bmap)) { in rvu_npc_exact_dealloc_table_entry() 941 clear_bit(index + ways * depth, table->mem_table.bmap); in rvu_npc_exact_dealloc_table_entry() [all …]
|