提交 15dba1e3 编写于 作者: T Thomas Gleixner 提交者: Ingo Molnar

hlist: Add hlist_is_singular_node() helper

Required to figure out whether the entry is the only one in the hlist.
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Reviewed-by: NFrederic Weisbecker <fweisbec@gmail.com>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Chris Mason <clm@fb.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: George Spelvin <linux@sciencehorizons.net>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Len Brown <lenb@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160704094341.867631372@linutronix.deSigned-off-by: NIngo Molnar <mingo@kernel.org>
上级 2b1ecc3d
......@@ -678,6 +678,16 @@ static inline bool hlist_fake(struct hlist_node *h)
return h->pprev == &h->next;
}
/*
* Check whether the node is the only node of the head without
* accessing head:
*/
static inline bool
hlist_is_singular_node(struct hlist_node *n, struct hlist_head *h)
{
return !n->next && n->pprev == &h->first;
}
/*
* Move a list from one list head to another. Fixup the pprev
* reference of the first entry if it exists.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册