summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/list.h
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src/list.h')
-rw-r--r--libglusterfs/src/list.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/libglusterfs/src/list.h b/libglusterfs/src/list.h
index 875594136a2..b8f9a6eebd8 100644
--- a/libglusterfs/src/list.h
+++ b/libglusterfs/src/list.h
@@ -214,6 +214,20 @@ static inline void list_replace_init(struct list_head *old,
INIT_LIST_HEAD(old);
}
+/**
+ * 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);
+ }
+}
+
#define list_entry(ptr, type, member) \
((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))