Date: Sat, 6 Mar 2010 21:24:11 +0000 (UTC) From: Robert Watson <rwatson@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r204806 - head/sys/netinet Message-ID: <201003062124.o26LOBwU041254@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rwatson Date: Sat Mar 6 21:24:11 2010 New Revision: 204806 URL: http://svn.freebsd.org/changeset/base/204806 Log: Wrap use of rw_try_upgrade() on pcbinfo with macro INP_INFO_TRY_UPGRADE() to match other pcbinfo locking macros. MFC after: 1 week Modified: head/sys/netinet/in_pcb.h head/sys/netinet/tcp_input.c Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Sat Mar 6 21:22:28 2010 (r204805) +++ head/sys/netinet/in_pcb.h Sat Mar 6 21:24:11 2010 (r204806) @@ -376,6 +376,7 @@ void inp_4tuple_get(struct inpcb *inp, #define INP_INFO_WLOCK(ipi) rw_wlock(&(ipi)->ipi_lock) #define INP_INFO_TRY_RLOCK(ipi) rw_try_rlock(&(ipi)->ipi_lock) #define INP_INFO_TRY_WLOCK(ipi) rw_try_wlock(&(ipi)->ipi_lock) +#define INP_INFO_TRY_UPGRADE(ipi) rw_try_upgrade(&(ipi)->ipi_lock) #define INP_INFO_RUNLOCK(ipi) rw_runlock(&(ipi)->ipi_lock) #define INP_INFO_WUNLOCK(ipi) rw_wunlock(&(ipi)->ipi_lock) #define INP_INFO_LOCK_ASSERT(ipi) rw_assert(&(ipi)->ipi_lock, RA_LOCKED) Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sat Mar 6 21:22:28 2010 (r204805) +++ head/sys/netinet/tcp_input.c Sat Mar 6 21:24:11 2010 (r204806) @@ -632,7 +632,7 @@ relocked: ("%s: INP_TIMEWAIT ti_locked %d", __func__, ti_locked)); if (ti_locked == TI_RLOCKED) { - if (rw_try_upgrade(&V_tcbinfo.ipi_lock) == 0) { + if (INP_INFO_TRY_UPGRADE(&V_tcbinfo) == 0) { in_pcbref(inp); INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); @@ -683,7 +683,7 @@ relocked: ("%s: upgrade check ti_locked %d", __func__, ti_locked)); if (ti_locked == TI_RLOCKED) { - if (rw_try_upgrade(&V_tcbinfo.ipi_lock) == 0) { + if (INP_INFO_TRY_UPGRADE(&V_tcbinfo) == 0) { in_pcbref(inp); INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003062124.o26LOBwU041254>