Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

decnet: Move dn_next into decnet route structure.

Signed-off-by: David S. Miller <davem@davemloft.net>
Reviewed-by: Eric Dumazet <edumazet@google.com>

+19 -17
+1
include/net/dn_route.h
··· 69 69 */ 70 70 struct dn_route { 71 71 struct dst_entry dst; 72 + struct dn_route __rcu *dn_next; 72 73 73 74 struct neighbour *n; 74 75
-1
include/net/dst.h
··· 102 102 union { 103 103 struct dst_entry *next; 104 104 struct rt6_info __rcu *rt6_next; 105 - struct dn_route __rcu *dn_next; 106 105 }; 107 106 }; 108 107
+18 -16
net/decnet/dn_route.c
··· 199 199 lockdep_is_held(&dn_rt_hash_table[i].lock))) != NULL) { 200 200 if (atomic_read(&rt->dst.__refcnt) > 1 || 201 201 (now - rt->dst.lastuse) < expire) { 202 - rtp = &rt->dst.dn_next; 202 + rtp = &rt->dn_next; 203 203 continue; 204 204 } 205 - *rtp = rt->dst.dn_next; 206 - rt->dst.dn_next = NULL; 205 + *rtp = rt->dn_next; 206 + rt->dn_next = NULL; 207 207 dst_dev_put(&rt->dst); 208 208 dst_release(&rt->dst); 209 209 } ··· 233 233 lockdep_is_held(&dn_rt_hash_table[i].lock))) != NULL) { 234 234 if (atomic_read(&rt->dst.__refcnt) > 1 || 235 235 (now - rt->dst.lastuse) < expire) { 236 - rtp = &rt->dst.dn_next; 236 + rtp = &rt->dn_next; 237 237 continue; 238 238 } 239 - *rtp = rt->dst.dn_next; 240 - rt->dst.dn_next = NULL; 239 + *rtp = rt->dn_next; 240 + rt->dn_next = NULL; 241 241 dst_dev_put(&rt->dst); 242 242 dst_release(&rt->dst); 243 243 break; ··· 333 333 lockdep_is_held(&dn_rt_hash_table[hash].lock))) != NULL) { 334 334 if (compare_keys(&rth->fld, &rt->fld)) { 335 335 /* Put it first */ 336 - *rthp = rth->dst.dn_next; 337 - rcu_assign_pointer(rth->dst.dn_next, 336 + *rthp = rth->dn_next; 337 + rcu_assign_pointer(rth->dn_next, 338 338 dn_rt_hash_table[hash].chain); 339 339 rcu_assign_pointer(dn_rt_hash_table[hash].chain, rth); 340 340 ··· 345 345 *rp = rth; 346 346 return 0; 347 347 } 348 - rthp = &rth->dst.dn_next; 348 + rthp = &rth->dn_next; 349 349 } 350 350 351 - rcu_assign_pointer(rt->dst.dn_next, dn_rt_hash_table[hash].chain); 351 + rcu_assign_pointer(rt->dn_next, dn_rt_hash_table[hash].chain); 352 352 rcu_assign_pointer(dn_rt_hash_table[hash].chain, rt); 353 353 354 354 dst_hold_and_use(&rt->dst, now); ··· 369 369 goto nothing_to_declare; 370 370 371 371 for(; rt; rt = next) { 372 - next = rcu_dereference_raw(rt->dst.dn_next); 373 - RCU_INIT_POINTER(rt->dst.dn_next, NULL); 372 + next = rcu_dereference_raw(rt->dn_next); 373 + RCU_INIT_POINTER(rt->dn_next, NULL); 374 374 dst_dev_put(&rt->dst); 375 375 dst_release(&rt->dst); 376 376 } ··· 1183 1183 if (rt == NULL) 1184 1184 goto e_nobufs; 1185 1185 1186 + rt->dn_next = NULL; 1186 1187 memset(&rt->fld, 0, sizeof(rt->fld)); 1187 1188 rt->fld.saddr = oldflp->saddr; 1188 1189 rt->fld.daddr = oldflp->daddr; ··· 1253 1252 if (!(flags & MSG_TRYHARD)) { 1254 1253 rcu_read_lock_bh(); 1255 1254 for (rt = rcu_dereference_bh(dn_rt_hash_table[hash].chain); rt; 1256 - rt = rcu_dereference_bh(rt->dst.dn_next)) { 1255 + rt = rcu_dereference_bh(rt->dn_next)) { 1257 1256 if ((flp->daddr == rt->fld.daddr) && 1258 1257 (flp->saddr == rt->fld.saddr) && 1259 1258 (flp->flowidn_mark == rt->fld.flowidn_mark) && ··· 1449 1448 if (rt == NULL) 1450 1449 goto e_nobufs; 1451 1450 1451 + rt->dn_next = NULL; 1452 1452 memset(&rt->fld, 0, sizeof(rt->fld)); 1453 1453 rt->rt_saddr = fld.saddr; 1454 1454 rt->rt_daddr = fld.daddr; ··· 1531 1529 1532 1530 rcu_read_lock(); 1533 1531 for(rt = rcu_dereference(dn_rt_hash_table[hash].chain); rt != NULL; 1534 - rt = rcu_dereference(rt->dst.dn_next)) { 1532 + rt = rcu_dereference(rt->dn_next)) { 1535 1533 if ((rt->fld.saddr == cb->src) && 1536 1534 (rt->fld.daddr == cb->dst) && 1537 1535 (rt->fld.flowidn_oif == 0) && ··· 1751 1749 rcu_read_lock_bh(); 1752 1750 for(rt = rcu_dereference_bh(dn_rt_hash_table[h].chain), idx = 0; 1753 1751 rt; 1754 - rt = rcu_dereference_bh(rt->dst.dn_next), idx++) { 1752 + rt = rcu_dereference_bh(rt->dn_next), idx++) { 1755 1753 if (idx < s_idx) 1756 1754 continue; 1757 1755 skb_dst_set(skb, dst_clone(&rt->dst)); ··· 1797 1795 { 1798 1796 struct dn_rt_cache_iter_state *s = seq->private; 1799 1797 1800 - rt = rcu_dereference_bh(rt->dst.dn_next); 1798 + rt = rcu_dereference_bh(rt->dn_next); 1801 1799 while (!rt) { 1802 1800 rcu_read_unlock_bh(); 1803 1801 if (--s->bucket < 0)