From: Johannes Berg Date: Thu, 11 Apr 2013 20:52:36 +0000 (+0200) Subject: backports: remove __inet_lookup_established X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5dcba8d70aa49ddb6072550398b658b8bd68cd42;p=openwrt%2Fstaging%2Fblogic.git backports: remove __inet_lookup_established Signed-off-by: Johannes Berg --- diff --git a/backport/backport-include/linux/compat-2.6.25.h b/backport/backport-include/linux/compat-2.6.25.h index dd986f5c6013..9a2afdba4bbe 100644 --- a/backport/backport-include/linux/compat-2.6.25.h +++ b/backport/backport-include/linux/compat-2.6.25.h @@ -21,10 +21,6 @@ #include #include #include -#define __inet_lookup_established __inet_lookup_established_old -#include -#undef __inet_lookup_established -#include struct sg_table { struct scatterlist *sgl; /* the list */ @@ -57,49 +53,6 @@ int sg_alloc_table(struct sg_table *table, unsigned int nents, gfp_t gfp_mask); #define SG_MAX_SINGLE_ALLOC (PAGE_SIZE / sizeof(struct scatterlist)) -/* - * Sockets in TCP_CLOSE state are _always_ taken out of the hash, so we need - * not check it for lookups anymore, thanks Alexey. -DaveM - * - * Local BH must be disabled here. - */ -static inline struct sock * - __inet_lookup_established(struct inet_hashinfo *hashinfo, - const __be32 saddr, const __be16 sport, - const __be32 daddr, const u16 hnum, - const int dif) -{ - INET_ADDR_COOKIE(acookie, saddr, daddr) - const __portpair ports = INET_COMBINED_PORTS(sport, hnum); - struct sock *sk; - /* Optimize here for direct hit, only listening connections can - * have wildcards anyways. - */ - unsigned int hash = inet_ehashfn(daddr, hnum, saddr, sport); - struct inet_ehash_bucket *head = inet_ehash_bucket(hashinfo, hash); - rwlock_t *lock = inet_ehash_lockp(hashinfo, hash); - - prefetch(head->chain.first); - read_lock(lock); - sk_for_each(sk, &head->chain) { - if (INET_MATCH(sk, hash, acookie, saddr, daddr, ports, dif)) - goto hit; /* You sunk my battleship! */ - } - - /* Must check for a TIME_WAIT'er before going to listener hash. */ - sk_for_each(sk, &head->twchain) { - if (INET_TW_MATCH(sk, hash, acookie, saddr, daddr, ports, dif)) - goto hit; - } - sk = NULL; -out: - read_unlock(lock); - return sk; -hit: - sock_hold(sk); - goto out; -} - /* Backports b718989da7 */ #define pci_enable_device_mem LINUX_BACKPORT(pci_enable_device_mem) int __must_check pci_enable_device_mem(struct pci_dev *dev);