PERFORCE change 161724 for review

Marko Zec zec at FreeBSD.org
Thu May 7 14:57:40 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=161724

Change 161724 by zec at zec_tpx32 on 2009/05/07 14:57:32

	Fix several mostly style related problems that I introduced with
	r191816 in svn.
	
	Pointed out by:	bz

Affected files ...

.. //depot/projects/vimage-commit2/src/sys/kern/kern_linker.c#13 edit
.. //depot/projects/vimage-commit2/src/sys/kern/kern_vimage.c#29 edit
.. //depot/projects/vimage-commit2/src/sys/kern/uipc_socket.c#19 edit
.. //depot/projects/vimage-commit2/src/sys/kern/uipc_syscalls.c#6 edit
.. //depot/projects/vimage-commit2/src/sys/net/if.c#53 edit
.. //depot/projects/vimage-commit2/src/sys/netinet/igmp.c#35 edit
.. //depot/projects/vimage-commit2/src/sys/netinet/tcp_hostcache.c#22 edit
.. //depot/projects/vimage-commit2/src/sys/sys/proc.h#15 edit
.. //depot/projects/vimage-commit2/src/sys/sys/vimage.h#54 edit

Differences ...

==== //depot/projects/vimage-commit2/src/sys/kern/kern_linker.c#13 (text+ko) ====

@@ -999,7 +999,7 @@
 #endif
 
 	/*
-	 * It's possible that kldloaded module will attach a new ifnet,
+	 * It is possible that kldloaded module will attach a new ifnet,
 	 * so vnet context must be set when this ocurs.
 	 */
 	CURVNET_SET(TD_TO_VNET(td));

==== //depot/projects/vimage-commit2/src/sys/kern/kern_vimage.c#29 (text+ko) ====

@@ -332,7 +332,11 @@
 	vnet->vnet_magic_n = VNET_MAGIC_N;
 	vip->v_net = vnet;
 
-	/* We MUST clear curvnet in vi_init_done before going SMP. */
+	/*
+	 * We MUST clear curvnet in vi_init_done before going SMP,
+	 * otherwise CURVNET_SET() macros would scream about unnecessary
+	 * curvnet recursions.
+	 */
 	curvnet = LIST_FIRST(&vnet_head);
 #endif
 }
@@ -391,7 +395,7 @@
 #endif
 	VNET_FOREACH(vnet_iter) {
 		db_printf("%p %3d %5d",
-		    vnet_iter, vnet_iter->ifccnt, vnet_iter->sockcnt);
+		    vnet_iter, vnet_iter->ifcnt, vnet_iter->sockcnt);
 		db_vnet_ptr(vnet_iter->mod_data[VNET_MOD_NET]);
 		db_vnet_ptr(vnet_iter->mod_data[VNET_MOD_INET]);
 		db_vnet_ptr(vnet_iter->mod_data[VNET_MOD_INET6]);

==== //depot/projects/vimage-commit2/src/sys/kern/uipc_socket.c#19 (text+ko) ====

@@ -286,7 +286,7 @@
 	so->so_gencnt = ++so_gencnt;
 	++numopensockets;
 #ifdef VIMAGE
-	++vnet->sockcnt;	/* locked with so_global_mtx */
+	++vnet->sockcnt;	/* Locked with so_global_mtx. */
 	so->so_vnet = vnet;
 #endif
 	mtx_unlock(&so_global_mtx);
@@ -1306,7 +1306,7 @@
 
 	CURVNET_SET(so->so_vnet);
 	error = so->so_proto->pr_usrreqs->pru_sosend(so, addr, uio, top,
-		control, flags, td);
+	    control, flags, td);
 	CURVNET_RESTORE();
 	return (error);
 }

==== //depot/projects/vimage-commit2/src/sys/kern/uipc_syscalls.c#6 (text+ko) ====

@@ -63,8 +63,8 @@
 #include <sys/syscallsubr.h>
 #include <sys/sysctl.h>
 #include <sys/uio.h>
+#include <sys/vimage.h>
 #include <sys/vnode.h>
-#include <sys/vimage.h>
 #ifdef KTRACE
 #include <sys/ktrace.h>
 #endif

==== //depot/projects/vimage-commit2/src/sys/net/if.c#53 (text+ko) ====

@@ -53,7 +53,6 @@
 #include <sys/kernel.h>
 #include <sys/lock.h>
 #include <sys/refcount.h>
-#include <sys/module.h>
 #include <sys/rwlock.h>
 #include <sys/sockio.h>
 #include <sys/syslog.h>
@@ -745,7 +744,7 @@
 	IFNET_WLOCK();
 	TAILQ_INSERT_TAIL(&V_ifnet, ifp, if_link);
 #ifdef VIMAGE
-	curvnet->ifccnt++;
+	++curvnet->ifcnt;
 #endif
 	IFNET_WUNLOCK();
 
@@ -903,7 +902,7 @@
 		}
 #ifdef VIMAGE
 	if (found)
-		curvnet->ifccnt--;
+		--curvnet->ifcnt;
 #endif
 	IFNET_WUNLOCK();
 	if (!found)

==== //depot/projects/vimage-commit2/src/sys/netinet/igmp.c#35 (text+ko) ====

@@ -1100,9 +1100,6 @@
 
 	nsrc = ntohs(igmpv3->igmp_numsrc);
 
-	if (!IS_DEFAULT_VNET(curvnet))
-		return (retval);
-
 	/*
 	 * Deal with group-specific queries upfront.
 	 * If any group query is already pending, purge any recorded

==== //depot/projects/vimage-commit2/src/sys/netinet/tcp_hostcache.c#22 (text+ko) ====

@@ -637,7 +637,7 @@
 	CURVNET_SET((struct vnet *) arg);
 	INIT_VNET_INET(curvnet);
 	struct hc_metrics *hc_entry, *hc_next;
-	int all = 0;	/* XXX was: (intptr_t)arg - makes no sense? */
+	int all = 0;
 	int i;
 
 	if (V_tcp_hostcache.purgeall) {

==== //depot/projects/vimage-commit2/src/sys/sys/proc.h#15 (text+ko) ====

@@ -275,8 +275,8 @@
 	struct lpohead	td_lprof[2];	/* (a) lock profiling objects. */
 	struct kdtrace_thread	*td_dtrace; /* (*) DTrace-specific data. */
 	int		td_errno;	/* Error returned by last syscall. */
-	struct vnet	*td_vnet;	/* (*) Effective vnet */
-	const char	*td_vnet_lpush;	/* (*) Debugging vnet push / pop */
+	struct vnet	*td_vnet;	/* (*) Effective vnet. */
+	const char	*td_vnet_lpush;	/* (*) Debugging vnet push / pop. */
 };
 
 struct mtx *thread_lock_block(struct thread *);

==== //depot/projects/vimage-commit2/src/sys/sys/vimage.h#54 (text+ko) ====

@@ -179,7 +179,7 @@
 	LIST_ENTRY(vnet) vnet_le;	/* all vnets list */
 	u_int		 vnet_magic_n;
 	u_int		 vnet_id;
-	u_int		 ifccnt;
+	u_int		 ifcnt;
 	u_int		 sockcnt;
 };
 


More information about the p4-projects mailing list