Date: Fri, 3 Oct 2003 09:20:10 -0700 (PDT) From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 39089 for review Message-ID: <200310031620.h93GKAbJ088093@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=39089 Change 39089 by sam@sam_ebb on 2003/10/03 09:20:07 move locking #defines under #ifdef _KERNEL Affected files ... .. //depot/projects/netperf/sys/netinet/in_pcb.h#5 edit Differences ... ==== //depot/projects/netperf/sys/netinet/in_pcb.h#5 (text+ko) ==== @@ -248,19 +248,6 @@ struct mtx ipi_mtx; }; -#define INP_LOCK_INIT(inp, d) \ - mtx_init(&(inp)->inp_mtx, (d), NULL, MTX_DEF | MTX_RECURSE | MTX_DUPOK) -#define INP_LOCK_DESTROY(inp) mtx_destroy(&(inp)->inp_mtx) -#define INP_LOCK(inp) mtx_lock(&(inp)->inp_mtx) -#define INP_UNLOCK(inp) mtx_unlock(&(inp)->inp_mtx) - -#define INP_INFO_LOCK_INIT(ipi, d) \ - mtx_init(&(ipi)->ipi_mtx, (d), NULL, MTX_DEF | MTX_RECURSE) -#define INP_INFO_RLOCK(ipi) mtx_lock(&(ipi)->ipi_mtx) -#define INP_INFO_WLOCK(ipi) mtx_lock(&(ipi)->ipi_mtx) -#define INP_INFO_RUNLOCK(ipi) mtx_unlock(&(ipi)->ipi_mtx) -#define INP_INFO_WUNLOCK(ipi) mtx_unlock(&(ipi)->ipi_mtx) - #define INP_PCBHASH(faddr, lport, fport, mask) \ (((faddr) ^ ((faddr) >> 16) ^ ntohs((lport) ^ (fport))) & (mask)) #define INP_PCBPORTHASH(lport, mask) \ @@ -319,6 +306,19 @@ #define INP_CHECK_SOCKAF(so, af) (INP_SOCKAF(so) == af) #ifdef _KERNEL +#define INP_LOCK_INIT(inp, d) \ + mtx_init(&(inp)->inp_mtx, (d), NULL, MTX_DEF | MTX_RECURSE | MTX_DUPOK) +#define INP_LOCK_DESTROY(inp) mtx_destroy(&(inp)->inp_mtx) +#define INP_LOCK(inp) mtx_lock(&(inp)->inp_mtx) +#define INP_UNLOCK(inp) mtx_unlock(&(inp)->inp_mtx) + +#define INP_INFO_LOCK_INIT(ipi, d) \ + mtx_init(&(ipi)->ipi_mtx, (d), NULL, MTX_DEF | MTX_RECURSE) +#define INP_INFO_RLOCK(ipi) mtx_lock(&(ipi)->ipi_mtx) +#define INP_INFO_WLOCK(ipi) mtx_lock(&(ipi)->ipi_mtx) +#define INP_INFO_RUNLOCK(ipi) mtx_unlock(&(ipi)->ipi_mtx) +#define INP_INFO_WUNLOCK(ipi) mtx_unlock(&(ipi)->ipi_mtx) + extern int ipport_lowfirstauto; extern int ipport_lowlastauto; extern int ipport_firstauto;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200310031620.h93GKAbJ088093>