X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=include%2Fnet%2Finetpeer.h;h=ad8404b5611372bbecc7b1759463bb817e8051df;hb=26145f7e7ebc8a5f1b29425d6da62e872031be4a;hp=7fda471002b6b3b19b9bfda4cbca64ad4e75c497;hpb=1da177e4c3f41524e886b7f1b8a0c1fc7321cac2;p=linux-2.6-omap-h63xx.git diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index 7fda471002b..ad8404b5611 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h @@ -17,14 +17,16 @@ struct inet_peer { + /* group together avl_left,avl_right,v4daddr to speedup lookups */ struct inet_peer *avl_left, *avl_right; - struct inet_peer *unused_next, **unused_prevp; - unsigned long dtime; /* the time of last use of not - * referenced entries */ - atomic_t refcnt; - __u32 v4daddr; /* peer's address */ + __be32 v4daddr; /* peer's address */ __u16 avl_height; __u16 ip_id_count; /* IP ID for the next packet */ + struct list_head unused; + __u32 dtime; /* the time of last use of not + * referenced entries */ + atomic_t refcnt; + atomic_t rid; /* Frag reception counter */ __u32 tcp_ts; unsigned long tcp_ts_stamp; }; @@ -32,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 */