Lines Matching refs:cnt

243 	u32 cnt;  member
248 u32 cnt; member
1712 for (i = 0; i < tab->cnt; i++) in btf_struct_metas_free()
1733 for (i = 0; i < tab->cnt; i++) in btf_free_struct_ops_tab()
3967 int ret, i, cnt; in btf_parse_fields() local
3975 cnt = ret; in btf_parse_fields()
3979 rec = kzalloc(struct_size(rec, fields, cnt), GFP_KERNEL_ACCOUNT | __GFP_NOWARN); in btf_parse_fields()
3988 for (i = 0; i < cnt; i++) { in btf_parse_fields()
4057 rec->cnt++; in btf_parse_fields()
4080 sort_r(rec->fields, rec->cnt, sizeof(struct btf_field), btf_field_cmp, in btf_parse_fields()
4103 for (i = 0; i < rec->cnt; i++) { in btf_check_and_fixup_fields()
5586 BUILD_BUG_ON(offsetof(struct btf_id_set, cnt) != 0); in btf_parse_struct_metas()
5592 aof->cnt = 0; in btf_parse_struct_metas()
5605 new_aof = krealloc(aof, struct_size(new_aof, ids, aof->cnt + 1), in btf_parse_struct_metas()
5612 aof->ids[aof->cnt++] = id; in btf_parse_struct_metas()
5632 new_aof = krealloc(aof, struct_size(new_aof, ids, aof->cnt + 1), in btf_parse_struct_metas()
5639 aof->ids[aof->cnt++] = i; in btf_parse_struct_metas()
5642 if (!aof->cnt) { in btf_parse_struct_metas()
5646 sort(&aof->ids, aof->cnt, sizeof(aof->ids[0]), btf_id_cmp_func, NULL); in btf_parse_struct_metas()
5668 tab_cnt = tab ? tab->cnt : 0; in btf_parse_struct_metas()
5676 new_tab->cnt = 0; in btf_parse_struct_metas()
5679 type = &tab->types[tab->cnt]; in btf_parse_struct_metas()
5690 tab->cnt++; in btf_parse_struct_metas()
5709 return bsearch(&btf_id, tab->types, tab->cnt, sizeof(tab->types[0]), btf_id_cmp_func); in btf_find_struct_meta()
5848 for (i = 0; i < struct_meta_tab->cnt; i++) { in btf_parse()
7209 for (i = 0; i < rec->cnt; i++) { in btf_struct_access()
7590 u16 cnt; member
7630 if (cc->cnt != 1) { in btf_get_ptr_to_btf_id()
7633 cc->cnt == 0 ? "has no matches" : "is ambiguous"); in btf_get_ptr_to_btf_id()
7634 err = cc->cnt == 0 ? -ENOENT : -ESRCH; in btf_get_ptr_to_btf_id()
8560 if (!add_set->cnt) in btf_populate_kfunc_set()
8608 set_cnt = set ? set->cnt : 0; in btf_populate_kfunc_set()
8610 if (set_cnt > U32_MAX - add_set->cnt) { in btf_populate_kfunc_set()
8615 if (set_cnt + add_set->cnt > BTF_KFUNC_SET_MAX_CNT) { in btf_populate_kfunc_set()
8622 struct_size(set, pairs, set_cnt + add_set->cnt), in btf_populate_kfunc_set()
8631 set->cnt = 0; in btf_populate_kfunc_set()
8635 memcpy(set->pairs + set->cnt, add_set->pairs, add_set->cnt * sizeof(set->pairs[0])); in btf_populate_kfunc_set()
8637 for (i = set->cnt; i < set->cnt + add_set->cnt; i++) in btf_populate_kfunc_set()
8640 set->cnt += add_set->cnt; in btf_populate_kfunc_set()
8642 sort(set->pairs, set->cnt, sizeof(set->pairs[0]), btf_id_cmp_func, NULL); in btf_populate_kfunc_set()
8769 for (i = 0; i < kset->set->cnt; i++) { in __register_btf_kfunc_id_set()
8820 dtor = bsearch(&btf_id, tab->dtors, tab->cnt, sizeof(tab->dtors[0]), btf_id_cmp_func); in btf_find_dtor_kfunc()
8826 static int btf_check_dtor_kfuncs(struct btf *btf, const struct btf_id_dtor_kfunc *dtors, u32 cnt) in btf_check_dtor_kfuncs() argument
8833 for (i = 0; i < cnt; i++) { in btf_check_dtor_kfuncs()
8896 tab_cnt = tab ? tab->cnt : 0; in register_btf_id_dtor_kfuncs()
8916 tab->cnt = 0; in register_btf_id_dtor_kfuncs()
8919 memcpy(tab->dtors + tab->cnt, dtors, add_cnt * sizeof(tab->dtors[0])); in register_btf_id_dtor_kfuncs()
8927 tab->cnt += add_cnt; in register_btf_id_dtor_kfuncs()
8929 sort(tab->dtors, tab->cnt, sizeof(tab->dtors[0]), btf_id_cmp_func, NULL); in register_btf_id_dtor_kfuncs()
8998 if (!cands->cnt) in bpf_free_cands()
9028 for (j = 0; j < cc->cnt; j++) { in __print_cand_cache()
9030 if (j < cc->cnt - 1) in __print_cand_cache()
9065 static size_t sizeof_cands(int cnt) in sizeof_cands() argument
9067 return offsetof(struct bpf_cand_cache, cands[cnt]); in sizeof_cands()
9080 new_cands = kmemdup(cands, sizeof_cands(cands->cnt), GFP_KERNEL_ACCOUNT); in populate_cand_cache()
9121 for (j = 0; j < cc->cnt; j++) in __purge_cand_cache()
9172 new_cands = kmalloc(sizeof_cands(cands->cnt + 1), GFP_KERNEL_ACCOUNT); in bpf_core_add_cands()
9178 memcpy(new_cands, cands, sizeof_cands(cands->cnt)); in bpf_core_add_cands()
9181 cands->cands[cands->cnt].btf = targ_btf; in bpf_core_add_cands()
9182 cands->cands[cands->cnt].id = i; in bpf_core_add_cands()
9183 cands->cnt++; in bpf_core_add_cands()
9223 if (cc->cnt) in bpf_core_find_cands()
9241 if (cc->cnt) in bpf_core_find_cands()
9313 if (cc->cnt) { in bpf_core_apply()
9314 cands.cands = kcalloc(cc->cnt, sizeof(*cands.cands), GFP_KERNEL_ACCOUNT); in bpf_core_apply()
9320 for (i = 0; i < cc->cnt; i++) { in bpf_core_apply()
9327 cands.len = cc->cnt; in bpf_core_apply()
9473 for (i = 0; i < tab->cnt; i++) in btf_add_struct_ops()
9477 if (tab->cnt == tab->capacity) { in btf_add_struct_ops()
9488 tab->ops[btf->struct_ops_tab->cnt].st_ops = st_ops; in btf_add_struct_ops()
9490 err = bpf_struct_ops_desc_init(&tab->ops[btf->struct_ops_tab->cnt], btf, log); in btf_add_struct_ops()
9494 btf->struct_ops_tab->cnt++; in btf_add_struct_ops()
9504 u32 cnt; in bpf_struct_ops_find_value() local
9511 cnt = btf->struct_ops_tab->cnt; in bpf_struct_ops_find_value()
9513 for (i = 0; i < cnt; i++) { in bpf_struct_ops_find_value()
9526 u32 cnt; in bpf_struct_ops_find() local
9533 cnt = btf->struct_ops_tab->cnt; in bpf_struct_ops_find()
9535 for (i = 0; i < cnt; i++) { in bpf_struct_ops_find()