Lines Matching refs:cur
110 struct avtab_node *prev, *cur, *newnode; in avtab_insert() local
117 for (prev = NULL, cur = h->htable[hvalue]; in avtab_insert()
118 cur; in avtab_insert()
119 prev = cur, cur = cur->next) { in avtab_insert()
120 if (key->source_type == cur->key.source_type && in avtab_insert()
121 key->target_type == cur->key.target_type && in avtab_insert()
122 key->target_class == cur->key.target_class && in avtab_insert()
123 (specified & cur->key.specified)) { in avtab_insert()
129 if (key->source_type < cur->key.source_type) in avtab_insert()
131 if (key->source_type == cur->key.source_type && in avtab_insert()
132 key->target_type < cur->key.target_type) in avtab_insert()
134 if (key->source_type == cur->key.source_type && in avtab_insert()
135 key->target_type == cur->key.target_type && in avtab_insert()
136 key->target_class < cur->key.target_class) in avtab_insert()
156 struct avtab_node *prev, *cur; in avtab_insert_nonunique() local
162 for (prev = NULL, cur = h->htable[hvalue]; in avtab_insert_nonunique()
163 cur; in avtab_insert_nonunique()
164 prev = cur, cur = cur->next) { in avtab_insert_nonunique()
165 if (key->source_type == cur->key.source_type && in avtab_insert_nonunique()
166 key->target_type == cur->key.target_type && in avtab_insert_nonunique()
167 key->target_class == cur->key.target_class && in avtab_insert_nonunique()
168 (specified & cur->key.specified)) in avtab_insert_nonunique()
170 if (key->source_type < cur->key.source_type) in avtab_insert_nonunique()
172 if (key->source_type == cur->key.source_type && in avtab_insert_nonunique()
173 key->target_type < cur->key.target_type) in avtab_insert_nonunique()
175 if (key->source_type == cur->key.source_type && in avtab_insert_nonunique()
176 key->target_type == cur->key.target_type && in avtab_insert_nonunique()
177 key->target_class < cur->key.target_class) in avtab_insert_nonunique()
190 struct avtab_node *cur; in avtab_search_node() local
197 for (cur = h->htable[hvalue]; cur; in avtab_search_node()
198 cur = cur->next) { in avtab_search_node()
199 if (key->source_type == cur->key.source_type && in avtab_search_node()
200 key->target_type == cur->key.target_type && in avtab_search_node()
201 key->target_class == cur->key.target_class && in avtab_search_node()
202 (specified & cur->key.specified)) in avtab_search_node()
203 return cur; in avtab_search_node()
205 if (key->source_type < cur->key.source_type) in avtab_search_node()
207 if (key->source_type == cur->key.source_type && in avtab_search_node()
208 key->target_type < cur->key.target_type) in avtab_search_node()
210 if (key->source_type == cur->key.source_type && in avtab_search_node()
211 key->target_type == cur->key.target_type && in avtab_search_node()
212 key->target_class < cur->key.target_class) in avtab_search_node()
221 struct avtab_node *cur; in avtab_search_node_next() local
227 for (cur = node->next; cur; cur = cur->next) { in avtab_search_node_next()
228 if (node->key.source_type == cur->key.source_type && in avtab_search_node_next()
229 node->key.target_type == cur->key.target_type && in avtab_search_node_next()
230 node->key.target_class == cur->key.target_class && in avtab_search_node_next()
231 (specified & cur->key.specified)) in avtab_search_node_next()
232 return cur; in avtab_search_node_next()
234 if (node->key.source_type < cur->key.source_type) in avtab_search_node_next()
236 if (node->key.source_type == cur->key.source_type && in avtab_search_node_next()
237 node->key.target_type < cur->key.target_type) in avtab_search_node_next()
239 if (node->key.source_type == cur->key.source_type && in avtab_search_node_next()
240 node->key.target_type == cur->key.target_type && in avtab_search_node_next()
241 node->key.target_class < cur->key.target_class) in avtab_search_node_next()
250 struct avtab_node *cur, *temp; in avtab_destroy() local
256 cur = h->htable[i]; in avtab_destroy()
257 while (cur) { in avtab_destroy()
258 temp = cur; in avtab_destroy()
259 cur = cur->next; in avtab_destroy()
330 struct avtab_node *cur; in avtab_hash_eval() local
336 cur = h->htable[i]; in avtab_hash_eval()
337 if (cur) { in avtab_hash_eval()
340 while (cur) { in avtab_hash_eval()
342 cur = cur->next; in avtab_hash_eval()
582 int avtab_write_item(struct policydb *p, const struct avtab_node *cur, void *fp) in avtab_write_item() argument
585 __le32 buf32[ARRAY_SIZE(cur->datum.u.xperms->perms.p)]; in avtab_write_item()
589 buf16[0] = cpu_to_le16(cur->key.source_type); in avtab_write_item()
590 buf16[1] = cpu_to_le16(cur->key.target_type); in avtab_write_item()
591 buf16[2] = cpu_to_le16(cur->key.target_class); in avtab_write_item()
592 buf16[3] = cpu_to_le16(cur->key.specified); in avtab_write_item()
597 if (cur->key.specified & AVTAB_XPERMS) { in avtab_write_item()
598 rc = put_entry(&cur->datum.u.xperms->specified, sizeof(u8), 1, fp); in avtab_write_item()
601 rc = put_entry(&cur->datum.u.xperms->driver, sizeof(u8), 1, fp); in avtab_write_item()
604 for (i = 0; i < ARRAY_SIZE(cur->datum.u.xperms->perms.p); i++) in avtab_write_item()
605 buf32[i] = cpu_to_le32(cur->datum.u.xperms->perms.p[i]); in avtab_write_item()
607 ARRAY_SIZE(cur->datum.u.xperms->perms.p), fp); in avtab_write_item()
609 buf32[0] = cpu_to_le32(cur->datum.u.data); in avtab_write_item()
621 struct avtab_node *cur; in avtab_write() local
630 for (cur = a->htable[i]; cur; in avtab_write()
631 cur = cur->next) { in avtab_write()
632 rc = avtab_write_item(p, cur, fp); in avtab_write()