Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Jan 2007 11:24:25 GMT
From:      Marko Zec <zec@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 113307 for review
Message-ID:  <200701221124.l0MBOPDx041417@repoman.freebsd.org>

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

Change 113307 by zec@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);
 }



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