diff options
-rw-r--r-- | include/net/inetpeer.h | 1 | ||||
-rw-r--r-- | net/ipv4/inetpeer.c | 21 |
2 files changed, 0 insertions, 22 deletions
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index 01d590ee5e7e..80479abddf73 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h | |||
@@ -61,7 +61,6 @@ struct inet_peer { | |||
61 | struct inet_peer_base { | 61 | struct inet_peer_base { |
62 | struct inet_peer __rcu *root; | 62 | struct inet_peer __rcu *root; |
63 | seqlock_t lock; | 63 | seqlock_t lock; |
64 | u32 flush_seq; | ||
65 | int total; | 64 | int total; |
66 | }; | 65 | }; |
67 | 66 | ||
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c index bd5f5928167d..241afd743d2c 100644 --- a/net/ipv4/inetpeer.c +++ b/net/ipv4/inetpeer.c | |||
@@ -72,29 +72,10 @@ void inet_peer_base_init(struct inet_peer_base *bp) | |||
72 | { | 72 | { |
73 | bp->root = peer_avl_empty_rcu; | 73 | bp->root = peer_avl_empty_rcu; |
74 | seqlock_init(&bp->lock); | 74 | seqlock_init(&bp->lock); |
75 | bp->flush_seq = ~0U; | ||
76 | bp->total = 0; | 75 | bp->total = 0; |
77 | } | 76 | } |
78 | EXPORT_SYMBOL_GPL(inet_peer_base_init); | 77 | EXPORT_SYMBOL_GPL(inet_peer_base_init); |
79 | 78 | ||
80 | static atomic_t v4_seq = ATOMIC_INIT(0); | ||
81 | static atomic_t v6_seq = ATOMIC_INIT(0); | ||
82 | |||
83 | static atomic_t *inetpeer_seq_ptr(int family) | ||
84 | { | ||
85 | return (family == AF_INET ? &v4_seq : &v6_seq); | ||
86 | } | ||
87 | |||
88 | static inline void flush_check(struct inet_peer_base *base, int family) | ||
89 | { | ||
90 | atomic_t *fp = inetpeer_seq_ptr(family); | ||
91 | |||
92 | if (unlikely(base->flush_seq != atomic_read(fp))) { | ||
93 | inetpeer_invalidate_tree(base); | ||
94 | base->flush_seq = atomic_read(fp); | ||
95 | } | ||
96 | } | ||
97 | |||
98 | #define PEER_MAXDEPTH 40 /* sufficient for about 2^27 nodes */ | 79 | #define PEER_MAXDEPTH 40 /* sufficient for about 2^27 nodes */ |
99 | 80 | ||
100 | /* Exported for sysctl_net_ipv4. */ | 81 | /* Exported for sysctl_net_ipv4. */ |
@@ -444,8 +425,6 @@ struct inet_peer *inet_getpeer(struct inet_peer_base *base, | |||
444 | unsigned int sequence; | 425 | unsigned int sequence; |
445 | int invalidated, gccnt = 0; | 426 | int invalidated, gccnt = 0; |
446 | 427 | ||
447 | flush_check(base, daddr->family); | ||
448 | |||
449 | /* Attempt a lockless lookup first. | 428 | /* Attempt a lockless lookup first. |
450 | * Because of a concurrent writer, we might not find an existing entry. | 429 | * Because of a concurrent writer, we might not find an existing entry. |
451 | */ | 430 | */ |