Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 May 2009 00:21:37 GMT
From:      Marko Zec <zec@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 162139 for review
Message-ID:  <200905160021.n4G0Lb9J095039@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=162139

Change 162139 by zec@zec_tpx32 on 2009/05/16 00:21:31

	Reduce diff against svn.

Affected files ...

.. //depot/projects/vimage-commit2/src/sys/kern/kern_vimage.c#42 edit
.. //depot/projects/vimage-commit2/src/sys/net/if.c#63 edit
.. //depot/projects/vimage-commit2/src/sys/net/if_clone.c#9 edit
.. //depot/projects/vimage-commit2/src/sys/net/if_loop.c#30 edit
.. //depot/projects/vimage-commit2/src/sys/sys/vimage.h#61 edit

Differences ...

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

@@ -150,12 +150,6 @@
 	if (ifp == NULL)
 		return (ENXIO);
 
-#if 0
-	/* Abort if driver did not provide a if_reassign() method */
-	if (ifp->if_reassign == NULL)
-		return (ENODEV);
-#endif
-
 	/*
 	 * Check for naming clashes in target vnet.  Not locked so races
 	 * are possible.
@@ -621,20 +615,10 @@
 vi_alloc(struct vimage *parent, char *name)
 {
 	struct vimage *vip;
+	struct vprocg *vprocg;
 	struct vnet *vnet;
-	struct vprocg *vprocg;
 	struct vnet_modlink *vml;
 
-	/*
-	 * XXX don't forget the locking
-	 */
-
-	/* A brute force check whether there's enough mem for a new vimage */
-	vip = malloc(512*1024, M_VIMAGE, M_NOWAIT); /* XXX aaaargh... */
-	if (vip == NULL)
-		goto vi_alloc_done;
-	free(vip, M_VIMAGE);
-
 	vip = malloc(sizeof(struct vimage), M_VIMAGE, M_NOWAIT | M_ZERO);
 	if (vip == NULL)
 		panic("vi_alloc: malloc failed for vimage \"%s\"\n", name);

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

@@ -53,6 +53,7 @@
 #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>
@@ -765,7 +766,7 @@
 	IFNET_WLOCK();
 	TAILQ_INSERT_TAIL(&V_ifnet, ifp, if_link);
 #ifdef VIMAGE
-	++curvnet->ifcnt;
+	curvnet->ifcnt++;
 #endif
 	IFNET_WUNLOCK();
 
@@ -932,7 +933,7 @@
 		}
 #ifdef VIMAGE
 	if (found)
-		--curvnet->ifcnt;
+		curvnet->ifcnt--;
 #endif
 	IFNET_WUNLOCK();
 	if (!found) {

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

@@ -352,6 +352,7 @@
 
 	KASSERT(LIST_EMPTY(&ifc->ifc_iflist),
 	    ("%s: ifc_iflist not empty", __func__));
+
 	IF_CLONE_LOCK_DESTROY(ifc);
 	free(ifc->ifc_units, M_CLONE);
 }

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

@@ -111,8 +111,6 @@
 struct ifnet *loif;			/* Used externally */
 #endif
 
-IFC_SIMPLE_DECLARE(lo, 1);
-
 #ifdef VIMAGE
 MALLOC_DEFINE(M_LO_CLONER, "lo_cloner", "lo_cloner");
 #endif
@@ -126,6 +124,8 @@
 };
 #endif /* !VIMAGE_GLOBALS */
 
+IFC_SIMPLE_DECLARE(lo, 1);
+
 static void
 lo_clone_destroy(struct ifnet *ifp)
 {

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

@@ -81,6 +81,7 @@
 typedef int vnet_detach_fn(const void *);
 
 #ifndef VIMAGE_GLOBALS
+
 struct vnet_symmap {
 	char	*name;
 	size_t	 offset;
@@ -233,7 +234,6 @@
 #endif
 #endif
  
-
 #define	curvnet curthread->td_vnet
 
 #define	VNET_MAGIC_N 0x3e0d8f29



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905160021.n4G0Lb9J095039>