lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 7 Jul 2016 01:44:25 -0700
From:	tip-bot for Thomas Gleixner <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux@...encehorizons.net, peterz@...radead.org,
	fweisbec@...il.com, torvalds@...ux-foundation.org,
	edumazet@...gle.com, linux-kernel@...r.kernel.org,
	josh@...htriplett.org, clm@...com, riel@...hat.com,
	paulmck@...ux.vnet.ibm.com, arjan@...radead.org,
	tglx@...utronix.de, hpa@...or.com, mingo@...nel.org,
	lenb@...nel.org
Subject: [tip:timers/core] hlist: Add hlist_is_singular_node() helper

Commit-ID:  15dba1e37b5cfd7fab9bc84e0f05f35c918f4eef
Gitweb:     http://git.kernel.org/tip/15dba1e37b5cfd7fab9bc84e0f05f35c918f4eef
Author:     Thomas Gleixner <tglx@...utronix.de>
AuthorDate: Mon, 4 Jul 2016 09:50:27 +0000
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Thu, 7 Jul 2016 10:35:07 +0200

hlist: Add hlist_is_singular_node() helper

Required to figure out whether the entry is the only one in the hlist.

Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Reviewed-by: Frederic Weisbecker <fweisbec@...il.com>
Cc: Arjan van de Ven <arjan@...radead.org>
Cc: Chris Mason <clm@...com>
Cc: Eric Dumazet <edumazet@...gle.com>
Cc: George Spelvin <linux@...encehorizons.net>
Cc: Josh Triplett <josh@...htriplett.org>
Cc: Len Brown <lenb@...nel.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Rik van Riel <riel@...hat.com>
Cc: rt@...utronix.de
Link: http://lkml.kernel.org/r/20160704094341.867631372@linutronix.de
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 include/linux/list.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/linux/list.h b/include/linux/list.h
index 5356f4d..5183138 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -679,6 +679,16 @@ static inline bool hlist_fake(struct hlist_node *h)
 }
 
 /*
+ * 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.
  */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ