PERFORCE change 104234 for review

Robert Watson rwatson at FreeBSD.org
Wed Aug 16 14:25:18 UTC 2006


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

Change 104234 by rwatson at rwatson_zoo on 2006/08/16 14:25:02

	Integrate trustedbsd_mac2: nfsd associate prototype fix.

Affected files ...

.. //depot/projects/trustedbsd/mac2/sys/amd64/amd64/pmap.c#3 integrate
.. //depot/projects/trustedbsd/mac2/sys/compat/svr4/svr4_stream.c#5 integrate
.. //depot/projects/trustedbsd/mac2/sys/dev/usb/usbdevs#3 integrate
.. //depot/projects/trustedbsd/mac2/sys/dev/usb/uscanner.c#2 integrate
.. //depot/projects/trustedbsd/mac2/sys/i386/i386/pmap.c#3 integrate
.. //depot/projects/trustedbsd/mac2/sys/kern/Makefile#2 integrate
.. //depot/projects/trustedbsd/mac2/sys/kern/uipc_syscalls.c#5 integrate
.. //depot/projects/trustedbsd/mac2/sys/kern/uipc_usrreq.c#6 integrate
.. //depot/projects/trustedbsd/mac2/sys/kern/vfs_lookup.c#4 integrate
.. //depot/projects/trustedbsd/mac2/sys/kern/vfs_subr.c#5 integrate
.. //depot/projects/trustedbsd/mac2/sys/netatalk/ddp_usrreq.c#3 integrate
.. //depot/projects/trustedbsd/mac2/sys/security/mac_biba/mac_biba.c#4 integrate
.. //depot/projects/trustedbsd/mac2/sys/sys/mac_policy.h#24 integrate
.. //depot/projects/trustedbsd/mac2/sys/sys/param.h#3 integrate
.. //depot/projects/trustedbsd/mac2/sys/vm/swap_pager.c#4 integrate
.. //depot/projects/trustedbsd/mac2/sys/vm/vm_fault.c#3 integrate
.. //depot/projects/trustedbsd/mac2/sys/vm/vm_page.c#3 integrate

Differences ...

==== //depot/projects/trustedbsd/mac2/sys/amd64/amd64/pmap.c#3 (text+ko) ====

@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.568 2006/08/01 19:06:04 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.569 2006/08/06 06:29:16 alc Exp $");
 
 /*
  *	Manages physical address maps.
@@ -2506,7 +2506,6 @@
 retry:
 		p = vm_page_lookup(object, pindex);
 		if (p != NULL) {
-			vm_page_lock_queues();
 			if (vm_page_sleep_if_busy(p, FALSE, "init4p"))
 				goto retry;
 		} else {
@@ -2525,8 +2524,8 @@
 			p = vm_page_lookup(object, pindex);
 			vm_page_lock_queues();
 			vm_page_wakeup(p);
+			vm_page_unlock_queues();
 		}
-		vm_page_unlock_queues();
 
 		ptepa = VM_PAGE_TO_PHYS(p);
 		if (ptepa & (NBPDR - 1))

==== //depot/projects/trustedbsd/mac2/sys/compat/svr4/svr4_stream.c#5 (text+ko) ====

@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/svr4/svr4_stream.c,v 1.61 2006/07/28 16:56:17 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/svr4/svr4_stream.c,v 1.62 2006/08/05 22:04:21 rwatson Exp $");
 
 #include "opt_compat.h"
 #include "opt_ktrace.h"

==== //depot/projects/trustedbsd/mac2/sys/dev/usb/usbdevs#3 (text+ko) ====

@@ -1,4 +1,4 @@
-$FreeBSD: src/sys/dev/usb/usbdevs,v 1.263 2006/07/24 19:47:00 imp Exp $
+$FreeBSD: src/sys/dev/usb/usbdevs,v 1.264 2006/08/06 12:01:42 bms Exp $
 /* $NetBSD: usbdevs,v 1.392 2004/12/29 08:38:44 imp Exp $ */
 
 /*-
@@ -890,6 +890,7 @@
 product EPSON 1670		0x011f	Perfection 1670 scanner
 product EPSON 1270		0x0120	Perfection 1270 scanner
 product EPSON 2480		0x0121  Perfection 2480 scanner
+product EPSON 3500		0x080e	CX-3500/3600/3650 MFP
 product EPSON RX425		0x080f	Stylus Photo RX425 scanner
 
 /* e-TEK Labs products */

==== //depot/projects/trustedbsd/mac2/sys/dev/usb/uscanner.c#2 (text+ko) ====

@@ -5,7 +5,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/uscanner.c,v 1.71 2006/06/18 17:28:08 netchild Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/uscanner.c,v 1.72 2006/08/06 12:01:42 bms Exp $");
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -213,6 +213,7 @@
  {{ USB_VENDOR_EPSON, USB_PRODUCT_EPSON_GT9700F }, USC_KEEP_OPEN },
  {{ USB_VENDOR_EPSON, USB_PRODUCT_EPSON_GT9300UF }, 0 },
  {{ USB_VENDOR_EPSON, USB_PRODUCT_EPSON_2480 }, 0 },
+ {{ USB_VENDOR_EPSON, USB_PRODUCT_EPSON_3500 }, USC_KEEP_OPEN },
 
   /* UMAX */
  {{ USB_VENDOR_UMAX, USB_PRODUCT_UMAX_ASTRA1220U }, 0 },

==== //depot/projects/trustedbsd/mac2/sys/i386/i386/pmap.c#3 (text+ko) ====

@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/pmap.c,v 1.572 2006/08/01 19:06:05 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/pmap.c,v 1.573 2006/08/06 06:29:16 alc Exp $");
 
 /*
  *	Manages physical address maps.
@@ -2581,7 +2581,6 @@
 retry:
 		p = vm_page_lookup(object, pindex);
 		if (p != NULL) {
-			vm_page_lock_queues();
 			if (vm_page_sleep_if_busy(p, FALSE, "init4p"))
 				goto retry;
 		} else {
@@ -2600,8 +2599,8 @@
 			p = vm_page_lookup(object, pindex);
 			vm_page_lock_queues();
 			vm_page_wakeup(p);
+			vm_page_unlock_queues();
 		}
-		vm_page_unlock_queues();
 
 		ptepa = VM_PAGE_TO_PHYS(p);
 		if (ptepa & (NBPDR - 1))

==== //depot/projects/trustedbsd/mac2/sys/kern/Makefile#2 (text+ko) ====

@@ -1,5 +1,5 @@
 #	@(#)Makefile	8.2 (Berkeley) 3/21/94
-# $FreeBSD: src/sys/kern/Makefile,v 1.12 2005/07/13 20:50:17 jhb Exp $
+# $FreeBSD: src/sys/kern/Makefile,v 1.13 2006/08/05 19:25:14 jb Exp $
 
 # Makefile for kernel tags files, init_sysent, etc.
 
@@ -11,10 +11,11 @@
 sysent:  init_sysent.c syscalls.c ../sys/syscall.h ../sys/syscall.mk \
 ../sys/sysproto.h
 
-init_sysent.c syscalls.c ../sys/syscall.h \
+init_sysent.c syscalls.c systrace_args.c ../sys/syscall.h \
 ../sys/syscall.mk ../sys/sysproto.h: makesyscalls.sh syscalls.master
 	-mv -f init_sysent.c init_sysent.c.bak
 	-mv -f syscalls.c syscalls.c.bak
+	-mv -f systrace_args.c systrace_args.c.bak
 	-mv -f ../sys/syscall.h ../sys/syscall.h.bak
 	-mv -f ../sys/syscall.mk ../sys/syscall.mk.bak
 	-mv -f ../sys/sysproto.h ../sys/sysproto.h.bak

==== //depot/projects/trustedbsd/mac2/sys/kern/uipc_syscalls.c#5 (text+ko) ====

@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/uipc_syscalls.c,v 1.235 2006/08/04 05:53:20 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/uipc_syscalls.c,v 1.236 2006/08/06 01:00:09 alc Exp $");
 
 #include "opt_compat.h"
 #include "opt_ktrace.h"
@@ -2038,14 +2038,14 @@
 				VM_OBJECT_LOCK(obj);
 				goto retry_lookup;
 			}
-		} else {
-			vm_page_lock_queues();
-			if (vm_page_sleep_if_busy(pg, TRUE, "sfpbsy"))
-				goto retry_lookup;
+		} else if (vm_page_sleep_if_busy(pg, TRUE, "sfpbsy"))
+			goto retry_lookup;
+		else {
 			/*
 			 * Wire the page so it does not get ripped out from
 			 * under us.
 			 */
+			vm_page_lock_queues();
 			vm_page_wire(pg);
 			vm_page_unlock_queues();
 		}

==== //depot/projects/trustedbsd/mac2/sys/kern/uipc_usrreq.c#6 (text+ko) ====

@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/uipc_usrreq.c,v 1.184 2006/08/02 14:30:58 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/uipc_usrreq.c,v 1.185 2006/08/06 10:39:21 rwatson Exp $");
 
 #include "opt_mac.h"
 
@@ -800,9 +800,6 @@
 	.pru_sense =		uipc_sense,
 	.pru_shutdown =		uipc_shutdown,
 	.pru_sockaddr =		uipc_sockaddr,
-	.pru_sosend =		sosend_generic,
-	.pru_soreceive =	soreceive_generic,
-	.pru_sopoll =		sopoll_generic,
 	.pru_close =		uipc_close,
 };
 

==== //depot/projects/trustedbsd/mac2/sys/kern/vfs_lookup.c#4 (text+ko) ====

@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/vfs_lookup.c,v 1.91 2006/04/29 07:13:49 kris Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/vfs_lookup.c,v 1.93 2006/08/05 21:40:59 rwatson Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_mac.h"
@@ -88,7 +88,7 @@
     "Enables/Disables shared locks for path name translation");
 
 /*
- * Convert a pathname into a pointer to a locked inode.
+ * Convert a pathname into a pointer to a locked vnode.
  *
  * The FOLLOW flag is set when symbolic links are to be followed
  * when they occur at the end of the name translation process.
@@ -108,12 +108,11 @@
  *	}
  */
 int
-namei(ndp)
-	register struct nameidata *ndp;
+namei(struct nameidata *ndp)
 {
-	register struct filedesc *fdp;	/* pointer to file descriptor state */
-	register char *cp;		/* pointer into pathname argument */
-	register struct vnode *dp;	/* the directory we are searching */
+	struct filedesc *fdp;	/* pointer to file descriptor state */
+	char *cp;		/* pointer into pathname argument */
+	struct vnode *dp;	/* the directory we are searching */
 	struct iovec aiov;		/* uio for reading symbolic links */
 	struct uio auio;
 	int error, linklen;
@@ -343,11 +342,10 @@
  *	    if WANTPARENT set, return unlocked parent in ni_dvp
  */
 int
-lookup(ndp)
-	register struct nameidata *ndp;
+lookup(struct nameidata *ndp)
 {
-	register char *cp;		/* pointer into pathname argument */
-	register struct vnode *dp = 0;	/* the directory we are searching */
+	char *cp;		/* pointer into pathname argument */
+	struct vnode *dp = 0;	/* the directory we are searching */
 	struct vnode *tdp;		/* saved dp */
 	struct mount *mp;		/* mount table entry */
 	int docache;			/* == 0 do not cache last component */
@@ -607,7 +605,7 @@
 		/*
 		 * We return with ni_vp NULL to indicate that the entry
 		 * doesn't currently exist, leaving a pointer to the
-		 * (possibly locked) directory inode in ndp->ni_dvp.
+		 * (possibly locked) directory vnode in ndp->ni_dvp.
 		 */
 		if (cnp->cn_flags & SAVESTART) {
 			ndp->ni_startdir = ndp->ni_dvp;
@@ -766,9 +764,7 @@
  *    Used by lookup to re-aquire things.
  */
 int
-relookup(dvp, vpp, cnp)
-	struct vnode *dvp, **vpp;
-	struct componentname *cnp;
+relookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp)
 {
 	struct thread *td = cnp->cn_thread;
 	struct vnode *dp = 0;		/* the directory we are searching */
@@ -859,7 +855,7 @@
 		/*
 		 * We return with ni_vp NULL to indicate that the entry
 		 * doesn't currently exist, leaving a pointer to the
-		 * (possibly locked) directory inode in ndp->ni_dvp.
+		 * (possibly locked) directory vnode in ndp->ni_dvp.
 		 */
 		return (0);
 	}
@@ -910,9 +906,7 @@
  * Free data allocated by namei(); see namei(9) for details.
  */
 void
-NDFREE(ndp, flags)
-     struct nameidata *ndp;
-     const u_int flags;
+NDFREE(struct nameidata *ndp, const u_int flags)
 {
 	int unlock_dvp;
 	int unlock_vp;

==== //depot/projects/trustedbsd/mac2/sys/kern/vfs_subr.c#5 (text+ko) ====

@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/vfs_subr.c,v 1.678 2006/07/15 06:44:27 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/vfs_subr.c,v 1.679 2006/08/06 10:43:35 rwatson Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mac.h"
@@ -3134,6 +3134,9 @@
  * and optional call-by-reference privused argument allowing vaccess()
  * to indicate to the caller whether privilege was used to satisfy the
  * request (obsoleted).  Returns 0 on success, or an errno on failure.
+ *
+ * The ifdef'd CAPABILITIES version is here for reference, but is not
+ * actually used.
  */
 int
 vaccess(enum vtype type, mode_t file_mode, uid_t file_uid, gid_t file_gid,
@@ -3207,9 +3210,11 @@
 	/*
 	 * Build a capability mask to determine if the set of capabilities
 	 * satisfies the requirements when combined with the granted mask
-	 * from above.
-	 * For each capability, if the capability is required, bitwise
-	 * or the request type onto the cap_granted mask.
+	 * from above.  For each capability, if the capability is required,
+	 * bitwise or the request type onto the cap_granted mask.
+	 *
+	 * Note: This is never actually used, but is here for reference
+	 * purposes.
 	 */
 	cap_granted = 0;
 
@@ -3219,7 +3224,8 @@
 		 * VEXEC requests, instead of CAP_DAC_EXECUTE.
 		 */
 		if ((acc_mode & VEXEC) && ((dac_granted & VEXEC) == 0) &&
-		    !cap_check(cred, NULL, CAP_DAC_READ_SEARCH, SUSER_ALLOWJAIL))
+		    !cap_check(cred, NULL, CAP_DAC_READ_SEARCH,
+		    SUSER_ALLOWJAIL))
 			cap_granted |= VEXEC;
 	} else {
 		if ((acc_mode & VEXEC) && ((dac_granted & VEXEC) == 0) &&

==== //depot/projects/trustedbsd/mac2/sys/netatalk/ddp_usrreq.c#3 (text+ko) ====

@@ -24,7 +24,7 @@
  *	+1-313-764-2278
  *	netatalk at umich.edu
  *
- * $FreeBSD: src/sys/netatalk/ddp_usrreq.c,v 1.51 2006/07/21 17:11:13 rwatson Exp $
+ * $FreeBSD: src/sys/netatalk/ddp_usrreq.c,v 1.52 2006/08/05 14:14:34 rwatson Exp $
  */
 
 #include <sys/param.h>
@@ -217,6 +217,7 @@
 	DDP_LOCK(ddp);
 	at_pcbdisconnect(ddp);
 	DDP_UNLOCK(ddp);
+	soisdisconnected(so);
 }
 
 static void
@@ -230,6 +231,7 @@
 	DDP_LOCK(ddp);
 	at_pcbdisconnect(ddp);
 	DDP_UNLOCK(ddp);
+	soisdisconnected(so);
 }
 
 void 

==== //depot/projects/trustedbsd/mac2/sys/security/mac_biba/mac_biba.c#4 (text+ko) ====

@@ -35,7 +35,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/security/mac_biba/mac_biba.c,v 1.92 2006/07/10 19:13:32 csjp Exp $
+ * $FreeBSD: src/sys/security/mac_biba/mac_biba.c,v 1.93 2006/08/06 16:56:15 rwatson Exp $
  */
 
 /*
@@ -3022,7 +3022,7 @@
 	return (0);
 }
 
-static int
+static void
 mac_biba_associate_nfsd_label(struct ucred *cred)
 {
 	struct mac_biba *label;
@@ -3031,7 +3031,6 @@
 	mac_biba_set_effective(label, MAC_BIBA_TYPE_LOW, 0, NULL);
 	mac_biba_set_range(label, MAC_BIBA_TYPE_LOW, 0, NULL,
 	    MAC_BIBA_TYPE_HIGH, 0, NULL);
-	return (0);
 }
 
 static struct mac_policy_ops mac_biba_ops =

==== //depot/projects/trustedbsd/mac2/sys/sys/mac_policy.h#24 (text+ko) ====

@@ -35,7 +35,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/sys/mac_policy.h,v 1.72 2006/04/26 14:18:55 rwatson Exp $
+ * $FreeBSD: src/sys/sys/mac_policy.h,v 1.73 2006/08/06 16:56:15 rwatson Exp $
  */
 /*
  * Kernel interface for MAC policy modules.
@@ -661,6 +661,7 @@
 typedef int	(*mpo_vnode_check_write_t)(struct ucred *active_cred,
 		    struct ucred *file_cred, struct vnode *vp,
 		    struct label *label);
+typedef void	(*mpo_associate_nfsd_label_t)(struct ucred *cred);
 
 struct mac_policy_ops {
 	mpo_policy_destroy_t				mpo_policy_destroy;

==== //depot/projects/trustedbsd/mac2/sys/sys/param.h#3 (text+ko) ====

@@ -32,7 +32,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)param.h	8.3 (Berkeley) 4/4/95
- * $FreeBSD: src/sys/sys/param.h,v 1.269 2006/07/29 19:44:07 simon Exp $
+ * $FreeBSD: src/sys/sys/param.h,v 1.270 2006/08/05 20:35:11 jb Exp $
  */
 
 #ifndef _SYS_PARAM_H_
@@ -331,4 +331,20 @@
 #define ctodb(db)			/* calculates pages to devblks */ \
 	((db) << (PAGE_SHIFT - DEV_BSHIFT))
 
+/*
+ * Solaris compatibility definitions.
+ */
+#ifdef _SOLARIS_C_SOURCE
+#define	PAGESIZE	PAGE_SIZE
+
+/*
+ * The OpenSolaris version is set according to the version last imported
+ * from http://dlc.sun.com/osol/on/downloads/current/. In FreeBSD header
+ * files it can be used to detemine the level of compatibility that the
+ * FreeBSD headers provide to OpenSolaris code. Perhaps one day there
+ * will be a really, really Single Unix Specification.
+ */
+#define __OpenSolaris_version 20060731
+#endif
+
 #endif	/* _SYS_PARAM_H_ */

==== //depot/projects/trustedbsd/mac2/sys/vm/swap_pager.c#4 (text+ko) ====

@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/vm/swap_pager.c,v 1.280 2006/08/03 23:56:11 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/vm/swap_pager.c,v 1.281 2006/08/05 19:07:07 alc Exp $");
 
 #include "opt_mac.h"
 #include "opt_swap.h"
@@ -1424,11 +1424,6 @@
 				 * NOTE: for reads, m->dirty will probably
 				 * be overridden by the original caller of
 				 * getpages so don't play cute tricks here.
-				 *
-				 * XXX IT IS NOT LEGAL TO FREE THE PAGE HERE
-				 * AS THIS MESSES WITH object->memq, and it is
-				 * not legal to mess with object->memq from an
-				 * interrupt.
 				 */
 				m->valid = 0;
 				if (i != bp->b_pager.pg_reqpage)

==== //depot/projects/trustedbsd/mac2/sys/vm/vm_fault.c#3 (text+ko) ====

@@ -72,7 +72,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/vm/vm_fault.c,v 1.217 2006/07/21 23:22:49 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/vm/vm_fault.c,v 1.218 2006/08/06 00:17:17 alc Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -389,10 +389,8 @@
 				VM_OBJECT_LOCK(fs.object);
 				if (fs.m == vm_page_lookup(fs.object,
 				    fs.pindex)) {
-					vm_page_lock_queues();
-					if (!vm_page_sleep_if_busy(fs.m, TRUE,
-					    "vmpfw"))
-						vm_page_unlock_queues();
+					vm_page_sleep_if_busy(fs.m, TRUE,
+					    "vmpfw");
 				}
 				vm_object_pip_wakeup(fs.object);
 				VM_OBJECT_UNLOCK(fs.object);

==== //depot/projects/trustedbsd/mac2/sys/vm/vm_page.c#3 (text+ko) ====

@@ -97,7 +97,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/vm/vm_page.c,v 1.320 2006/08/03 23:56:11 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/vm/vm_page.c,v 1.321 2006/08/06 00:15:40 alc Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -496,9 +496,10 @@
 vm_page_sleep_if_busy(vm_page_t m, int also_m_busy, const char *msg)
 {
 
-	mtx_assert(&vm_page_queue_mtx, MA_OWNED);
 	VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED);
 	if ((m->flags & PG_BUSY) || (also_m_busy && m->busy)) {
+		if (!mtx_owned(&vm_page_queue_mtx))
+			vm_page_lock_queues();
 		vm_page_flag_set(m, PG_WANTED | PG_REFERENCED);
 		vm_page_unlock_queues();
 


More information about the trustedbsd-cvs mailing list