diff options
author | David S. Miller <davem@davemloft.net> | 2010-11-30 14:54:19 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-30 14:54:19 -0500 |
commit | b534ecf1cd26f094497da6ae28a6ab64cdbe1617 (patch) | |
tree | bdf8a55183a38926b8f34f709cb51a4db2f5f6b8 /net/ipv4/inetpeer.c | |
parent | 582a72da9a41be9227dc931d728ae2906880a589 (diff) |
inetpeer: Make inet_getpeer() take an inet_peer_adress_t pointer.
And make an inet_getpeer_v4() helper, update callers.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/inetpeer.c')
-rw-r--r-- | net/ipv4/inetpeer.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c index 893f998efdbb..9aa76b8dd490 100644 --- a/net/ipv4/inetpeer.c +++ b/net/ipv4/inetpeer.c | |||
@@ -444,7 +444,7 @@ static struct inet_peer_base *family_to_base(int family) | |||
444 | } | 444 | } |
445 | 445 | ||
446 | /* Called with or without local BH being disabled. */ | 446 | /* Called with or without local BH being disabled. */ |
447 | struct inet_peer *inet_getpeer(__be32 daddr, int create) | 447 | struct inet_peer *inet_getpeer(inet_peer_address_t *daddr, int create) |
448 | { | 448 | { |
449 | struct inet_peer __rcu **stack[PEER_MAXDEPTH], ***stackptr; | 449 | struct inet_peer __rcu **stack[PEER_MAXDEPTH], ***stackptr; |
450 | struct inet_peer_base *base = family_to_base(AF_INET); | 450 | struct inet_peer_base *base = family_to_base(AF_INET); |
@@ -454,7 +454,7 @@ struct inet_peer *inet_getpeer(__be32 daddr, int create) | |||
454 | * Because of a concurrent writer, we might not find an existing entry. | 454 | * Because of a concurrent writer, we might not find an existing entry. |
455 | */ | 455 | */ |
456 | rcu_read_lock_bh(); | 456 | rcu_read_lock_bh(); |
457 | p = lookup_rcu_bh(daddr, base); | 457 | p = lookup_rcu_bh(daddr->a4, base); |
458 | rcu_read_unlock_bh(); | 458 | rcu_read_unlock_bh(); |
459 | 459 | ||
460 | if (p) { | 460 | if (p) { |
@@ -469,7 +469,7 @@ struct inet_peer *inet_getpeer(__be32 daddr, int create) | |||
469 | * At least, nodes should be hot in our cache. | 469 | * At least, nodes should be hot in our cache. |
470 | */ | 470 | */ |
471 | spin_lock_bh(&base->lock); | 471 | spin_lock_bh(&base->lock); |
472 | p = lookup(daddr, stack, base); | 472 | p = lookup(daddr->a4, stack, base); |
473 | if (p != peer_avl_empty) { | 473 | if (p != peer_avl_empty) { |
474 | atomic_inc(&p->refcnt); | 474 | atomic_inc(&p->refcnt); |
475 | spin_unlock_bh(&base->lock); | 475 | spin_unlock_bh(&base->lock); |
@@ -479,10 +479,10 @@ struct inet_peer *inet_getpeer(__be32 daddr, int create) | |||
479 | } | 479 | } |
480 | p = create ? kmem_cache_alloc(peer_cachep, GFP_ATOMIC) : NULL; | 480 | p = create ? kmem_cache_alloc(peer_cachep, GFP_ATOMIC) : NULL; |
481 | if (p) { | 481 | if (p) { |
482 | p->daddr.a4 = daddr; | 482 | p->daddr = *daddr; |
483 | atomic_set(&p->refcnt, 1); | 483 | atomic_set(&p->refcnt, 1); |
484 | atomic_set(&p->rid, 0); | 484 | atomic_set(&p->rid, 0); |
485 | atomic_set(&p->ip_id_count, secure_ip_id(daddr)); | 485 | atomic_set(&p->ip_id_count, secure_ip_id(daddr->a4)); |
486 | p->tcp_ts_stamp = 0; | 486 | p->tcp_ts_stamp = 0; |
487 | INIT_LIST_HEAD(&p->unused); | 487 | INIT_LIST_HEAD(&p->unused); |
488 | 488 | ||