Commit 3c0afdca authored by David S. Miller's avatar David S. Miller

ipv4: Get peer more cheaply in rt_init_metrics().

We know this is a new route object, so doing atomics and
stuff makes no sense at all.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 44713b67
...@@ -1759,9 +1759,9 @@ static void rt_init_metrics(struct rtable *rt, struct fib_info *fi) ...@@ -1759,9 +1759,9 @@ static void rt_init_metrics(struct rtable *rt, struct fib_info *fi)
if (rt->fl.flags & FLOWI_FLAG_PRECOW_METRICS) if (rt->fl.flags & FLOWI_FLAG_PRECOW_METRICS)
create = 1; create = 1;
rt_bind_peer(rt, create); rt->peer = peer = inet_getpeer_v4(rt->rt_dst, create);
peer = rt->peer;
if (peer) { if (peer) {
rt->rt_peer_genid = rt_peer_genid();
if (inet_metrics_new(peer)) if (inet_metrics_new(peer))
memcpy(peer->metrics, fi->fib_metrics, memcpy(peer->metrics, fi->fib_metrics,
sizeof(u32) * RTAX_MAX); sizeof(u32) * RTAX_MAX);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment