Lines Matching refs:list

2  * this includes inlined list.h safe for userspace.
32 * Simple doubly linked list implementation.
50 static inline void INIT_LIST_HEAD(struct list_head *list)
52 list->next = list;
53 list->prev = list;
59 * This is only for internal list manipulation where we know
79 * @head: list head to add it after
92 * @head: list head to add it before
103 * Delete a list entry by making the prev/next entries
106 * This is only for internal list manipulation where we know
116 * list_del - deletes entry from list.
117 * @entry: the element to delete from the list.
155 * list_del_init - deletes entry from list and reinitialize it.
156 * @entry: the element to delete from the list.
165 * list_move - delete from one list and add as another's head
166 * @list: the entry to move
169 static inline void list_move(struct list_head *list, struct list_head *head)
171 __list_del(list->prev, list->next);
172 list_add(list, head);
176 * list_move_tail - delete from one list and add as another's tail
177 * @list: the entry to move
180 static inline void list_move_tail(struct list_head *list,
183 __list_del(list->prev, list->next);
184 list_add_tail(list, head);
188 * list_is_last - tests whether @list is the last entry in list @head
189 * @list: the entry to test
190 * @head: the head of the list
192 static inline int list_is_last(const struct list_head *list,
195 return list->next == head;
199 * list_empty - tests whether a list is empty
200 * @head: the list to test.
208 * list_empty_careful - tests whether a list is empty and not being modified
209 * @head: the list to test
212 * tests whether a list is empty _and_ checks that no other CPU might be
217 * to the list entry is list_del_init(). Eg. it cannot be used
227 * list_is_singular - tests whether a list has just one entry.
228 * @head: the list to test.
235 static inline void __list_cut_position(struct list_head *list,
240 list->next = head->next;
241 list->next->prev = list;
242 list->prev = entry;
243 entry->next = list;
249 * list_cut_position - cut a list into two
250 * @list: a new list to add all removed entries
251 * @head: a list with entries
253 * and if so we won't cut the list
256 * including @entry, from @head to @list. You should
257 * pass on @entry an element you know is on @head. @list
258 * should be an empty list or a list you do not care about
262 static inline void list_cut_position(struct list_head *list,
271 INIT_LIST_HEAD(list);
273 __list_cut_position(list, head, entry);
276 static inline void __list_splice(const struct list_head *list,
279 struct list_head *first = list->next;
280 struct list_head *last = list->prev;
291 * @list: the new list to add.
292 * @head: the place to add it in the first list.
294 static inline void list_splice(const struct list_head *list,
297 if (!list_empty(list))
298 __list_splice(list, head, head->next);
302 * list_splice_tail - join two lists, each list being a queue
303 * @list: the new list to add.
304 * @head: the place to add it in the first list.
306 static inline void list_splice_tail(struct list_head *list,
309 if (!list_empty(list))
310 __list_splice(list, head->prev, head);
314 * list_splice_init - join two lists and reinitialise the emptied list.
315 * @list: the new list to add.
316 * @head: the place to add it in the first list.
318 * The list at @list is reinitialised
320 static inline void list_splice_init(struct list_head *list,
323 if (!list_empty(list)) {
324 __list_splice(list, head, head->next);
325 INIT_LIST_HEAD(list);
330 * list_splice_tail_init - join two lists and reinitialise the emptied list
331 * @list: the new list to add.
332 * @head: the place to add it in the first list.
335 * The list at @list is reinitialised
337 static inline void list_splice_tail_init(struct list_head *list,
340 if (!list_empty(list)) {
341 __list_splice(list, head->prev, head);
342 INIT_LIST_HEAD(list);
356 * list_first_entry - get the first element from a list
357 * @ptr: the list head to take the element from.
361 * Note, that list is expected to be not empty.
367 * list_for_each - iterate over a list
369 * @head: the head for your list.
376 * list_for_each_prev - iterate over a list backwards
378 * @head: the head for your list.
385 * list_for_each_safe - iterate over a list safe against removal of list entry
388 * @head: the head for your list.
395 * list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry
398 * @head: the head for your list.
406 * list_for_each_entry - iterate over list of given type
408 * @head: the head for your list.
417 * list_for_each_entry_reverse - iterate backwards over list of given type.
419 * @head: the head for your list.
430 * @head: the head of the list
439 * list_for_each_entry_continue - continue iteration over list of given type
441 * @head: the head for your list.
444 * Continue to iterate over list of given type, continuing after
455 * @head: the head for your list.
458 * Start to iterate over list of given type backwards, continuing after
467 * list_for_each_entry_from - iterate over list of given type from the current point
469 * @head: the head for your list.
472 * Iterate over list of given type, continuing from current position.
479 * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
482 * @head: the head for your list.
495 * @head: the head for your list.
498 * Iterate over list of given type, continuing after current point,
499 * safe against removal of list entry.
511 * @head: the head for your list.
514 * Iterate over list of given type from current point, safe against
515 * removal of list entry.
526 * @head: the head for your list.
529 * Iterate backwards over list of given type, safe against removal
530 * of list entry.
539 struct list_head list;
557 INIT_LIST_HEAD(&offset->list);
565 list_add_tail(&offset->list, &t->offsets);
611 list_for_each_entry(offset, &t->offsets, list) {