Lines Matching refs:list

32 		struct ptr_list *list = head;  in ptr_list_size()  local
34 nr += list->nr - list->rm; in ptr_list_size()
35 } while ((list = list->next) != head); in ptr_list_size()
46 const struct ptr_list *list = head; in ptr_list_empty() local
52 if (list->nr - list->rm) in ptr_list_empty()
54 } while ((list = list->next) != head); in ptr_list_empty()
65 const struct ptr_list *list = head; in ptr_list_multiple() local
72 nr += list->nr - list->rm; in ptr_list_multiple()
75 } while ((list = list->next) != head); in ptr_list_multiple()
86 struct ptr_list *list = head; in first_ptr_list() local
91 while (list->nr == 0) { in first_ptr_list()
92 list = list->next; in first_ptr_list()
93 if (list == head) in first_ptr_list()
96 return PTR_ENTRY_NOTAG(list, 0); in first_ptr_list()
105 struct ptr_list *list; in last_ptr_list() local
109 list = head->prev; in last_ptr_list()
110 while (list->nr == 0) { in last_ptr_list()
111 if (list == head) in last_ptr_list()
113 list = list->prev; in last_ptr_list()
115 return PTR_ENTRY_NOTAG(list, list->nr-1); in last_ptr_list()
122 void *ptr_list_nth_entry(struct ptr_list *list, unsigned int idx) in ptr_list_nth_entry() argument
124 struct ptr_list *head = list; in ptr_list_nth_entry()
130 unsigned int nr = list->nr; in ptr_list_nth_entry()
133 return list->list[idx]; in ptr_list_nth_entry()
136 } while ((list = list->next) != head); in ptr_list_nth_entry()
158 struct ptr_list *list = head; in linearize_ptr_list() local
161 int i = list->nr; in linearize_ptr_list()
164 memcpy(arr, list->list, i*sizeof(void *)); in linearize_ptr_list()
170 } while ((list = list->next) != head); in linearize_ptr_list()
237 memcpy(newlist->list, head->list + old, nr * sizeof(void *)); in split_ptr_list_head()
238 memset(head->list + old, 0xf0, nr * sizeof(void *)); in split_ptr_list_head()
252 struct ptr_list *list = *listp; in __add_ptr_list() local
257 if (!list || (nr = (last = list->prev)->nr) >= LIST_NODE_NR) { in __add_ptr_list()
264 if (!list) { in __add_ptr_list()
270 newlist->next = list; in __add_ptr_list()
271 list->prev = newlist; in __add_ptr_list()
277 ret = last->list + nr; in __add_ptr_list()
311 const struct ptr_list *list = head; in lookup_ptr_list_entry() local
316 int nr = list->nr; in lookup_ptr_list_entry()
319 if (list->list[i] == entry) in lookup_ptr_list_entry()
321 } while ((list = list->next) != head); in lookup_ptr_list_entry()
330 int delete_ptr_list_entry(struct ptr_list **list, void *entry, int count) in delete_ptr_list_entry() argument
334 FOR_EACH_PTR(*list, ptr) { in delete_ptr_list_entry()
343 pack_ptr_list(list); in delete_ptr_list_entry()
353 int replace_ptr_list_entry(struct ptr_list **list, void *old_ptr, in replace_ptr_list_entry() argument
358 FOR_EACH_PTR(*list, ptr) { in replace_ptr_list_entry()
388 ptr = last->list[nr]; in undo_ptr_list_last()
389 last->list[nr] = (void *)0xf1f1f1f1; in undo_ptr_list_last()
409 ptr = last->list[--last->nr]; in delete_ptr_list_last()
458 void *ptr = cur->list[i++]; in copy_ptr_list()
469 tail->list[idx++] = ptr; in copy_ptr_list()
492 struct ptr_list *tmp, *list = *listp; in __free_ptr_list() local
494 if (!list) in __free_ptr_list()
497 list->prev->next = NULL; in __free_ptr_list()
498 while (list) { in __free_ptr_list()
499 tmp = list; in __free_ptr_list()
500 list = list->next; in __free_ptr_list()