Lines Matching refs:list

11 static inline void INIT_LIST_HEAD(struct list_head *list)
13 list->next = list;
14 list->prev = list;
20 * This is only for internal list manipulation where we know
42 * @head: list head to add it after
56 * @head: list head to add it before
67 * Delete a list entry by making the prev/next entries
70 * This is only for internal list manipulation where we know
80 * list_del - deletes entry from list.
81 * @entry: the element to delete from the list.
120 * list_del_init - deletes entry from list and reinitialize it.
121 * @entry: the element to delete from the list.
130 * list_move - delete from one list and add as another's head
131 * @list: the entry to move
134 static inline void list_move(struct list_head *list, struct list_head *head)
136 __list_del(list->prev, list->next);
137 list_add(list, head);
141 * list_move_tail - delete from one list and add as another's tail
142 * @list: the entry to move
145 static inline void list_move_tail(struct list_head *list,
148 __list_del(list->prev, list->next);
149 list_add_tail(list, head);
153 * list_is_last - tests whether @list is the last entry in list @head
154 * @list: the entry to test
155 * @head: the head of the list
157 static inline int list_is_last(const struct list_head *list,
160 return list->next == head;
164 * list_empty - tests whether a list is empty
165 * @head: the list to test.
173 * list_empty_careful - tests whether a list is empty and not being modified
174 * @head: the list to test
177 * tests whether a list is empty _and_ checks that no other CPU might be
182 * to the list entry is list_del_init(). Eg. it cannot be used
192 * list_rotate_left - rotate the list to the left
193 * @head: the head of the list
206 * list_is_singular - tests whether a list has just one entry.
207 * @head: the list to test.
214 static inline void __list_cut_position(struct list_head *list,
218 list->next = head->next;
219 list->next->prev = list;
220 list->prev = entry;
221 entry->next = list;
227 * list_cut_position - cut a list into two
228 * @list: a new list to add all removed entries
229 * @head: a list with entries
231 * and if so we won't cut the list
234 * including @entry, from @head to @list. You should
235 * pass on @entry an element you know is on @head. @list
236 * should be an empty list or a list you do not care about
240 static inline void list_cut_position(struct list_head *list,
249 INIT_LIST_HEAD(list);
251 __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);
281 * list_splice_tail - join two lists, each list being a queue
282 * @list: the new list to add.
283 * @head: the place to add it in the first list.
285 static inline void list_splice_tail(struct list_head *list,
288 if (!list_empty(list))
289 __list_splice(list, head->prev, head);
293 * list_splice_init - join two lists and reinitialise the emptied list.
294 * @list: the new list to add.
295 * @head: the place to add it in the first list.
297 * The list at @list is reinitialised
299 static inline void list_splice_init(struct list_head *list,
302 if (!list_empty(list)) {
303 __list_splice(list, head, head->next);
304 INIT_LIST_HEAD(list);
309 * list_splice_tail_init - join two lists and reinitialise the emptied list
310 * @list: the new list to add.
311 * @head: the place to add it in the first list.
314 * The list at @list is reinitialised
316 static inline void list_splice_tail_init(struct list_head *list,
319 if (!list_empty(list)) {
320 __list_splice(list, head->prev, head);
321 INIT_LIST_HEAD(list);
335 * list_first_entry - get the first element from a list
336 * @ptr: the list head to take the element from.
340 * Note, that list is expected to be not empty.
346 * list_for_each - iterate over a list
348 * @head: the head for your list.
355 * __list_for_each - iterate over a list
357 * @head: the head for your list.
360 * simplest possible list iteration code, no prefetching is done.
361 * Use this for code that knows the list to be very short (empty
368 * list_for_each_prev - iterate over a list backwards
370 * @head: the head for your list.
377 * list_for_each_safe - iterate over a list safe against removal of list entry
380 * @head: the head for your list.
387 * list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry
390 * @head: the head for your list.
398 * list_for_each_entry - iterate over list of given type
400 * @head: the head for your list.
409 * list_for_each_entry_reverse - iterate backwards over list of given type.
411 * @head: the head for your list.
422 * @head: the head of the list
431 * list_for_each_entry_continue - continue iteration over list of given type
433 * @head: the head for your list.
436 * Continue to iterate over list of given type, continuing after
447 * @head: the head for your list.
450 * Start to iterate over list of given type backwards, continuing after
459 * list_for_each_entry_from - iterate over list of given type from the current point
461 * @head: the head for your list.
464 * Iterate over list of given type, continuing from current position.
471 * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
474 * @head: the head for your list.
484 * list_for_each_entry_safe_continue - continue list iteration safe against removal
487 * @head: the head for your list.
490 * Iterate over list of given type, continuing after current point,
491 * safe against removal of list entry.
500 * list_for_each_entry_safe_from - iterate over list from current point safe against removal
503 * @head: the head for your list.
506 * Iterate over list of given type from current point, safe against
507 * removal of list entry.
515 * list_for_each_entry_safe_reverse - iterate backwards over list safe against removal
518 * @head: the head for your list.
521 * Iterate backwards over list of given type, safe against removal
522 * of list entry.
536 * list_safe_reset_next is not safe to use in general if the list may be
538 * exception to this is if the cursor element (pos) is pinned in the list,
620 * Move a list from one list head to another. Fixup the pprev
643 * hlist_for_each_entry - iterate over list of given type
646 * @head: the head for your list.
679 * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
683 * @head: the head for your list.