list: Introduce list_rotate_left()
[safe/jmp/linux-2.6] / include / linux / list.h
index 969f6e9..5d9c655 100644 (file)
@@ -206,6 +206,20 @@ static inline int list_empty_careful(const struct list_head *head)
 }
 
 /**
+ * list_rotate_left - rotate the list to the left
+ * @head: the head of the list
+ */
+static inline void list_rotate_left(struct list_head *head)
+{
+       struct list_head *first;
+
+       if (!list_empty(head)) {
+               first = head->next;
+               list_move_tail(first, head);
+       }
+}
+
+/**
  * list_is_singular - tests whether a list has just one entry.
  * @head: the list to test.
  */