dst.c (4af358f81881e1d083a916c9269b5ac0936e180d) | dst.c (f6b72b6217f8c24f2a54988e58af858b4e66024d) |
---|---|
1/* 2 * net/core/dst.c Protocol independent destination cache. 3 * 4 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> 5 * 6 */ 7 8#include <linux/bitops.h> --- 158 unchanged lines hidden (view full) --- 167 dst->dev = dev; 168 if (dev) 169 dev_hold(dev); 170 dst->ops = ops; 171 dst_init_metrics(dst, dst_default_metrics, true); 172 dst->expires = 0UL; 173 dst->path = dst; 174 dst->neighbour = NULL; | 1/* 2 * net/core/dst.c Protocol independent destination cache. 3 * 4 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> 5 * 6 */ 7 8#include <linux/bitops.h> --- 158 unchanged lines hidden (view full) --- 167 dst->dev = dev; 168 if (dev) 169 dev_hold(dev); 170 dst->ops = ops; 171 dst_init_metrics(dst, dst_default_metrics, true); 172 dst->expires = 0UL; 173 dst->path = dst; 174 dst->neighbour = NULL; |
175 dst->hh = NULL; | |
176#ifdef CONFIG_XFRM 177 dst->xfrm = NULL; 178#endif 179 dst->input = dst_discard; 180 dst->output = dst_discard; 181 dst->error = 0; 182 dst->obsolete = initial_obsolete; 183 dst->header_len = 0; --- 37 unchanged lines hidden (view full) --- 221 spin_unlock_bh(&dst_garbage.lock); 222} 223EXPORT_SYMBOL(__dst_free); 224 225struct dst_entry *dst_destroy(struct dst_entry * dst) 226{ 227 struct dst_entry *child; 228 struct neighbour *neigh; | 175#ifdef CONFIG_XFRM 176 dst->xfrm = NULL; 177#endif 178 dst->input = dst_discard; 179 dst->output = dst_discard; 180 dst->error = 0; 181 dst->obsolete = initial_obsolete; 182 dst->header_len = 0; --- 37 unchanged lines hidden (view full) --- 220 spin_unlock_bh(&dst_garbage.lock); 221} 222EXPORT_SYMBOL(__dst_free); 223 224struct dst_entry *dst_destroy(struct dst_entry * dst) 225{ 226 struct dst_entry *child; 227 struct neighbour *neigh; |
229 struct hh_cache *hh; | |
230 231 smp_rmb(); 232 233again: 234 neigh = dst->neighbour; | 228 229 smp_rmb(); 230 231again: 232 neigh = dst->neighbour; |
235 hh = dst->hh; | |
236 child = dst->child; 237 | 233 child = dst->child; 234 |
238 dst->hh = NULL; 239 if (hh) 240 hh_cache_put(hh); 241 | |
242 if (neigh) { 243 dst->neighbour = NULL; 244 neigh_release(neigh); 245 } 246 247 if (!(dst->flags & DST_NOCOUNT)) 248 dst_entries_add(dst->ops, -1); 249 --- 172 unchanged lines hidden --- | 235 if (neigh) { 236 dst->neighbour = NULL; 237 neigh_release(neigh); 238 } 239 240 if (!(dst->flags & DST_NOCOUNT)) 241 dst_entries_add(dst->ops, -1); 242 --- 172 unchanged lines hidden --- |