Date: Mon, 8 Dec 2008 20:18:50 +0000 (UTC) From: Robert Watson <rwatson@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/sys/netinet in_pcb.c in_pcb.h Message-ID: <200812082019.mB8KJ5i3016581@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
rwatson 2008-12-08 20:18:50 UTC
FreeBSD src repository
Modified files:
sys/netinet in_pcb.c in_pcb.h
Log:
SVN rev 185773 on 2008-12-08 20:18:50Z by rwatson
Add a reference count to struct inpcb, which may be explicitly
incremented using in_pcbref(), and decremented using in_pcbfree()
or inpcbrele(). Protocols using only current in_pcballoc() and
in_pcbfree() calls will see the same semantics, but it is now
possible for TCP to call in_pcbref() and in_pcbrele() to prevent
an inpcb from being freed when both tcbinfo and per-inpcb locks
are released. This makes it possible to safely transition from
holding only the inpcb lock to both tcbinfo and inpcb lock
without re-looking up a connection in the input path, timer
path, etc.
Notice that in_pcbrele() does not unlock the connection after
decrementing the refcount, if the connection remains, so that
the caller can continue to use it; in_pcbrele() returns a flag
indicating whether or not the inpcb pointer is still valid, and
in_pcbfee() is now a simple wrapper around in_pcbrele().
MFC after: 1 month
Discussed with: bz, kmacy
Reviewed by: bz, gnn, kmacy
Tested by: kmacy
Revision Changes Path
1.232 +82 -12 src/sys/netinet/in_pcb.c
1.119 +3 -0 src/sys/netinet/in_pcb.h
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812082019.mB8KJ5i3016581>
