backports: bump rhashtable requirement
authorJohannes Berg <johannes.berg@intel.com>
Tue, 7 Feb 2017 09:28:30 +0000 (10:28 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 7 Feb 2017 14:07:18 +0000 (15:07 +0100)
We can no longer use the rhashtable that's built into the
kernel in version >4.1, only in versions >4.9 that have
the rhltable API.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
backport/backport-include/linux/rhashtable.h [deleted file]
backport/compat/Kconfig
backport/compat/backport-4.7.c

diff --git a/backport/backport-include/linux/rhashtable.h b/backport/backport-include/linux/rhashtable.h
deleted file mode 100644 (file)
index 14534d9..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef __BACKPORT_LINUX_RHASHTABLE_H
-#define __BACKPORT_LINUX_RHASHTABLE_H
-#include_next <linux/rhashtable.h>
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0)
-#define rhashtable_walk_init LINUX_BACKPORT(rhashtable_walk_init)
-int rhashtable_walk_init(struct rhashtable *ht, struct rhashtable_iter *iter,
-                        gfp_t gfp);
-#endif /* < 3.10 */
-
-#endif /* __BACKPORT_LINUX_RHASHTABLE_H */
index ffa8cea842956665aad1ff47fd8f1acaea1098c0..f66d5f74ba18c9aacd4bf843087160f4175b3ac0 100644 (file)
@@ -136,8 +136,9 @@ config BPAUTO_BUILD_WANT_DEV_COREDUMP
 
 config BPAUTO_RHASHTABLE
        bool
-       # current API of rhashtable was introduced in version 4.1
-       depends on KERNEL_4_1
+       # current API of rhashtable was introduced in version 4.9
+       # (the one including rhltable)
+       depends on KERNEL_4_9
        # not very nice - but better than always having it
        default y if BACKPORTED_MAC80211
        #h-file linux/rhashtable.h
index f91906878d1743a708dbc0d2a29b6d3b48c477e6..14f8da11209debdf2e4257a4b043a6c81603ba94 100644 (file)
 #include <linux/skbuff.h>
 #include <net/netlink.h>
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)
-#include <linux/rhashtable.h>
-
-/**
- * rhashtable_walk_init - Initialise an iterator
- * @ht:                Table to walk over
- * @iter:      Hash table Iterator
- * @gfp:       GFP flags for allocations
- *
- * This function prepares a hash table walk.
- *
- * Note that if you restart a walk after rhashtable_walk_stop you
- * may see the same object twice.  Also, you may miss objects if
- * there are removals in between rhashtable_walk_stop and the next
- * call to rhashtable_walk_start.
- *
- * For a completely stable walk you should construct your own data
- * structure outside the hash table.
- *
- * This function may sleep so you must not call it from interrupt
- * context or with spin locks held.
- *
- * You must call rhashtable_walk_exit if this function returns
- * successfully.
- */
-int rhashtable_walk_init(struct rhashtable *ht, struct rhashtable_iter *iter,
-                        gfp_t gfp)
-{
-       iter->ht = ht;
-       iter->p = NULL;
-       iter->slot = 0;
-       iter->skip = 0;
-
-       iter->walker = kmalloc(sizeof(*iter->walker), gfp);
-       if (!iter->walker)
-               return -ENOMEM;
-
-       spin_lock(&ht->lock);
-       iter->walker->tbl =
-               rcu_dereference_protected(ht->tbl, lockdep_is_held(&ht->lock));
-       list_add(&iter->walker->list, &iter->walker->tbl->walkers);
-       spin_unlock(&ht->lock);
-
-       return 0;
-}
-EXPORT_SYMBOL_GPL(rhashtable_walk_init);
-#endif /* >= 4.1 */
-
 /**
  * __nla_reserve_64bit - reserve room for attribute on the skb and align it
  * @skb: socket buffer to reserve room on