aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-07-03 01:58:02 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-05 05:42:00 -0400
commit36bdbcae2fa2a6dfa99344d4190fcea0aa7b7c25 (patch)
tree79d4167b6913428522dc6e5a0bf98a9d58d36f9e
parentd1e31fb02b31ba88d5650d97c35eb58f52bfe0e1 (diff)
net: Kill dst->_neighbour, accessors, and final uses.
No longer used. Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/dst.h17
-rw-r--r--net/core/dst.c18
2 files changed, 1 insertions, 34 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index 295a70547e7d..b2634e446613 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -42,7 +42,7 @@ struct dst_entry {
42 struct dst_entry *from; 42 struct dst_entry *from;
43 }; 43 };
44 struct dst_entry *path; 44 struct dst_entry *path;
45 struct neighbour __rcu *_neighbour; 45 void *__pad0;
46#ifdef CONFIG_XFRM 46#ifdef CONFIG_XFRM
47 struct xfrm_state *xfrm; 47 struct xfrm_state *xfrm;
48#else 48#else
@@ -96,21 +96,6 @@ struct dst_entry {
96 }; 96 };
97}; 97};
98 98
99static inline struct neighbour *dst_get_neighbour_noref(struct dst_entry *dst)
100{
101 return rcu_dereference(dst->_neighbour);
102}
103
104static inline struct neighbour *dst_get_neighbour_noref_raw(struct dst_entry *dst)
105{
106 return rcu_dereference_raw(dst->_neighbour);
107}
108
109static inline void dst_set_neighbour(struct dst_entry *dst, struct neighbour *neigh)
110{
111 rcu_assign_pointer(dst->_neighbour, neigh);
112}
113
114extern u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old); 99extern u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old);
115extern const u32 dst_default_metrics[RTAX_MAX]; 100extern const u32 dst_default_metrics[RTAX_MAX];
116 101
diff --git a/net/core/dst.c b/net/core/dst.c
index a6e19a23a745..07bacff84aa4 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -171,7 +171,6 @@ void *dst_alloc(struct dst_ops *ops, struct net_device *dev,
171 dst_init_metrics(dst, dst_default_metrics, true); 171 dst_init_metrics(dst, dst_default_metrics, true);
172 dst->expires = 0UL; 172 dst->expires = 0UL;
173 dst->path = dst; 173 dst->path = dst;
174 RCU_INIT_POINTER(dst->_neighbour, NULL);
175#ifdef CONFIG_XFRM 174#ifdef CONFIG_XFRM
176 dst->xfrm = NULL; 175 dst->xfrm = NULL;
177#endif 176#endif
@@ -225,19 +224,12 @@ EXPORT_SYMBOL(__dst_free);
225struct dst_entry *dst_destroy(struct dst_entry * dst) 224struct dst_entry *dst_destroy(struct dst_entry * dst)
226{ 225{
227 struct dst_entry *child; 226 struct dst_entry *child;
228 struct neighbour *neigh;
229 227
230 smp_rmb(); 228 smp_rmb();
231 229
232again: 230again:
233 neigh = rcu_dereference_protected(dst->_neighbour, 1);
234 child = dst->child; 231 child = dst->child;
235 232
236 if (neigh) {
237 RCU_INIT_POINTER(dst->_neighbour, NULL);
238 neigh_release(neigh);
239 }
240
241 if (!(dst->flags & DST_NOCOUNT)) 233 if (!(dst->flags & DST_NOCOUNT))
242 dst_entries_add(dst->ops, -1); 234 dst_entries_add(dst->ops, -1);
243 235
@@ -361,19 +353,9 @@ static void dst_ifdown(struct dst_entry *dst, struct net_device *dev,
361 if (!unregister) { 353 if (!unregister) {
362 dst->input = dst->output = dst_discard; 354 dst->input = dst->output = dst_discard;
363 } else { 355 } else {
364 struct neighbour *neigh;
365
366 dst->dev = dev_net(dst->dev)->loopback_dev; 356 dst->dev = dev_net(dst->dev)->loopback_dev;
367 dev_hold(dst->dev); 357 dev_hold(dst->dev);
368 dev_put(dev); 358 dev_put(dev);
369 rcu_read_lock();
370 neigh = dst_get_neighbour_noref(dst);
371 if (neigh && neigh->dev == dev) {
372 neigh->dev = dst->dev;
373 dev_hold(dst->dev);
374 dev_put(dev);
375 }
376 rcu_read_unlock();
377 } 359 }
378} 360}
379 361