Skip to content

Commit

Permalink
ipv4: Get peer more cheaply in rt_init_metrics().
Browse files Browse the repository at this point in the history
We know this is a new route object, so doing atomics and
stuff makes no sense at all.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Mar 5, 2011
1 parent 44713b6 commit 3c0afdc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -1759,9 +1759,9 @@ static void rt_init_metrics(struct rtable *rt, struct fib_info *fi)
if (rt->fl.flags & FLOWI_FLAG_PRECOW_METRICS)
create = 1;

rt_bind_peer(rt, create);
peer = rt->peer;
rt->peer = peer = inet_getpeer_v4(rt->rt_dst, create);
if (peer) {
rt->rt_peer_genid = rt_peer_genid();
if (inet_metrics_new(peer))
memcpy(peer->metrics, fi->fib_metrics,
sizeof(u32) * RTAX_MAX);
Expand Down

0 comments on commit 3c0afdc

Please sign in to comment.