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,
248 INIT_LIST_HEAD(list);
250 __list_cut_position(list, head, entry);
254 static inline void __list_splice(const struct list_head *list,
258 struct list_head *first = list->next;
259 struct list_head *last = list->prev;
270 * @list: the new list to add.
271 * @head: the place to add it in the first list.
273 static inline void list_splice(const struct list_head *list,
276 if (!list_empty(list)) {
277 __list_splice(list, head, head->next);
282 * list_splice_tail - join two lists, each list being a queue
283 * @list: the new list to add.
284 * @head: the place to add it in the first list.
286 static inline void list_splice_tail(struct list_head *list,
289 if (!list_empty(list)) {
290 __list_splice(list, head->prev, head);
295 * list_splice_init - join two lists and reinitialise the emptied list.
296 * @list: the new list to add.
297 * @head: the place to add it in the first list.
299 * The list at @list is reinitialised
301 static inline void list_splice_init(struct list_head *list,
304 if (!list_empty(list)) {
305 __list_splice(list, head, head->next);
306 INIT_LIST_HEAD(list);
311 * list_splice_tail_init - join two lists and reinitialise the emptied list
312 * @list: the new list to add.
313 * @head: the place to add it in the first list.
316 * The list at @list is reinitialised
318 static inline void list_splice_tail_init(struct list_head *list,
321 if (!list_empty(list)) {
322 __list_splice(list, head->prev, head);
323 INIT_LIST_HEAD(list);
337 * list_first_entry - get the first element from a list
338 * @ptr: the list head to take the element from.
342 * Note, that list is expected to be not empty.
348 * list_for_each - iterate over a list
350 * @head: the head for your list.
357 * __list_for_each - iterate over a list
359 * @head: the head for your list.
362 * simplest possible list iteration code, no prefetching is done.
363 * Use this for code that knows the list to be very short (empty
370 * list_for_each_prev - iterate over a list backwards
372 * @head: the head for your list.
379 * list_for_each_safe - iterate over a list safe against removal of list entry
382 * @head: the head for your list.
389 * list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry
392 * @head: the head for your list.
400 * list_for_each_entry - iterate over list of given type
402 * @head: the head for your list.
411 * list_for_each_entry_reverse - iterate backwards over list of given type.
413 * @head: the head for your list.
424 * @head: the head of the list
433 * list_for_each_entry_continue - continue iteration over list of given type
435 * @head: the head for your list.
438 * Continue to iterate over list of given type, continuing after
449 * @head: the head for your list.
452 * Start to iterate over list of given type backwards, continuing after
461 * list_for_each_entry_from - iterate over list of given type from the current point
463 * @head: the head for your list.
466 * Iterate over list of given type, continuing from current position.
473 * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
476 * @head: the head for your list.
489 * @head: the head for your list.
492 * Iterate over list of given type, continuing after current point,
493 * safe against removal of list entry.
505 * @head: the head for your list.
508 * Iterate over list of given type from current point, safe against
509 * removal of list entry.
520 * @head: the head for your list.
523 * Iterate backwards over list of given type, safe against removal
524 * of list entry.
533 * Double linked lists with a single pointer list head.
534 * Mostly useful for hash tables where the two pointer list head is
635 * hlist_for_each_entry - iterate over list of given type
638 * @head: the head for your list.
671 * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
675 * @head: the head for your list.