Lines Matching defs:list

15  * Simple doubly linked list implementation.
33 static inline void INIT_LIST_HEAD(struct list_head *list)
35 list->next = list;
36 list->prev = list;
42 * This is only for internal list manipulation where we know
58 * @head: list head to add it after
71 * @head: list head to add it before
82 * Delete a list entry by making the prev/next entries
85 * This is only for internal list manipulation where we know
95 * list_del - deletes entry from list.
96 * @entry: the element to delete from the list.
131 * list_del_init - deletes entry from list and reinitialize it.
132 * @entry: the element to delete from the list.
141 * list_move - delete from one list and add as another's head
142 * @list: the entry to move
145 static inline void list_move(struct list_head *list, struct list_head *head)
147 __list_del(list->prev, list->next);
148 list_add(list, head);
152 * list_move_tail - delete from one list and add as another's tail
153 * @list: the entry to move
156 static inline void list_move_tail(struct list_head *list,
159 __list_del(list->prev, list->next);
160 list_add_tail(list, head);
164 * list_is_last - tests whether @list is the last entry in list @head
165 * @list: the entry to test
166 * @head: the head of the list
168 static inline int list_is_last(const struct list_head *list,
171 return list->next == head;
175 * list_empty - tests whether a list is empty
176 * @head: the list to test.
184 * list_empty_careful - tests whether a list is empty and not being modified
185 * @head: the list to test
188 * tests whether a list is empty _and_ checks that no other CPU might be
193 * to the list entry is list_del_init(). Eg. it cannot be used
203 * list_is_singular - tests whether a list has just one entry.
204 * @head: the list to test.
211 static inline void __list_cut_position(struct list_head *list,
215 list->next = head->next;
216 list->next->prev = list;
217 list->prev = entry;
218 entry->next = list;
224 * list_cut_position - cut a list into two
225 * @list: a new list to add all removed entries
226 * @head: a list with entries
228 * and if so we won't cut the list
231 * including @entry, from @head to @list. You should
232 * pass on @entry an element you know is on @head. @list
233 * should be an empty list or a list you do not care about
237 static inline void list_cut_position(struct list_head *list,
246 INIT_LIST_HEAD(list);
248 __list_cut_position(list, head, entry);
251 static inline void __list_splice(const struct list_head *list,
255 struct list_head *first = list->next;
256 struct list_head *last = list->prev;
267 * @list: the new list to add.
268 * @head: the place to add it in the first list.
270 static inline void list_splice(const struct list_head *list,
273 if (!list_empty(list))
274 __list_splice(list, head, head->next);
278 * list_splice_tail - join two lists, each list being a queue
279 * @list: the new list to add.
280 * @head: the place to add it in the first list.
282 static inline void list_splice_tail(struct list_head *list,
285 if (!list_empty(list))
286 __list_splice(list, head->prev, head);
290 * list_splice_init - join two lists and reinitialise the emptied list.
291 * @list: the new list to add.
292 * @head: the place to add it in the first list.
294 * The list at @list is reinitialised
296 static inline void list_splice_init(struct list_head *list,
299 if (!list_empty(list)) {
300 __list_splice(list, head, head->next);
301 INIT_LIST_HEAD(list);
306 * list_splice_tail_init - join two lists and reinitialise the emptied list
307 * @list: the new list to add.
308 * @head: the place to add it in the first list.
311 * The list at @list is reinitialised
313 static inline void list_splice_tail_init(struct list_head *list,
316 if (!list_empty(list)) {
317 __list_splice(list, head->prev, head);
318 INIT_LIST_HEAD(list);
332 * list_first_entry - get the first element from a list
333 * @ptr: the list head to take the element from.
337 * Note, that list is expected to be not empty.
343 * list_for_each - iterate over a list
345 * @head: the head for your list.
352 * __list_for_each - iterate over a list
354 * @head: the head for your list.
357 * simplest possible list iteration code, no prefetching is done.
358 * Use this for code that knows the list to be very short (empty
365 * list_for_each_prev - iterate over a list backwards
367 * @head: the head for your list.
374 * list_for_each_safe - iterate over a list safe against removal of list entry
377 * @head: the head for your list.
384 * list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry
387 * @head: the head for your list.
395 * list_for_each_entry - iterate over list of given type
397 * @head: the head for your list.
406 * list_for_each_entry_reverse - iterate backwards over list of given type.
408 * @head: the head for your list.
419 * @head: the head of the list
428 * list_for_each_entry_continue - continue iteration over list of given type
430 * @head: the head for your list.
433 * Continue to iterate over list of given type, continuing after
444 * @head: the head for your list.
447 * Start to iterate over list of given type backwards, continuing after
456 * list_for_each_entry_from - iterate over list of given type from the current point
458 * @head: the head for your list.
461 * Iterate over list of given type, continuing from current position.
468 * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
471 * @head: the head for your list.
484 * @head: the head for your list.
487 * Iterate over list of given type, continuing after current point,
488 * safe against removal of list entry.
500 * @head: the head for your list.
503 * Iterate over list of given type from current point, safe against
504 * removal of list entry.
515 * @head: the head for your list.
518 * Iterate backwards over list of given type, safe against removal
519 * of list entry.
528 * Double linked lists with a single pointer list head.
529 * Mostly useful for hash tables where the two pointer list head is
627 * hlist_for_each_entry - iterate over list of given type
630 * @head: the head for your list.
663 * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
667 * @head: the head for your list.