aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/list.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/list.h')
-rw-r--r--include/linux/list.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/include/linux/list.h b/include/linux/list.h
index 969f6e92d089..8392884a2977 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -206,6 +206,20 @@ static inline int list_empty_careful(const struct list_head *head)
206} 206}
207 207
208/** 208/**
209 * list_rotate_left - rotate the list to the left
210 * @head: the head of the list
211 */
212static inline void list_rotate_left(struct list_head *head)
213{
214 struct list_head *first;
215
216 if (!list_empty(head)) {
217 first = head->next;
218 list_move_tail(first, head);
219 }
220}
221
222/**
209 * list_is_singular - tests whether a list has just one entry. 223 * list_is_singular - tests whether a list has just one entry.
210 * @head: the list to test. 224 * @head: the list to test.
211 */ 225 */
@@ -484,7 +498,7 @@ static inline void list_splice_tail_init(struct list_head *list,
484 pos = n, n = list_entry(n->member.next, typeof(*n), member)) 498 pos = n, n = list_entry(n->member.next, typeof(*n), member))
485 499
486/** 500/**
487 * list_for_each_entry_safe_continue 501 * list_for_each_entry_safe_continue - continue list iteration safe against removal
488 * @pos: the type * to use as a loop cursor. 502 * @pos: the type * to use as a loop cursor.
489 * @n: another type * to use as temporary storage 503 * @n: another type * to use as temporary storage
490 * @head: the head for your list. 504 * @head: the head for your list.
@@ -500,7 +514,7 @@ static inline void list_splice_tail_init(struct list_head *list,
500 pos = n, n = list_entry(n->member.next, typeof(*n), member)) 514 pos = n, n = list_entry(n->member.next, typeof(*n), member))
501 515
502/** 516/**
503 * list_for_each_entry_safe_from 517 * list_for_each_entry_safe_from - iterate over list from current point safe against removal
504 * @pos: the type * to use as a loop cursor. 518 * @pos: the type * to use as a loop cursor.
505 * @n: another type * to use as temporary storage 519 * @n: another type * to use as temporary storage
506 * @head: the head for your list. 520 * @head: the head for your list.
@@ -515,7 +529,7 @@ static inline void list_splice_tail_init(struct list_head *list,
515 pos = n, n = list_entry(n->member.next, typeof(*n), member)) 529 pos = n, n = list_entry(n->member.next, typeof(*n), member))
516 530
517/** 531/**
518 * list_for_each_entry_safe_reverse 532 * list_for_each_entry_safe_reverse - iterate backwards over list safe against removal
519 * @pos: the type * to use as a loop cursor. 533 * @pos: the type * to use as a loop cursor.
520 * @n: another type * to use as temporary storage 534 * @n: another type * to use as temporary storage
521 * @head: the head for your list. 535 * @head: the head for your list.