From: levin li <xingke.lwp at taobao.com> Signed-off-by: levin li <xingke.lwp at taobao.com> --- include/list.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/list.h b/include/list.h index 38870e6..f0b25e5 100644 --- a/include/list.h +++ b/include/list.h @@ -115,6 +115,15 @@ static inline void list_splice_init(struct list_head *list, } } +static inline void list_splice_tail_init(struct list_head *list, + struct list_head *head) +{ + if (!list_empty(list)) { + __list_splice(list, head->prev, head); + INIT_LIST_HEAD(list); + } +} + /* hlist, mostly useful for hash tables */ #define LIST_POISON1 ((void *) 0x00100100) -- 1.7.10 |