summaryrefslogtreecommitdiff
path: root/include/linux/list.h
diff options
context:
space:
mode:
authorJames Morris <james.morris@microsoft.com>2018-11-12 20:07:41 +0300
committerJames Morris <james.morris@microsoft.com>2018-11-12 20:07:41 +0300
commit26b76320a8a550472bbb8f42257df83fcb8d8df6 (patch)
tree8a5b569f4f070bf4971e24e7fccfe3004b8fc4ba /include/linux/list.h
parentf09c296ebf407f98f4ca70892e612b54484bf663 (diff)
parentccda4af0f4b92f7b4c308d3acc262f4a7e3affad (diff)
downloadlinux-26b76320a8a550472bbb8f42257df83fcb8d8df6.tar.xz
Merge tag 'v4.20-rc2' into next-general
Sync to Linux 4.20-rc2 for downstream developers.
Diffstat (limited to 'include/linux/list.h')
-rw-r--r--include/linux/list.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/list.h b/include/linux/list.h
index de04cc5ed536..edb7628e46ed 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -184,6 +184,29 @@ static inline void list_move_tail(struct list_head *list,
}
/**
+ * list_bulk_move_tail - move a subsection of a list to its tail
+ * @head: the head that will follow our entry
+ * @first: first entry to move
+ * @last: last entry to move, can be the same as first
+ *
+ * Move all entries between @first and including @last before @head.
+ * All three entries must belong to the same linked list.
+ */
+static inline void list_bulk_move_tail(struct list_head *head,
+ struct list_head *first,
+ struct list_head *last)
+{
+ first->prev->next = last->next;
+ last->next->prev = first->prev;
+
+ head->prev->next = first;
+ first->prev = head->prev;
+
+ last->next = head;
+ head->prev = last;
+}
+
+/**
* list_is_last - tests whether @list is the last entry in list @head
* @list: the entry to test
* @head: the head of the list