Lines Matching full:list
11 * Simple doubly linked list implementation.
25 static inline void INIT_LIST_HEAD(struct list_head *list) in INIT_LIST_HEAD() argument
27 list->next = list; in INIT_LIST_HEAD()
28 list->prev = list; in INIT_LIST_HEAD()
34 * This is only for internal list manipulation where we know
56 * @head: list head to add it after
70 * @head: list head to add it before
81 * Delete a list entry by making the prev/next entries
84 * This is only for internal list manipulation where we know
94 * list_del - deletes entry from list.
95 * @entry: the element to delete from the list.
140 * list_del_init - deletes entry from list and reinitialize it.
141 * @entry: the element to delete from the list.
150 * list_move - delete from one list and add as another's head
151 * @list: the entry to move
154 static inline void list_move(struct list_head *list, struct list_head *head) in list_move() argument
156 __list_del_entry(list); in list_move()
157 list_add(list, head); in list_move()
161 * list_move_tail - delete from one list and add as another's tail
162 * @list: the entry to move
165 static inline void list_move_tail(struct list_head *list, in list_move_tail() argument
168 __list_del_entry(list); in list_move_tail()
169 list_add_tail(list, head); in list_move_tail()
173 * list_is_last - tests whether @list is the last entry in list @head
174 * @list: the entry to test
175 * @head: the head of the list
177 static inline int list_is_last(const struct list_head *list, in list_is_last() argument
180 return list->next == head; in list_is_last()
184 * list_empty - tests whether a list is empty
185 * @head: the list to test.
193 * list_empty_careful - tests whether a list is empty and not being modified
194 * @head: the list to test
197 * tests whether a list is empty _and_ checks that no other CPU might be
202 * to the list entry is list_del_init(). Eg. it cannot be used
212 * list_rotate_left - rotate the list to the left
213 * @head: the head of the list
226 * list_is_singular - tests whether a list has just one entry.
227 * @head: the list to test.
234 static inline void __list_cut_position(struct list_head *list, in __list_cut_position() argument
238 list->next = head->next; in __list_cut_position()
239 list->next->prev = list; in __list_cut_position()
240 list->prev = entry; in __list_cut_position()
241 entry->next = list; in __list_cut_position()
247 * list_cut_position - cut a list into two
248 * @list: a new list to add all removed entries
249 * @head: a list with entries
251 * and if so we won't cut the list
254 * including @entry, from @head to @list. You should
255 * pass on @entry an element you know is on @head. @list
256 * should be an empty list or a list you do not care about
260 static inline void list_cut_position(struct list_head *list, in list_cut_position() argument
269 INIT_LIST_HEAD(list); in list_cut_position()
271 __list_cut_position(list, head, entry); in list_cut_position()
274 static inline void __list_splice(const struct list_head *list, in __list_splice() argument
278 struct list_head *first = list->next; in __list_splice()
279 struct list_head *last = list->prev; in __list_splice()
290 * @list: the new list to add.
291 * @head: the place to add it in the first list.
293 static inline void list_splice(const struct list_head *list, in list_splice() argument
296 if (!list_empty(list)) in list_splice()
297 __list_splice(list, head, head->next); in list_splice()
301 * list_splice_tail - join two lists, each list being a queue
302 * @list: the new list to add.
303 * @head: the place to add it in the first list.
305 static inline void list_splice_tail(struct list_head *list, in list_splice_tail() argument
308 if (!list_empty(list)) in list_splice_tail()
309 __list_splice(list, head->prev, head); in list_splice_tail()
313 * list_splice_init - join two lists and reinitialise the emptied list.
314 * @list: the new list to add.
315 * @head: the place to add it in the first list.
317 * The list at @list is reinitialised
319 static inline void list_splice_init(struct list_head *list, in list_splice_init() argument
322 if (!list_empty(list)) { in list_splice_init()
323 __list_splice(list, head, head->next); in list_splice_init()
324 INIT_LIST_HEAD(list); in list_splice_init()
329 * list_splice_tail_init - join two lists and reinitialise the emptied list
330 * @list: the new list to add.
331 * @head: the place to add it in the first list.
334 * The list at @list is reinitialised
336 static inline void list_splice_tail_init(struct list_head *list, in list_splice_tail_init() argument
339 if (!list_empty(list)) { in list_splice_tail_init()
340 __list_splice(list, head->prev, head); in list_splice_tail_init()
341 INIT_LIST_HEAD(list); in list_splice_tail_init()
355 * list_first_entry - get the first element from a list
356 * @ptr: the list head to take the element from.
360 * Note, that list is expected to be not empty.
366 * list_last_entry - get the last element from a list
367 * @ptr: the list head to take the element from.
371 * Note, that list is expected to be not empty.
377 * list_first_entry_or_null - get the first element from a list
378 * @ptr: the list head to take the element from.
382 * Note that if the list is empty, it returns NULL.
388 * list_last_entry_or_null - get the last element from a list
389 * @ptr: the list head to take the element from.
393 * Note that if the list is empty, it returns NULL.
399 * list_next_entry - get the next element in list
407 * list_prev_entry - get the prev element in list
415 * list_for_each - iterate over a list
417 * @head: the head for your list.
423 * list_for_each_prev - iterate over a list backwards
425 * @head: the head for your list.
431 * list_for_each_safe - iterate over a list safe against removal of list entry
434 * @head: the head for your list.
441 * list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry
444 * @head: the head for your list.
452 * list_for_each_entry - iterate over list of given type
454 * @head: the head for your list.
463 * list_for_each_entry_reverse - iterate backwards over list of given type.
465 * @head: the head for your list.
476 * @head: the head of the list
485 * list_for_each_entry_continue - continue iteration over list of given type
487 * @head: the head for your list.
490 * Continue to iterate over list of given type, continuing after
501 * @head: the head for your list.
504 * Start to iterate over list of given type backwards, continuing after
513 * list_for_each_entry_from - iterate over list of given type from the current point
515 * @head: the head for your list.
518 * Iterate over list of given type, continuing from current position.
525 * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
528 * @head: the head for your list.
538 * list_for_each_entry_safe_continue - continue list iteration safe against removal
541 * @head: the head for your list.
544 * Iterate over list of given type, continuing after current point,
545 * safe against removal of list entry.
554 * list_for_each_entry_safe_from - iterate over list from current point safe against removal
557 * @head: the head for your list.
560 * Iterate over list of given type from current point, safe against
561 * removal of list entry.
569 * list_for_each_entry_safe_reverse - iterate backwards over list safe against removal
572 * @head: the head for your list.
575 * Iterate backwards over list of given type, safe against removal
576 * of list entry.
590 * list_safe_reset_next is not safe to use in general if the list may be
592 * exception to this is if the cursor element (pos) is pinned in the list,
600 * Double linked lists with a single pointer list head.
601 * Mostly useful for hash tables where the two pointer list head is
693 * Move a list from one list head to another. Fixup the pprev
720 * hlist_for_each_entry - iterate over list of given type
722 * @head: the head for your list.
750 * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
753 * @head: the head for your list.
762 * list_del_range - deletes range of entries from list.
763 * @begin: first element in the range to delete from the list.
764 * @end: last element in the range to delete from the list.
776 * list_for_each_from - iterate over a list from one of its nodes
778 * @head: the head for your list.