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

ipv4: Cleanup struct net dereference in rt_intern_hash

There's no need in getting it 3 times and gcc isn't smart enough
to understand this himself.

This is just a cleanup before the fix (next patch).

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Pavel Emelyanov and committed by
David S. Miller
b35ecb5d 4b97efdf

+2 -2
+2 -2
net/ipv4/route.c
··· 1212 1212 slow_chain_length(rt_hash_table[hash].chain) > rt_chain_length_max) { 1213 1213 struct net *net = dev_net(rt->u.dst.dev); 1214 1214 int num = ++net->ipv4.current_rt_cache_rebuild_count; 1215 - if (!rt_caching(dev_net(rt->u.dst.dev))) { 1215 + if (!rt_caching(net)) { 1216 1216 printk(KERN_WARNING "%s: %d rebuilds is over limit, route caching disabled\n", 1217 1217 rt->u.dst.dev->name, num); 1218 1218 } 1219 - rt_emergency_hash_rebuild(dev_net(rt->u.dst.dev)); 1219 + rt_emergency_hash_rebuild(net); 1220 1220 } 1221 1221 } 1222 1222