PERFORCE change 149932 for review
Marko Zec
zec at FreeBSD.org
Wed Sep 17 10:42:14 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=149932
Change 149932 by zec at zec_tpx32 on 2008/09/17 10:41:31
Rename macros
VNET_LIST_REF() -> VNET_LIST_RLOCK()
VNET_LIST_UNREF() -> VNET_LIST_RUNLOCK()
Affected files ...
.. //depot/projects/vimage-commit2/src/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c#4 edit
.. //depot/projects/vimage-commit2/src/sys/net/if.c#15 edit
.. //depot/projects/vimage-commit2/src/sys/net/if_ef.c#7 edit
.. //depot/projects/vimage-commit2/src/sys/netgraph/atm/ng_atm.c#7 edit
.. //depot/projects/vimage-commit2/src/sys/netgraph/ng_gif.c#8 edit
.. //depot/projects/vimage-commit2/src/sys/netinet/igmp.c#9 edit
.. //depot/projects/vimage-commit2/src/sys/netinet/in_pcb.c#14 edit
.. //depot/projects/vimage-commit2/src/sys/netinet/in_rmx.c#11 edit
.. //depot/projects/vimage-commit2/src/sys/netinet/ip_input.c#12 edit
.. //depot/projects/vimage-commit2/src/sys/netinet/tcp_subr.c#13 edit
.. //depot/projects/vimage-commit2/src/sys/netinet/tcp_timer.c#9 edit
.. //depot/projects/vimage-commit2/src/sys/netinet6/frag6.c#10 edit
.. //depot/projects/vimage-commit2/src/sys/sys/vimage.h#17 edit
Differences ...
==== //depot/projects/vimage-commit2/src/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c#4 (text+ko) ====
@@ -239,7 +239,7 @@
/* Register existing TOE interfaces by walking the ifnet chain */
IFNET_RLOCK();
- VNET_LIST_REF();
+ VNET_LIST_RLOCK();
VNET_FOREACH(vnet_iter) {
CURVNET_SET(vnet_iter); /* XXX CURVNET_SET_QUIET() ? */
INIT_VNET_NET(vnet_iter);
@@ -247,7 +247,7 @@
(void)ifaddr_event_handler(NULL, ifp);
CURVNET_RESTORE();
}
- VNET_LIST_UNREF();
+ VNET_LIST_RUNLOCK();
IFNET_RUNLOCK();
return 0;
}
==== //depot/projects/vimage-commit2/src/sys/net/if.c#15 (text+ko) ====
@@ -1533,7 +1533,7 @@
int s = splimp();
IFNET_RLOCK();
- VNET_LIST_REF();
+ VNET_LIST_RLOCK();
VNET_FOREACH(vnet_iter) {
CURVNET_SET(vnet_iter);
INIT_VNET_NET(vnet_iter);
@@ -1545,7 +1545,7 @@
}
CURVNET_RESTORE();
}
- VNET_LIST_UNREF();
+ VNET_LIST_RUNLOCK();
IFNET_RUNLOCK();
splx(s);
timeout(if_slowtimo, (void *)0, hz / IFNET_SLOWHZ);
==== //depot/projects/vimage-commit2/src/sys/net/if_ef.c#7 (text+ko) ====
@@ -490,7 +490,7 @@
struct ef_link *efl = NULL, *efl_temp;
int error = 0, d;
- VNET_LIST_REF();
+ VNET_LIST_RLOCK();
VNET_FOREACH(vnet_iter) {
CURVNET_SET(vnet_iter);
INIT_VNET_NET(vnet_iter);
@@ -528,7 +528,7 @@
IFNET_RUNLOCK();
CURVNET_RESTORE();
}
- VNET_LIST_UNREF();
+ VNET_LIST_RUNLOCK();
if (error) {
if (efl)
SLIST_INSERT_HEAD(&efdev, efl, el_next);
==== //depot/projects/vimage-commit2/src/sys/netgraph/atm/ng_atm.c#7 (text+ko) ====
@@ -1403,7 +1403,7 @@
ng_atm_event_p = ng_atm_event;
/* Create nodes for existing ATM interfaces */
- VNET_LIST_REF();
+ VNET_LIST_RLOCK();
VNET_FOREACH(vnet_iter) {
CURVNET_SET_QUIET(vnet_iter);
INIT_VNET_NET(vnet_iter);
@@ -1413,7 +1413,7 @@
}
CURVNET_RESTORE();
}
- VNET_LIST_UNREF();
+ VNET_LIST_RUNLOCK();
IFNET_RUNLOCK();
break;
@@ -1427,7 +1427,7 @@
ng_atm_input_orphan_p = NULL;
ng_atm_event_p = NULL;
- VNET_LIST_REF();
+ VNET_LIST_RLOCK();
VNET_FOREACH(vnet_iter) {
CURVNET_SET_QUIET(vnet_iter);
INIT_VNET_NET(vnet_iter);
@@ -1437,7 +1437,7 @@
}
CURVNET_RESTORE();
}
- VNET_LIST_UNREF();
+ VNET_LIST_RUNLOCK();
IFNET_RUNLOCK();
break;
==== //depot/projects/vimage-commit2/src/sys/netgraph/ng_gif.c#8 (text+ko) ====
@@ -562,7 +562,7 @@
/* Create nodes for any already-existing gif interfaces */
IFNET_RLOCK();
- VNET_LIST_REF();
+ VNET_LIST_RLOCK();
VNET_FOREACH(vnet_iter) {
CURVNET_SET_QUIET(vnet_iter); /* XXX revisit quiet */
INIT_VNET_NET(curvnet);
@@ -572,7 +572,7 @@
}
CURVNET_RESTORE();
}
- VNET_LIST_UNREF();
+ VNET_LIST_RUNLOCK();
IFNET_RUNLOCK();
break;
==== //depot/projects/vimage-commit2/src/sys/netinet/igmp.c#9 (text+ko) ====
@@ -426,7 +426,7 @@
IN_MULTI_LOCK();
igmp_timers_are_running = 0;
- VNET_LIST_REF();
+ VNET_LIST_RLOCK();
VNET_FOREACH(vnet_iter) {
CURVNET_SET(vnet_iter);
INIT_VNET_INET(vnet_iter);
@@ -444,7 +444,7 @@
}
CURVNET_RESTORE();
}
- VNET_LIST_UNREF();
+ VNET_LIST_RUNLOCK();
IN_MULTI_UNLOCK();
}
@@ -456,7 +456,7 @@
IGMP_PRINTF("[igmp.c,_slowtimo] -- > entering \n");
mtx_lock(&igmp_mtx);
- VNET_LIST_REF();
+ VNET_LIST_RLOCK();
VNET_FOREACH(vnet_iter) {
CURVNET_SET(vnet_iter);
INIT_VNET_INET(vnet_iter);
@@ -469,7 +469,7 @@
}
CURVNET_RESTORE();
}
- VNET_LIST_UNREF();
+ VNET_LIST_RUNLOCK();
mtx_unlock(&igmp_mtx);
IGMP_PRINTF("[igmp.c,_slowtimo] -- > exiting \n");
}
==== //depot/projects/vimage-commit2/src/sys/netinet/in_pcb.c#14 (text+ko) ====
@@ -1215,7 +1215,7 @@
{
VNET_ITERATOR_DECL(vnet_iter);
- VNET_LIST_REF();
+ VNET_LIST_RLOCK();
VNET_FOREACH(vnet_iter) {
CURVNET_SET(vnet_iter); /* XXX appease INVARIANTS here */
INIT_VNET_INET(vnet_iter);
@@ -1228,7 +1228,7 @@
V_ipport_tcplastcount = V_ipport_tcpallocs;
CURVNET_RESTORE();
}
- VNET_LIST_UNREF();
+ VNET_LIST_RUNLOCK();
callout_reset(&ipport_tick_callout, hz, ipport_tick, NULL);
}
==== //depot/projects/vimage-commit2/src/sys/netinet/in_rmx.c#11 (text+ko) ====
@@ -332,7 +332,7 @@
struct rtqk_arg arg;
int fibnum;
- VNET_LIST_REF();
+ VNET_LIST_RLOCK();
VNET_FOREACH(vnet_iter) {
CURVNET_SET(vnet_iter);
INIT_VNET_NET(vnet_iter);
@@ -349,7 +349,7 @@
}
CURVNET_RESTORE();
}
- VNET_LIST_UNREF();
+ VNET_LIST_RUNLOCK();
}
static int _in_rt_was_here;
==== //depot/projects/vimage-commit2/src/sys/netinet/ip_input.c#12 (text+ko) ====
@@ -1096,7 +1096,7 @@
int i;
IPQ_LOCK();
- VNET_LIST_REF();
+ VNET_LIST_RLOCK();
VNET_FOREACH(vnet_iter) {
CURVNET_SET(vnet_iter);
INIT_VNET_INET(vnet_iter);
@@ -1131,7 +1131,7 @@
}
CURVNET_RESTORE();
}
- VNET_LIST_UNREF();
+ VNET_LIST_RUNLOCK();
IPQ_UNLOCK();
}
@@ -1145,7 +1145,7 @@
int i;
IPQ_LOCK();
- VNET_LIST_REF();
+ VNET_LIST_RLOCK();
VNET_FOREACH(vnet_iter) {
CURVNET_SET(vnet_iter);
INIT_VNET_INET(vnet_iter);
@@ -1158,7 +1158,7 @@
}
CURVNET_RESTORE();
}
- VNET_LIST_UNREF();
+ VNET_LIST_RUNLOCK();
IPQ_UNLOCK();
in_rtqdrain();
}
==== //depot/projects/vimage-commit2/src/sys/netinet/tcp_subr.c#13 (text+ko) ====
@@ -852,7 +852,7 @@
if (!do_tcpdrain)
return;
- VNET_LIST_REF();
+ VNET_LIST_RLOCK();
VNET_FOREACH(vnet_iter) {
CURVNET_SET(vnet_iter);
INIT_VNET_INET(vnet_iter);
@@ -889,7 +889,7 @@
INP_INFO_RUNLOCK(&V_tcbinfo);
CURVNET_RESTORE();
}
- VNET_LIST_UNREF();
+ VNET_LIST_RUNLOCK();
}
/*
@@ -1496,7 +1496,7 @@
u_int32_t projected_offset;
ISN_LOCK();
- VNET_LIST_REF();
+ VNET_LIST_RLOCK();
VNET_FOREACH(vnet_iter) {
CURVNET_SET(vnet_iter); /* XXX appease INVARIANTS */
INIT_VNET_INET(curvnet);
@@ -1509,7 +1509,7 @@
V_isn_offset_old = V_isn_offset;
CURVNET_RESTORE();
}
- VNET_LIST_UNREF();
+ VNET_LIST_RUNLOCK();
callout_reset(&isn_callout, hz/100, tcp_isn_tick, NULL);
ISN_UNLOCK();
}
==== //depot/projects/vimage-commit2/src/sys/netinet/tcp_timer.c#9 (text+ko) ====
@@ -126,7 +126,7 @@
{
VNET_ITERATOR_DECL(vnet_iter);
- VNET_LIST_REF();
+ VNET_LIST_RLOCK();
VNET_FOREACH(vnet_iter) {
CURVNET_SET(vnet_iter);
INIT_VNET_INET(vnet_iter);
@@ -136,7 +136,7 @@
INP_INFO_WUNLOCK(&V_tcbinfo);
CURVNET_RESTORE();
}
- VNET_LIST_UNREF();
+ VNET_LIST_RUNLOCK();
}
int tcp_syn_backoff[TCP_MAXRXTSHIFT + 1] =
==== //depot/projects/vimage-commit2/src/sys/netinet6/frag6.c#10 (text+ko) ====
@@ -690,7 +690,7 @@
struct ip6q *q6;
IP6Q_LOCK();
- VNET_LIST_REF();
+ VNET_LIST_RLOCK();
VNET_FOREACH(vnet_iter) {
CURVNET_SET(vnet_iter);
INIT_VNET_INET6(vnet_iter);
@@ -718,7 +718,7 @@
}
CURVNET_RESTORE();
}
- VNET_LIST_UNREF();
+ VNET_LIST_RUNLOCK();
IP6Q_UNLOCK();
#if 0
@@ -748,7 +748,7 @@
if (IP6Q_TRYLOCK() == 0)
return;
- VNET_LIST_REF();
+ VNET_LIST_RLOCK();
VNET_FOREACH(vnet_iter) {
CURVNET_SET(vnet_iter);
INIT_VNET_INET6(vnet_iter);
@@ -759,6 +759,6 @@
}
CURVNET_RESTORE();
}
- VNET_LIST_UNREF();
+ VNET_LIST_RUNLOCK();
IP6Q_UNLOCK();
}
==== //depot/projects/vimage-commit2/src/sys/sys/vimage.h#17 (text+ko) ====
@@ -244,13 +244,6 @@
#define INIT_VPROCG(arg) struct vprocg *vprocg = (arg);
-#define VPROCG_ITERLOOP_BEGIN() \
- struct vprocg *vprocg_iter; \
- LIST_FOREACH(vprocg_iter, &vprocg_head, vprocg_le) { \
-
-#define VPROCG_ITERLOOP_END() \
- } \
-
#define INIT_VCPU(arg) struct vcpu *vcpu = (arg);
#define TD_TO_VIMAGE(td) (td)->td_ucred->cr_vimage
@@ -277,11 +270,9 @@
#define INIT_FROM_VNET(vnet, modindex, modtype, sym)
#define VNET_ITERATOR_DECL(arg)
#define VNET_FOREACH(arg)
-#define VNET_LIST_REF()
-#define VNET_LIST_UNREF()
+#define VNET_LIST_RLOCK()
+#define VNET_LIST_RUNLOCK()
#define INIT_VPROCG(arg)
-#define VPROCG_ITERLOOP_BEGIN()
-#define VPROCG_ITERLOOP_END()
#define INIT_VCPU(arg)
#define TD_TO_VIMAGE(td)
#define TD_TO_VNET(td)
@@ -341,16 +332,18 @@
extern struct cv vnet_list_condvar;
extern struct mtx vcpu_list_mtx;
-#define VNET_LIST_REF() \
+#define VNET_LIST_RLOCK() do { \
mtx_lock(&vnet_list_refc_mtx); \
vnet_list_refc++; \
- mtx_unlock(&vnet_list_refc_mtx);
+ mtx_unlock(&vnet_list_refc_mtx); \
+} while (0)
-#define VNET_LIST_UNREF() \
+#define VNET_LIST_RUNLOCK() do { \
mtx_lock(&vnet_list_refc_mtx); \
vnet_list_refc--; \
mtx_unlock(&vnet_list_refc_mtx); \
- cv_signal(&vnet_list_condvar);
+ cv_signal(&vnet_list_condvar); \
+} while (0)
#define IS_DEFAULT_VIMAGE(arg) ((arg)->vi_id == 0)
#define IS_DEFAULT_VNET(arg) ((arg)->vnet_id == 0)
More information about the p4-projects
mailing list