Lines Matching full:list
13 * Simple doubly linked list implementation.
31 static inline void INIT_LIST_HEAD(struct list_head *list) in INIT_LIST_HEAD() argument
33 list->next = list; in INIT_LIST_HEAD()
34 list->prev = list; in INIT_LIST_HEAD()
40 * This is only for internal list manipulation where we know
56 * @head: list head to add it after
69 * @head: list head to add it before
80 * Delete a list entry by making the prev/next entries
83 * This is only for internal list manipulation where we know
93 * list_del - deletes entry from list.
94 * @entry: the element to delete from the list.
129 * list_del_init - deletes entry from list and reinitialize it.
130 * @entry: the element to delete from the list.
139 * list_move - delete from one list and add as another's head
140 * @list: the entry to move
143 static inline void list_move(struct list_head *list, struct list_head *head) in list_move() argument
145 __list_del(list->prev, list->next); in list_move()
146 list_add(list, head); in list_move()
150 * list_move_tail - delete from one list and add as another's tail
151 * @list: the entry to move
154 static inline void list_move_tail(struct list_head *list, in list_move_tail() argument
157 __list_del(list->prev, list->next); in list_move_tail()
158 list_add_tail(list, head); in list_move_tail()
162 * list_is_last - tests whether @list is the last entry in list @head
163 * @list: the entry to test
164 * @head: the head of the list
166 static inline int list_is_last(const struct list_head *list, in list_is_last() argument
169 return list->next == head; in list_is_last()
173 * list_empty - tests whether a list is empty
174 * @head: the list to test.
182 * list_empty_careful - tests whether a list is empty and not being modified
183 * @head: the list to test
186 * tests whether a list is empty _and_ checks that no other CPU might be
191 * to the list entry is list_del_init(). Eg. it cannot be used
201 * list_is_singular - tests whether a list has just one entry.
202 * @head: the list to test.
209 static inline void __list_cut_position(struct list_head *list, in __list_cut_position() argument
213 list->next = head->next; in __list_cut_position()
214 list->next->prev = list; in __list_cut_position()
215 list->prev = entry; in __list_cut_position()
216 entry->next = list; in __list_cut_position()
222 * list_cut_position - cut a list into two
223 * @list: a new list to add all removed entries
224 * @head: a list with entries
226 * and if so we won't cut the list
229 * including @entry, from @head to @list. You should
230 * pass on @entry an element you know is on @head. @list
231 * should be an empty list or a list you do not care about
235 static inline void list_cut_position(struct list_head *list, in list_cut_position() argument
244 INIT_LIST_HEAD(list); in list_cut_position()
246 __list_cut_position(list, head, entry); in list_cut_position()
249 static inline void __list_splice(const struct list_head *list, in __list_splice() argument
253 struct list_head *first = list->next; in __list_splice()
254 struct list_head *last = list->prev; in __list_splice()
265 * @list: the new list to add.
266 * @head: the place to add it in the first list.
268 static inline void list_splice(const struct list_head *list, in list_splice() argument
271 if (!list_empty(list)) in list_splice()
272 __list_splice(list, head, head->next); in list_splice()
276 * list_splice_tail - join two lists, each list being a queue
277 * @list: the new list to add.
278 * @head: the place to add it in the first list.
280 static inline void list_splice_tail(struct list_head *list, in list_splice_tail() argument
283 if (!list_empty(list)) in list_splice_tail()
284 __list_splice(list, head->prev, head); in list_splice_tail()
288 * list_splice_init - join two lists and reinitialise the emptied list.
289 * @list: the new list to add.
290 * @head: the place to add it in the first list.
292 * The list at @list is reinitialised
294 static inline void list_splice_init(struct list_head *list, in list_splice_init() argument
297 if (!list_empty(list)) { in list_splice_init()
298 __list_splice(list, head, head->next); in list_splice_init()
299 INIT_LIST_HEAD(list); in list_splice_init()
304 * list_splice_tail_init - join two lists and reinitialise the emptied list
305 * @list: the new list to add.
306 * @head: the place to add it in the first list.
309 * The list at @list is reinitialised
311 static inline void list_splice_tail_init(struct list_head *list, in list_splice_tail_init() argument
314 if (!list_empty(list)) { in list_splice_tail_init()
315 __list_splice(list, head->prev, head); in list_splice_tail_init()
316 INIT_LIST_HEAD(list); in list_splice_tail_init()
330 * list_first_entry - get the first element from a list
331 * @ptr: the list head to take the element from.
335 * Note, that list is expected to be not empty.
341 * list_last_entry - get the last element from a list
342 * @ptr: the list head to take the element from.
346 * Note, that list is expected to be not empty.
352 * list_for_each - iterate over a list
354 * @head: the head for your list.
361 * __list_for_each - iterate over a list
363 * @head: the head for your list.
366 * simplest possible list iteration code, no prefetching is done.
367 * Use this for code that knows the list to be very short (empty
374 * list_for_each_prev - iterate over a list backwards
376 * @head: the head for your list.
383 * list_for_each_safe - iterate over a list safe against removal of list entry
386 * @head: the head for your list.
393 * list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry
396 * @head: the head for your list.
404 * list_for_each_entry - iterate over list of given type
406 * @head: the head for your list.
415 * list_for_each_entry_reverse - iterate backwards over list of given type.
417 * @head: the head for your list.
428 * @head: the head of the list
437 * list_for_each_entry_continue - continue iteration over list of given type
439 * @head: the head for your list.
442 * Continue to iterate over list of given type, continuing after
453 * @head: the head for your list.
456 * Start to iterate over list of given type backwards, continuing after
465 * list_for_each_entry_from - iterate over list of given type from the current point
467 * @head: the head for your list.
470 * Iterate over list of given type, continuing from current position.
477 * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
480 * @head: the head for your list.
493 * @head: the head for your list.
496 * Iterate over list of given type, continuing after current point,
497 * safe against removal of list entry.
509 * @head: the head for your list.
512 * Iterate over list of given type from current point, safe against
513 * removal of list entry.
524 * @head: the head for your list.
527 * Iterate backwards over list of given type, safe against removal
528 * of list entry.
537 * Double linked lists with a single pointer list head.
538 * Mostly useful for hash tables where the two pointer list head is
636 * hlist_for_each_entry - iterate over list of given type
639 * @head: the head for your list.
672 * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
676 * @head: the head for your list.