fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / include / net / inetpeer.h
index 0965515..aa10a81 100644 (file)
 
 struct inet_peer
 {
+       /* group together avl_left,avl_right,v4daddr to speedup lookups */
        struct inet_peer        *avl_left, *avl_right;
+       __be32                  v4daddr;        /* peer's address */
+       __u16                   avl_height;
+       __u16                   ip_id_count;    /* IP ID for the next packet */
        struct inet_peer        *unused_next, **unused_prevp;
-       unsigned long           dtime;          /* the time of last use of not
+       __u32                   dtime;          /* the time of last use of not
                                                 * referenced entries */
        atomic_t                refcnt;
-       __u32                   v4daddr;        /* peer's address */
-       __u16                   avl_height;
-       __u16                   ip_id_count;    /* IP ID for the next packet */
        atomic_t                rid;            /* Frag reception counter */
        __u32                   tcp_ts;
        unsigned long           tcp_ts_stamp;
@@ -33,23 +34,10 @@ struct inet_peer
 void                   inet_initpeers(void) __init;
 
 /* can be called with or without local BH being disabled */
-struct inet_peer       *inet_getpeer(__u32 daddr, int create);
+struct inet_peer       *inet_getpeer(__be32 daddr, int create);
 
-extern spinlock_t inet_peer_unused_lock;
-extern struct inet_peer **inet_peer_unused_tailp;
 /* can be called from BH context or outside */
-static inline void     inet_putpeer(struct inet_peer *p)
-{
-       spin_lock_bh(&inet_peer_unused_lock);
-       if (atomic_dec_and_test(&p->refcnt)) {
-               p->unused_prevp = inet_peer_unused_tailp;
-               p->unused_next = NULL;
-               *inet_peer_unused_tailp = p;
-               inet_peer_unused_tailp = &p->unused_next;
-               p->dtime = jiffies;
-       }
-       spin_unlock_bh(&inet_peer_unused_lock);
-}
+extern void inet_putpeer(struct inet_peer *p);
 
 extern spinlock_t inet_peer_idlock;
 /* can be called with or without local BH being disabled */