diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-09-27 01:18:43 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-28 21:01:09 -0400 |
commit | 53576d9b995605a9edc7414b900a9218c8f23b1f (patch) | |
tree | a0287612fda29ef5908febacecd001f59fe2ff28 | |
parent | d878e72e419db9ff4c66848375ee30a19820e4de (diff) |
[IPV4]: inetpeer annotations
This one is interesting - we use net-endian value as search key, but
order the tree by *host-endian* comparisons of keys. OK since we only
care about lookups. Annotated inet_getpeer() and friends.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/inetpeer.h | 4 | ||||
-rw-r--r-- | net/ipv4/inetpeer.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index 0965515f40cf..925573fd2aed 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h | |||
@@ -22,7 +22,7 @@ struct inet_peer | |||
22 | unsigned long dtime; /* the time of last use of not | 22 | unsigned long dtime; /* the time of last use of not |
23 | * referenced entries */ | 23 | * referenced entries */ |
24 | atomic_t refcnt; | 24 | atomic_t refcnt; |
25 | __u32 v4daddr; /* peer's address */ | 25 | __be32 v4daddr; /* peer's address */ |
26 | __u16 avl_height; | 26 | __u16 avl_height; |
27 | __u16 ip_id_count; /* IP ID for the next packet */ | 27 | __u16 ip_id_count; /* IP ID for the next packet */ |
28 | atomic_t rid; /* Frag reception counter */ | 28 | atomic_t rid; /* Frag reception counter */ |
@@ -33,7 +33,7 @@ struct inet_peer | |||
33 | void inet_initpeers(void) __init; | 33 | void inet_initpeers(void) __init; |
34 | 34 | ||
35 | /* can be called with or without local BH being disabled */ | 35 | /* can be called with or without local BH being disabled */ |
36 | struct inet_peer *inet_getpeer(__u32 daddr, int create); | 36 | struct inet_peer *inet_getpeer(__be32 daddr, int create); |
37 | 37 | ||
38 | extern spinlock_t inet_peer_unused_lock; | 38 | extern spinlock_t inet_peer_unused_lock; |
39 | extern struct inet_peer **inet_peer_unused_tailp; | 39 | extern struct inet_peer **inet_peer_unused_tailp; |
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c index a675602ef295..2b1a54b59c48 100644 --- a/net/ipv4/inetpeer.c +++ b/net/ipv4/inetpeer.c | |||
@@ -163,7 +163,7 @@ static void unlink_from_unused(struct inet_peer *p) | |||
163 | for (u = peer_root; u != peer_avl_empty; ) { \ | 163 | for (u = peer_root; u != peer_avl_empty; ) { \ |
164 | if (daddr == u->v4daddr) \ | 164 | if (daddr == u->v4daddr) \ |
165 | break; \ | 165 | break; \ |
166 | if (daddr < u->v4daddr) \ | 166 | if ((__force __u32)daddr < (__force __u32)u->v4daddr) \ |
167 | v = &u->avl_left; \ | 167 | v = &u->avl_left; \ |
168 | else \ | 168 | else \ |
169 | v = &u->avl_right; \ | 169 | v = &u->avl_right; \ |
@@ -368,7 +368,7 @@ static int cleanup_once(unsigned long ttl) | |||
368 | } | 368 | } |
369 | 369 | ||
370 | /* Called with or without local BH being disabled. */ | 370 | /* Called with or without local BH being disabled. */ |
371 | struct inet_peer *inet_getpeer(__u32 daddr, int create) | 371 | struct inet_peer *inet_getpeer(__be32 daddr, int create) |
372 | { | 372 | { |
373 | struct inet_peer *p, *n; | 373 | struct inet_peer *p, *n; |
374 | struct inet_peer **stack[PEER_MAXDEPTH], ***stackptr; | 374 | struct inet_peer **stack[PEER_MAXDEPTH], ***stackptr; |