Lines Matching refs:size
396 bool aa_label_init(struct aa_label *label, int size, gfp_t gfp) in aa_label_init() argument
399 AA_BUG(size < 1); in aa_label_init()
404 label->size = size; /* doesn't include null */ in aa_label_init()
405 label->vec[size] = NULL; /* null terminate */ in aa_label_init()
421 struct aa_label *aa_label_alloc(int size, struct aa_proxy *proxy, gfp_t gfp) in aa_label_alloc() argument
425 AA_BUG(size < 1); in aa_label_alloc()
428 new = kzalloc(sizeof(*new) + sizeof(struct aa_profile *) * (size + 1), in aa_label_alloc()
434 if (!aa_label_init(new, size, gfp)) in aa_label_alloc()
471 return vec_cmp(a->vec, a->size, b->vec, b->size); in label_cmp()
480 for (; i < label->size; i++) { in aa_label_next_confined()
504 AA_BUG(I->i > set->size); in __aa_label_next_not_in_set()
507 AA_BUG(I->j > sub->size); in __aa_label_next_not_in_set()
509 while (I->j < sub->size && I->i < set->size) { in __aa_label_next_not_in_set()
521 if (I->j < sub->size) in __aa_label_next_not_in_set()
731 int result = vec_cmp(this->vec, this->size, vec, n); in __vec_find()
759 return __vec_find(label->vec, label->size); in __label_find()
912 return vec_find(label->vec, label->size); in aa_label_find()
968 AA_BUG(I->i > a->size); in aa_label_next_in_merge()
970 AA_BUG(I->j > b->size); in aa_label_next_in_merge()
972 if (I->i < a->size) { in aa_label_next_in_merge()
973 if (I->j < b->size) { in aa_label_next_in_merge()
985 if (I->j < b->size) in aa_label_next_in_merge()
1015 k < z->size && (p = aa_label_next_in_merge(&i, a, b)); in label_merge_cmp()
1025 else if (k < z->size) in label_merge_cmp()
1060 AA_BUG(a->size < 0); in label_merge_insert()
1062 AA_BUG(b->size < 0); in label_merge_insert()
1064 AA_BUG(new->size < a->size + b->size); in label_merge_insert()
1080 new->size = k; in label_merge_insert()
1084 new->size -= aa_vec_unique(&new->vec[0], new->size, in label_merge_insert()
1087 if (new->size == 1) { in label_merge_insert()
1096 if (k == a->size) in label_merge_insert()
1098 else if (k == b->size) in label_merge_insert()
1101 if (vec_unconfined(new->vec, new->size)) in label_merge_insert()
1244 new = aa_label_alloc(a->size + b->size, NULL, gfp); in aa_label_merge()
1487 #define update_for_len(total, len, size, str) \ argument
1493 ulen = min(ulen, size); \
1494 size -= ulen; \
1512 static int aa_profile_snxprint(char *str, size_t size, struct aa_ns *view, in aa_profile_snxprint() argument
1518 AA_BUG(!str && size != 0); in aa_profile_snxprint()
1532 return snprintf(str, size, "%s", "unconfined"); in aa_profile_snxprint()
1533 return snprintf(str, size, "%s", ns_name); in aa_profile_snxprint()
1541 return snprintf(str, size, ":%s:%s (%s)", ns_name, in aa_profile_snxprint()
1543 return snprintf(str, size, "%s (%s)", profile->base.hname, in aa_profile_snxprint()
1548 return snprintf(str, size, ":%s:%s", ns_name, in aa_profile_snxprint()
1550 return snprintf(str, size, "%s", profile->base.hname); in aa_profile_snxprint()
1623 int aa_label_snxprint(char *str, size_t size, struct aa_ns *ns, in aa_label_snxprint() argument
1632 AA_BUG(!str && size != 0); in aa_label_snxprint()
1637 len = snprintf(str, size, "_"); in aa_label_snxprint()
1638 update_for_len(total, len, size, str); in aa_label_snxprint()
1646 len = snprintf(str, size, "//&"); in aa_label_snxprint()
1647 update_for_len(total, len, size, str); in aa_label_snxprint()
1649 len = aa_profile_snxprint(str, size, ns, profile, in aa_label_snxprint()
1652 update_for_len(total, len, size, str); in aa_label_snxprint()
1659 return snprintf(str, size, "%s", "unconfined"); in aa_label_snxprint()
1660 return snprintf(str, size, "%s", aa_hidden_ns_name); in aa_label_snxprint()
1667 len = snprintf(str, size, " (%s)", in aa_label_snxprint()
1669 update_for_len(total, len, size, str); in aa_label_snxprint()
1690 int size; in aa_label_asxprint() local
1695 size = aa_label_snxprint(NULL, 0, ns, label, flags); in aa_label_asxprint()
1696 if (size < 0) in aa_label_asxprint()
1697 return size; in aa_label_asxprint()
1699 *strp = kmalloc(size + 1, gfp); in aa_label_asxprint()
1702 return aa_label_snxprint(*strp, size + 1, ns, label, flags); in aa_label_asxprint()
1719 int size; in aa_label_acntsxprint() local
1724 size = aa_label_snxprint(NULL, 0, ns, label, flags); in aa_label_acntsxprint()
1725 if (size < 0) in aa_label_acntsxprint()
1726 return size; in aa_label_acntsxprint()
1728 *strp = aa_str_alloc(size + 1, gfp); in aa_label_acntsxprint()
1731 return aa_label_snxprint(*strp, size + 1, ns, label, flags); in aa_label_acntsxprint()
1906 stack = base->size; in aa_label_strn_parse()
2025 vec_is_stale(label->vec, label->size)) && in labelset_next_stale()
2060 new = aa_label_alloc(label->size, label->proxy, GFP_KERNEL); in __label_update()
2070 for (i = 0; i < label->size; i++) { in __label_update()
2082 new->size -= aa_vec_unique(&new->vec[0], new->size, in __label_update()
2085 if (new->size == 1) { in __label_update()