PERFORCE change 113307 for review

Marko Zec zec at FreeBSD.org
Mon Jan 22 11:24:26 UTC 2007


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

Change 113307 by zec at zec_tca51 on 2007/01/22 11:24:04

	Set / restore curvnetb in vfs_hang_addrlist() - a hack
	to allow NFS exports to work from a system running on a
	kernel compiled with options VIMAGE.

Affected files ...

.. //depot/projects/vimage/src/sys/kern/vfs_export.c#4 edit

Differences ...

==== //depot/projects/vimage/src/sys/kern/vfs_export.c#4 (text+ko) ====

@@ -37,6 +37,8 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD: src/sys/kern/vfs_export.c,v 1.339 2006/12/16 15:50:36 rodrigc Exp $");
 
+#include "opt_vimage.h"
+
 #include <sys/param.h>
 #include <sys/dirent.h>
 #include <sys/domain.h>
@@ -50,6 +52,7 @@
 #include <sys/socket.h>
 #include <sys/systm.h>
 #include <sys/vnode.h>
+#include <sys/vimage.h>
 
 #include <net/radix.h>
 
@@ -129,6 +132,7 @@
 	}
 #endif
 
+	CURVNETB_SET(curthread->td_vimage->v_vnetb); /* XXX MARKO */
 	i = sizeof(struct netcred) + argp->ex_addrlen + argp->ex_masklen;
 	np = (struct netcred *) malloc(i, M_NETADDR, M_WAITOK | M_ZERO);
 	saddr = (struct sockaddr *) (np + 1);
@@ -183,8 +187,10 @@
 	bcopy(argp->ex_anon.cr_groups, np->netc_anon.cr_groups,
 	    sizeof(np->netc_anon.cr_groups));
 	refcount_init(&np->netc_anon.cr_ref, 1);
+	CURVNETB_RESTORE();
 	return (0);
 out:
+	CURVNETB_RESTORE();
 	free(np, M_NETADDR);
 	return (error);
 }


More information about the p4-projects mailing list