From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932357AbcCILr2 (ORCPT ); Wed, 9 Mar 2016 06:47:28 -0500 Received: from torg.zytor.com ([198.137.202.12]:37998 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932256AbcCILrZ (ORCPT ); Wed, 9 Mar 2016 06:47:25 -0500 Date: Wed, 9 Mar 2016 03:45:56 -0800 From: tip-bot for Josh Poimboeuf Message-ID: Cc: bp@alien8.de, akpm@linux-foundation.org, chris.j.arges@canonical.com, namhyung@gmail.com, torvalds@linux-foundation.org, mingo@kernel.org, tglx@linutronix.de, luto@kernel.org, jpoimboe@redhat.com, bernd@petrovitsch.priv.at, mmarek@suse.cz, palves@redhat.com, acme@kernel.org, jslaby@suse.cz, hpa@zytor.com, linux-kernel@vger.kernel.org, acme@infradead.org, peterz@infradead.org Reply-To: chris.j.arges@canonical.com, namhyung@gmail.com, torvalds@linux-foundation.org, bp@alien8.de, akpm@linux-foundation.org, tglx@linutronix.de, luto@kernel.org, jpoimboe@redhat.com, mingo@kernel.org, bernd@petrovitsch.priv.at, mmarek@suse.cz, acme@kernel.org, palves@redhat.com, hpa@zytor.com, jslaby@suse.cz, linux-kernel@vger.kernel.org, peterz@infradead.org, acme@infradead.org In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:core/objtool] tools: Copy hashtable.h into tools directory Git-Commit-ID: 1698872b5c772aebc5c43ca445cc0a79f12b9fcc X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 1698872b5c772aebc5c43ca445cc0a79f12b9fcc Gitweb: http://git.kernel.org/tip/1698872b5c772aebc5c43ca445cc0a79f12b9fcc Author: Josh Poimboeuf AuthorDate: Wed, 9 Mar 2016 00:06:59 -0600 Committer: Ingo Molnar CommitDate: Wed, 9 Mar 2016 10:48:09 +0100 tools: Copy hashtable.h into tools directory Copy hashtable.h from include/linux/tools.h. It's needed by objtool in the next patch in the series. Add some includes that it needs, and remove references to kernel-specific features like RCU and __read_mostly. Also change some if its dependency headers' includes to use quotes instead of brackets so gcc can find them. Signed-off-by: Josh Poimboeuf Cc: Andrew Morton Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Bernd Petrovitsch Cc: Borislav Petkov Cc: Chris J Arges Cc: Jiri Slaby Cc: Linus Torvalds Cc: Michal Marek Cc: Namhyung Kim Cc: Pedro Alves Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: live-patching@vger.kernel.org Link: http://lkml.kernel.org/r/be3bef72f6540d8a510515408119d968a0e18179.1457502970.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar --- tools/include/asm-generic/bitops/__fls.h | 2 +- tools/include/asm-generic/bitops/fls.h | 2 +- tools/include/asm-generic/bitops/fls64.h | 2 +- {include => tools/include}/linux/hashtable.h | 69 +++------------------------- 4 files changed, 9 insertions(+), 66 deletions(-) diff --git a/tools/include/asm-generic/bitops/__fls.h b/tools/include/asm-generic/bitops/__fls.h index 2218b9a..494c9c6 100644 --- a/tools/include/asm-generic/bitops/__fls.h +++ b/tools/include/asm-generic/bitops/__fls.h @@ -1 +1 @@ -#include <../../../../include/asm-generic/bitops/__fls.h> +#include "../../../../include/asm-generic/bitops/__fls.h" diff --git a/tools/include/asm-generic/bitops/fls.h b/tools/include/asm-generic/bitops/fls.h index dbf711a..0e4995f 100644 --- a/tools/include/asm-generic/bitops/fls.h +++ b/tools/include/asm-generic/bitops/fls.h @@ -1 +1 @@ -#include <../../../../include/asm-generic/bitops/fls.h> +#include "../../../../include/asm-generic/bitops/fls.h" diff --git a/tools/include/asm-generic/bitops/fls64.h b/tools/include/asm-generic/bitops/fls64.h index 980b1f6..35bee00 100644 --- a/tools/include/asm-generic/bitops/fls64.h +++ b/tools/include/asm-generic/bitops/fls64.h @@ -1 +1 @@ -#include <../../../../include/asm-generic/bitops/fls64.h> +#include "../../../../include/asm-generic/bitops/fls64.h" diff --git a/include/linux/hashtable.h b/tools/include/linux/hashtable.h similarity index 65% copy from include/linux/hashtable.h copy to tools/include/linux/hashtable.h index 661e5c2..c65cc0a 100644 --- a/include/linux/hashtable.h +++ b/tools/include/linux/hashtable.h @@ -9,17 +9,18 @@ #include #include #include +#include #include -#include +#include + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +#endif #define DEFINE_HASHTABLE(name, bits) \ struct hlist_head name[1 << (bits)] = \ { [0 ... ((1 << (bits)) - 1)] = HLIST_HEAD_INIT } -#define DEFINE_READ_MOSTLY_HASHTABLE(name, bits) \ - struct hlist_head name[1 << (bits)] __read_mostly = \ - { [0 ... ((1 << (bits)) - 1)] = HLIST_HEAD_INIT } - #define DECLARE_HASHTABLE(name, bits) \ struct hlist_head name[1 << (bits)] @@ -60,15 +61,6 @@ static inline void __hash_init(struct hlist_head *ht, unsigned int sz) hlist_add_head(node, &hashtable[hash_min(key, HASH_BITS(hashtable))]) /** - * hash_add_rcu - add an object to a rcu enabled hashtable - * @hashtable: hashtable to add to - * @node: the &struct hlist_node of the object to be added - * @key: the key of the object to be added - */ -#define hash_add_rcu(hashtable, node, key) \ - hlist_add_head_rcu(node, &hashtable[hash_min(key, HASH_BITS(hashtable))]) - -/** * hash_hashed - check whether an object is in any hashtable * @node: the &struct hlist_node of the object to be checked */ @@ -107,15 +99,6 @@ static inline void hash_del(struct hlist_node *node) } /** - * hash_del_rcu - remove an object from a rcu enabled hashtable - * @node: &struct hlist_node of the object to remove - */ -static inline void hash_del_rcu(struct hlist_node *node) -{ - hlist_del_init_rcu(node); -} - -/** * hash_for_each - iterate over a hashtable * @name: hashtable to iterate * @bkt: integer to use as bucket loop cursor @@ -128,18 +111,6 @@ static inline void hash_del_rcu(struct hlist_node *node) hlist_for_each_entry(obj, &name[bkt], member) /** - * hash_for_each_rcu - iterate over a rcu enabled hashtable - * @name: hashtable to iterate - * @bkt: integer to use as bucket loop cursor - * @obj: the type * to use as a loop cursor for each entry - * @member: the name of the hlist_node within the struct - */ -#define hash_for_each_rcu(name, bkt, obj, member) \ - for ((bkt) = 0, obj = NULL; obj == NULL && (bkt) < HASH_SIZE(name);\ - (bkt)++)\ - hlist_for_each_entry_rcu(obj, &name[bkt], member) - -/** * hash_for_each_safe - iterate over a hashtable safe against removal of * hash entry * @name: hashtable to iterate @@ -165,34 +136,6 @@ static inline void hash_del_rcu(struct hlist_node *node) hlist_for_each_entry(obj, &name[hash_min(key, HASH_BITS(name))], member) /** - * hash_for_each_possible_rcu - iterate over all possible objects hashing to the - * same bucket in an rcu enabled hashtable - * in a rcu enabled hashtable - * @name: hashtable to iterate - * @obj: the type * to use as a loop cursor for each entry - * @member: the name of the hlist_node within the struct - * @key: the key of the objects to iterate over - */ -#define hash_for_each_possible_rcu(name, obj, member, key) \ - hlist_for_each_entry_rcu(obj, &name[hash_min(key, HASH_BITS(name))],\ - member) - -/** - * hash_for_each_possible_rcu_notrace - iterate over all possible objects hashing - * to the same bucket in an rcu enabled hashtable in a rcu enabled hashtable - * @name: hashtable to iterate - * @obj: the type * to use as a loop cursor for each entry - * @member: the name of the hlist_node within the struct - * @key: the key of the objects to iterate over - * - * This is the same as hash_for_each_possible_rcu() except that it does - * not do any RCU debugging or tracing. - */ -#define hash_for_each_possible_rcu_notrace(name, obj, member, key) \ - hlist_for_each_entry_rcu_notrace(obj, \ - &name[hash_min(key, HASH_BITS(name))], member) - -/** * hash_for_each_possible_safe - iterate over all possible objects hashing to the * same bucket safe against removals * @name: hashtable to iterate