Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Mar 2004 12:26:06 -0800 (PST)
From:      Warner Losh <imp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 49995 for review
Message-ID:  <200403302026.i2UKQ62H010590@repoman.freebsd.org>

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

Change 49995 by imp@imp_pacopaco on 2004/03/30 12:25:45

	IFC @49980

Affected files ...

.. //depot/projects/power/sys/conf/NOTES#7 integrate
.. //depot/projects/power/sys/conf/files.i386#6 integrate
.. //depot/projects/power/sys/contrib/pf/net/pf.c#2 integrate
.. //depot/projects/power/sys/dev/acpica/acpi.c#11 integrate
.. //depot/projects/power/sys/dev/nge/if_nge.c#6 integrate
.. //depot/projects/power/sys/dev/twa/twa.c#1 branch
.. //depot/projects/power/sys/dev/twa/twa.h#1 branch
.. //depot/projects/power/sys/dev/twa/twa_cam.c#1 branch
.. //depot/projects/power/sys/dev/twa/twa_externs.h#1 branch
.. //depot/projects/power/sys/dev/twa/twa_freebsd.c#1 branch
.. //depot/projects/power/sys/dev/twa/twa_fwimg.c#1 branch
.. //depot/projects/power/sys/dev/twa/twa_globals.c#1 branch
.. //depot/projects/power/sys/dev/twa/twa_includes.h#1 branch
.. //depot/projects/power/sys/dev/twa/twa_ioctl.h#1 branch
.. //depot/projects/power/sys/dev/twa/twa_reg.h#1 branch
.. //depot/projects/power/sys/fs/udf/udf_vfsops.c#3 integrate
.. //depot/projects/power/sys/fs/udf/udf_vnops.c#6 integrate
.. //depot/projects/power/sys/fs/umapfs/umap_vnops.c#2 integrate
.. //depot/projects/power/sys/i386/conf/GENERIC#6 integrate
.. //depot/projects/power/sys/kern/kern_sig.c#9 integrate
.. //depot/projects/power/sys/kern/subr_param.c#3 integrate
.. //depot/projects/power/sys/kern/uipc_usrreq.c#5 integrate
.. //depot/projects/power/sys/kern/vfs_default.c#4 integrate
.. //depot/projects/power/sys/kern/vfs_subr.c#10 integrate
.. //depot/projects/power/sys/libkern/index.c#2 integrate
.. //depot/projects/power/sys/libkern/rindex.c#2 integrate
.. //depot/projects/power/sys/modules/Makefile#8 integrate
.. //depot/projects/power/sys/modules/twa/Makefile#1 branch
.. //depot/projects/power/sys/net/if_tun.c#8 integrate
.. //depot/projects/power/sys/powerpc/powerpc/vm_machdep.c#6 integrate
.. //depot/projects/power/sys/sys/vnode.h#8 integrate

Differences ...

==== //depot/projects/power/sys/conf/NOTES#7 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/NOTES,v 1.1207 2004/03/18 12:22:31 brueffer Exp $
+# $FreeBSD: src/sys/conf/NOTES,v 1.1209 2004/03/30 07:01:56 bde Exp $
 #
 # NOTES -- Lines that can be cut/pasted into kernel and hints configs.
 #
@@ -685,23 +685,25 @@
 
 # One of these is mandatory:
 options 	FFS			#Fast filesystem
-options 	NFSCLIENT		#Network File System
+options 	NFSCLIENT		#Network File System client
 
 # The rest are optional:
 options 	CD9660			#ISO 9660 filesystem
 options 	FDESCFS			#File descriptor filesystem
 options 	HPFS			#OS/2 File system
 options 	MSDOSFS			#MS DOS File System (FAT, FAT32)
-options 	NFSSERVER		#Network File System
+options 	NFSSERVER		#Network File System server
 options 	NTFS			#NT File System
 options 	NULLFS			#NULL filesystem
+# Broken (depends on NCP):
 #options 	NWFS			#NetWare filesystem
 options 	PORTALFS		#Portal filesystem
 options 	PROCFS			#Process filesystem (requires PSEUDOFS)
 options 	PSEUDOFS		#Pseudo-filesystem framework
 options 	SMBFS			#SMB/CIFS filesystem
 options 	UDF			#Universal Disk Format
-options 	UMAPFS			#UID map filesystem
+# Broken (seriously (functionally) broken):
+#options 	UMAPFS			#UID map filesystem
 options 	UNIONFS			#Union filesystem
 # The xFS_ROOT options REQUIRE the associated ``options xFS''
 options 	NFS_ROOT		#NFS usable as root device

==== //depot/projects/power/sys/conf/files.i386#6 (text+ko) ====

@@ -1,7 +1,7 @@
 # This file tells config what files go into building a kernel,
 # files marked standard are always included.
 #
-# $FreeBSD: src/sys/conf/files.i386,v 1.481 2004/03/22 18:00:39 wpaul Exp $
+# $FreeBSD: src/sys/conf/files.i386,v 1.482 2004/03/30 03:45:59 vkashyap Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -170,6 +170,11 @@
 dev/syscons/scvtb.c		optional	sc
 dev/syscons/syscons.c		optional	sc
 dev/syscons/sysmouse.c		optional	sc
+dev/twa/twa.c			optional	twa
+dev/twa/twa_cam.c		optional	twa
+dev/twa/twa_freebsd.c		optional	twa
+dev/twa/twa_fwimg.c		optional	twa
+dev/twa/twa_globals.c		optional	twa
 dev/uart/uart_cpu_i386.c	optional	uart
 geom/geom_bsd.c			standard
 geom/geom_bsd_enc.c		standard

==== //depot/projects/power/sys/contrib/pf/net/pf.c#2 (text+ko) ====

@@ -1,4 +1,4 @@
-/*	$FreeBSD: src/sys/contrib/pf/net/pf.c,v 1.5 2004/03/28 20:04:12 mlaier Exp $	*/
+/*	$FreeBSD: src/sys/contrib/pf/net/pf.c,v 1.6 2004/03/30 18:28:30 mlaier Exp $	*/
 /*	$OpenBSD: pf.c,v 1.389.2.2 2004/03/14 00:13:42 brad Exp $ */
 
 /*
@@ -1142,7 +1142,7 @@
 	/* Change inner protocol port, fix inner protocol checksum. */
 	if (ip != NULL) {
 		u_int16_t	oip = *ip;
-		u_int32_t	opc;
+		u_int32_t	opc = 0;	/* make the compiler happy */
 
 		if (pc != NULL)
 			opc = *pc;
@@ -1222,14 +1222,14 @@
 {
 	struct mbuf	*m;
 	struct m_tag	*mtag;
-	int		 len, tlen;
+	int		 len = 0, tlen;		/* make the compiler happy */
 #ifdef INET
-	struct ip	*h;
+	struct ip	*h = NULL;		/* make the compiler happy */
 #endif /* INET */
 #ifdef INET6
-	struct ip6_hdr	*h6;
+	struct ip6_hdr	*h6 = NULL;		/* make the compiler happy */
 #endif /* INET6 */
-	struct tcphdr	*th;
+	struct tcphdr	*th = NULL;		/* make the compiler happy */
 #ifdef __FreeBSD__
 	struct ip 	*ip;
 #if (__FreeBSD_version < 501114)
@@ -2343,7 +2343,7 @@
 	struct route_in6	 ro6;
 #endif /* INET6 */
 	struct rtentry		*rt = NULL;
-	int			 hlen;
+	int			 hlen = 0;	/* make the compiler happy */
 	u_int16_t		 mss = tcp_mssdflt;
 
 	switch (af) {
@@ -3014,9 +3014,10 @@
 	struct pf_rule		*r, *a = NULL;
 	struct pf_ruleset	*ruleset = NULL;
 	u_short			 reason;
-	u_int16_t		 icmpid;
+	u_int16_t		 icmpid = 0;	/* make the compiler happy */
 	sa_family_t		 af = pd->af;
-	u_int8_t		 icmptype, icmpcode;
+	u_int8_t		 icmptype = 0;	/* make the compiler happy */
+	u_int8_t		 icmpcode = 0;	/* make the compiler happy */
 	int			 state_icmp = 0;
 	struct pf_tag		*pftag = NULL;
 	int			 tag = -1;
@@ -4094,8 +4095,9 @@
     struct mbuf *m, int ipoff, int off, void *h, struct pf_pdesc *pd)
 {
 	struct pf_addr	*saddr = pd->src, *daddr = pd->dst;
-	u_int16_t	 icmpid, *icmpsum;
-	u_int8_t	 icmptype;
+	u_int16_t	 icmpid = 0;		/* make the compiler happy */
+	u_int16_t	*icmpsum = NULL;	/* make the compiler happy */
+	u_int8_t	 icmptype = 0;		/* make the compiler happy */
 	int		 state_icmp = 0, dirndx;
 
 	switch (pd->proto) {
@@ -4216,8 +4218,8 @@
 		struct ip6_hdr	h2_6;
 		int		terminal = 0;
 #endif /* INET6 */
-		int		ipoff2;
-		int		off2;
+		int		ipoff2 = 0;	/* make the compiler happy */
+		int		off2 = 0;	/* make the compiler happy */
 
 		pd2.af = pd->af;
 		switch (pd->af) {
@@ -4961,7 +4963,7 @@
 {
 	struct mbuf		*m0, *m1;
 	struct route		 iproute;
-	struct route		*ro;
+	struct route		*ro = NULL;	/* XXX: was uninitialized */
 	struct sockaddr_in	*dst;
 	struct ip		*ip;
 	struct ifnet		*ifp = NULL;
@@ -5589,7 +5591,7 @@
 {
 	u_short		   action, reason = 0, log = 0;
 	struct mbuf	  *m = *m0;
-	struct ip	  *h;
+	struct ip	  *h = NULL;		/* XXX: was uninitialized */
 	struct pf_rule	  *a = NULL, *r = &pf_default_rule, *tr;
 	struct pf_state	  *s = NULL;
 	struct pf_ruleset *ruleset = NULL;

==== //depot/projects/power/sys/dev/acpica/acpi.c#11 (text+ko) ====

@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.129 2004/03/27 16:26:00 takawata Exp $
+ *	$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.130 2004/03/30 07:35:18 njl Exp $
  */
 
 #include "opt_acpi.h"
@@ -235,14 +235,23 @@
 
 /*
  * Allow override of whether methods execute in parallel or not.
- * Default to serial behavior as this fixes some AE_ALREADY_EXISTS errors
- * and matches the MS interpreter.
+ * Enable this for serial behavior, which fixes "AE_ALREADY_EXISTS"
+ * errors for AML that really can't handle parallel method execution.
+ * It is off by default since this breaks recursive methods and
+ * some IBMs use such code.
  */
-static int acpi_serialize_methods = 1;
+static int acpi_serialize_methods;
 TUNABLE_INT("hw.acpi.serialize_methods", &acpi_serialize_methods);
 
-/* Allow override of whether to support the _OSI method. */
-static int acpi_osi_method;
+/*
+ * Allow override of whether to support the _OSI method.  This allows us
+ * to claim compatibility with various MS OSs without changing the value
+ * we report for _OS.  This is enabled by default since it fixes some
+ * problems with interrupt routing although it can be disabled if it
+ * causes problems.  See the definition of "AcpiGbl_ValidOsiStrings" for
+ * a list of systems we claim.
+ */
+static int acpi_osi_method = 1;
 TUNABLE_INT("hw.acpi.osi_method", &acpi_osi_method);
 
 /*

==== //depot/projects/power/sys/dev/nge/if_nge.c#6 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/nge/if_nge.c,v 1.54 2004/03/17 17:50:38 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/nge/if_nge.c,v 1.55 2004/03/30 10:24:52 ru Exp $");
 
 /*
  * National Semiconductor DP83820/DP83821 gigabit ethernet driver
@@ -1369,7 +1369,7 @@
 		 */
 		if (extsts & NGE_RXEXTSTS_VLANPKT) {
 			VLAN_INPUT_TAG(ifp, m,
-				extsts & NGE_RXEXTSTS_VTCI, continue);
+			    ntohs(extsts & NGE_RXEXTSTS_VTCI), continue);
 		}
 
 		(*ifp->if_input)(ifp, m);
@@ -1692,7 +1692,7 @@
 	mtag = VLAN_OUTPUT_TAG(&sc->arpcom.ac_if, m);
 	if (mtag != NULL) {
 		sc->nge_ldata->nge_tx_list[cur].nge_extsts |=
-			(NGE_TXEXTSTS_VLANPKT|VLAN_TAG_VALUE(mtag));
+		    (NGE_TXEXTSTS_VLANPKT|htons(VLAN_TAG_VALUE(mtag)));
 	}
 
 	sc->nge_ldata->nge_tx_list[cur].nge_mbuf = m_head;

==== //depot/projects/power/sys/fs/udf/udf_vfsops.c#3 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/fs/udf/udf_vfsops.c,v 1.16 2003/11/05 06:56:08 scottl Exp $
+ * $FreeBSD: src/sys/fs/udf/udf_vfsops.c,v 1.17 2004/03/30 05:01:48 scottl Exp $
  */
 
 /* udf_vfsops.c */
@@ -778,6 +778,8 @@
 		 */
 		if ((error = udf_readlblks(udfmp, pms->st_loc[0], pms->st_size,
 		    &bp)) != 0) {
+			if (bp != NULL)
+				brelse(bp);
 			printf("Failed to read Sparing Table at sector %d\n",
 			    pms->st_loc[0]);
 			return (error);

==== //depot/projects/power/sys/fs/udf/udf_vnops.c#6 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/fs/udf/udf_vnops.c,v 1.34 2004/03/03 07:43:34 scottl Exp $
+ * $FreeBSD: src/sys/fs/udf/udf_vnops.c,v 1.35 2004/03/30 05:01:48 scottl Exp $
  */
 
 /* udf_vnops.c */
@@ -416,9 +416,8 @@
 		offset = uio->uio_offset;
 		size = uio->uio_resid;
 		error = udf_readatoffset(node, &size, offset, &bp, &data);
-		if (error)
-			return (error);
-		error = uiomove(data, size, uio);
+		if (error == 0)
+			error = uiomove(data, size, uio);
 		if (bp != NULL)
 			brelse(bp);
 		if (error)
@@ -579,6 +578,8 @@
 		    &ds->bp, &ds->data);
 		if (error) {
 			ds->error = error;
+			if (ds->bp != NULL)
+				brelse(ds->bp);
 			return (NULL);
 		}
 	}
@@ -1051,8 +1052,9 @@
  * offset passed in.  Only read in at most 'size' bytes, and then set 'size'
  * to the number of bytes pointed to.  If 'size' is zero, try to read in a
  * whole extent.
- * XXX 'size' is limited to the logical block size for now due to problems
- * with udf_read()
+ *
+ * Note that *bp may be assigned error or not.
+ *
  */
 static int
 udf_readatoffset(struct udf_node *node, int *size, int offset, struct buf **bp, uint8_t **data)
@@ -1066,6 +1068,7 @@
 
 	udfmp = node->udfmp;
 
+	*bp = NULL;
 	error = udf_bmap_internal(node, offset, &sector, &max_size);
 	if (error == UDF_INVALID_BMAP) {
 		/*
@@ -1075,7 +1078,6 @@
 		fentry = node->fentry;
 		*data = &fentry->data[fentry->l_ea];
 		*size = fentry->l_ad;
-		*bp = NULL;
 		return (0);
 	} else if (error != 0) {
 		return (error);
@@ -1088,6 +1090,7 @@
 
 	if ((error = udf_readlblks(udfmp, sector, *size, bp))) {
 		printf("warning: udf_readlblks returned error %d\n", error);
+		/* note: *bp may be non-NULL */
 		return (error);
 	}
 

==== //depot/projects/power/sys/fs/umapfs/umap_vnops.c#2 (text+ko) ====

@@ -34,7 +34,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)umap_vnops.c	8.6 (Berkeley) 5/22/95
- * $FreeBSD: src/sys/fs/umapfs/umap_vnops.c,v 1.38 2003/03/03 19:15:39 njl Exp $
+ * $FreeBSD: src/sys/fs/umapfs/umap_vnops.c,v 1.39 2004/03/29 22:41:20 peter Exp $
  */
 
 /*
@@ -363,6 +363,15 @@
 	} */ *ap;
 {
 
+	/*
+	 * vop_nolock no longer exists.  I could have pasted the code
+	 * in so that it compiles, but that would be doing our users a
+	 * great disservice.  umapfs is about 5 years behind the nullfs
+	 * code that it is derived from.  The stub locking here guarantees
+	 * a deadlock the moment a VOP_INACTIVE arrives.  There is no point
+	 * pasting the code that makes it compile either, because that just
+	 * makes it Even More Wrong.
+	 */
 	vop_nolock(ap);
 	if ((ap->a_flags & LK_TYPE_MASK) == LK_DRAIN)
 		return (0);

==== //depot/projects/power/sys/i386/conf/GENERIC#6 (text+ko) ====

@@ -16,7 +16,7 @@
 # If you are in doubt as to the purpose or necessity of a line, check first
 # in NOTES.
 #
-# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.398 2004/03/15 00:49:40 obrien Exp $
+# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.399 2004/03/30 03:46:00 vkashyap Exp $
 
 machine		i386
 cpu		I486_CPU
@@ -124,6 +124,7 @@
 device		iir		# Intel Integrated RAID
 device		ips		# IBM (Adaptec) ServeRAID
 device		mly		# Mylex AcceleRAID/eXtremeRAID
+device		twa		# 3ware 9000 series PATA/SATA RAID
 
 # RAID controllers
 device		aac		# Adaptec FSA RAID

==== //depot/projects/power/sys/kern/kern_sig.c#9 (text+ko) ====

@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_sig.c,v 1.273 2004/03/05 22:39:53 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_sig.c,v 1.274 2004/03/29 22:46:54 peter Exp $");
 
 #include "opt_compat.h"
 #include "opt_ktrace.h"
@@ -1875,10 +1875,8 @@
 		mtx_unlock_spin(&sched_lock);
 		goto out;
 		/*
-		 * XXXKSE  What about threads that are waiting on mutexes?
-		 * Shouldn't they abort too?
-		 * No, hopefully mutexes are short lived.. They'll
-		 * eventually hit thread_suspend_check().
+		 * Mutexes are short lived. Threads waiting on them will
+		 * hit thread_suspend_check() soon.
 		 */
 	}  else if (p->p_state == PRS_NORMAL) {
 		if ((p->p_flag & P_TRACED) || (action != SIG_DFL) ||

==== //depot/projects/power/sys/kern/subr_param.c#3 (text+ko) ====

@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/subr_param.c,v 1.62 2004/03/27 19:50:22 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/subr_param.c,v 1.63 2004/03/30 08:00:11 alc Exp $");
 
 #include "opt_param.h"
 #include "opt_maxusers.h"
@@ -181,15 +181,13 @@
 void
 init_param3(long kmempages)
 {
+
 	/*
-	 * Limit pageable pipe memory usage to 5% of the kernel map
-	 * (via pipe_map).  Ensure that all have reasonable floors.
-	 * (See sys_pipe.c for more info.)
+	 * The default for maxpipekva is max(5% of the kernel map, 512KB).
+	 * See sys_pipe.c for more details.
 	 */
 	maxpipekva = (kmempages / 20) * PAGE_SIZE;
-
 	if (maxpipekva < 512 * 1024)
 		maxpipekva = 512 * 1024;
-
 	TUNABLE_INT_FETCH("kern.ipc.maxpipekva", &maxpipekva);
 }

==== //depot/projects/power/sys/kern/uipc_usrreq.c#5 (text+ko) ====

@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/uipc_usrreq.c,v 1.117 2004/03/01 03:14:21 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/uipc_usrreq.c,v 1.118 2004/03/30 02:16:25 rwatson Exp $");
 
 #include "opt_mac.h"
 
@@ -105,7 +105,7 @@
 {
 	struct unpcb *unp = sotounpcb(so);
 
-	if (unp == 0)
+	if (unp == NULL)
 		return (EINVAL);
 	unp_drop(unp, ECONNABORTED);
 	unp_detach(unp);
@@ -118,7 +118,7 @@
 {
 	struct unpcb *unp = sotounpcb(so);
 
-	if (unp == 0)
+	if (unp == NULL)
 		return (EINVAL);
 
 	/*
@@ -126,7 +126,7 @@
 	 * if it was bound and we are still connected
 	 * (our peer may have closed already!).
 	 */
-	if (unp->unp_conn && unp->unp_conn->unp_addr) {
+	if (unp->unp_conn != NULL && unp->unp_conn->unp_addr != NULL) {
 		*nam = sodupsockaddr(
 		    (struct sockaddr *)unp->unp_conn->unp_addr, M_WAITOK);
 	} else {
@@ -141,7 +141,7 @@
 {
 	struct unpcb *unp = sotounpcb(so);
 
-	if (unp != 0)
+	if (unp != NULL)
 		return (EISCONN);
 	return (unp_attach(so));
 }
@@ -151,7 +151,7 @@
 {
 	struct unpcb *unp = sotounpcb(so);
 
-	if (unp == 0)
+	if (unp == NULL)
 		return (EINVAL);
 
 	return (unp_bind(unp, nam, td));
@@ -162,7 +162,7 @@
 {
 	struct unpcb *unp = sotounpcb(so);
 
-	if (unp == 0)
+	if (unp == NULL)
 		return (EINVAL);
 	return (unp_connect(so, nam, curthread));
 }
@@ -172,7 +172,7 @@
 {
 	struct unpcb *unp = sotounpcb(so1);
 
-	if (unp == 0)
+	if (unp == NULL)
 		return (EINVAL);
 
 	return (unp_connect2(so1, so2));
@@ -185,7 +185,7 @@
 {
 	struct unpcb *unp = sotounpcb(so);
 
-	if (unp == 0)
+	if (unp == NULL)
 		return (EINVAL);
 
 	unp_detach(unp);
@@ -197,7 +197,7 @@
 {
 	struct unpcb *unp = sotounpcb(so);
 
-	if (unp == 0)
+	if (unp == NULL)
 		return (EINVAL);
 	unp_disconnect(unp);
 	return (0);
@@ -208,7 +208,7 @@
 {
 	struct unpcb *unp = sotounpcb(so);
 
-	if (unp == 0 || unp->unp_vnode == 0)
+	if (unp == NULL || unp->unp_vnode == NULL)
 		return (EINVAL);
 	return (unp_listen(unp, td));
 }
@@ -218,9 +218,9 @@
 {
 	struct unpcb *unp = sotounpcb(so);
 
-	if (unp == 0)
+	if (unp == NULL)
 		return (EINVAL);
-	if (unp->unp_conn && unp->unp_conn->unp_addr)
+	if (unp->unp_conn != NULL && unp->unp_conn->unp_addr != NULL)
 		*nam = sodupsockaddr(
 		    (struct sockaddr *)unp->unp_conn->unp_addr, M_WAITOK);
 	else {
@@ -242,7 +242,7 @@
 	struct socket *so2;
 	u_long newhiwat;
 
-	if (unp == 0)
+	if (unp == NULL)
 		return (EINVAL);
 	switch (so->so_type) {
 	case SOCK_DGRAM:
@@ -250,7 +250,7 @@
 		/*NOTREACHED*/
 
 	case SOCK_STREAM:
-		if (unp->unp_conn == 0)
+		if (unp->unp_conn == NULL)
 			break;
 		so2 = unp->unp_conn->unp_socket;
 		/*
@@ -284,7 +284,7 @@
 	struct socket *so2;
 	u_long newhiwat;
 
-	if (unp == 0) {
+	if (unp == NULL) {
 		error = EINVAL;
 		goto release;
 	}
@@ -293,7 +293,7 @@
 		goto release;
 	}
 
-	if (control && (error = unp_internalize(&control, td)))
+	if (control != NULL && (error = unp_internalize(&control, td)))
 		goto release;
 
 	switch (so->so_type) {
@@ -301,8 +301,8 @@
 	{
 		struct sockaddr *from;
 
-		if (nam) {
-			if (unp->unp_conn) {
+		if (nam != NULL) {
+			if (unp->unp_conn != NULL) {
 				error = EISCONN;
 				break;
 			}
@@ -310,24 +310,24 @@
 			if (error)
 				break;
 		} else {
-			if (unp->unp_conn == 0) {
+			if (unp->unp_conn == NULL) {
 				error = ENOTCONN;
 				break;
 			}
 		}
 		so2 = unp->unp_conn->unp_socket;
-		if (unp->unp_addr)
+		if (unp->unp_addr != NULL)
 			from = (struct sockaddr *)unp->unp_addr;
 		else
 			from = &sun_noname;
 		if (sbappendaddr(&so2->so_rcv, from, m, control)) {
 			sorwakeup(so2);
-			m = 0;
-			control = 0;
+			m = NULL;
+			control = NULL;
 		} else {
 			error = ENOBUFS;
 		}
-		if (nam)
+		if (nam != NULL)
 			unp_disconnect(unp);
 		break;
 	}
@@ -339,7 +339,7 @@
 		 * if not equal to the peer's address.
 		 */
 		if ((so->so_state & SS_ISCONNECTED) == 0) {
-			if (nam) {
+			if (nam != NULL) {
 				error = unp_connect(so, nam, td);
 				if (error)
 					break;	/* XXX */
@@ -353,7 +353,7 @@
 			error = EPIPE;
 			break;
 		}
-		if (unp->unp_conn == 0)
+		if (unp->unp_conn == NULL)
 			panic("uipc_send connected but no connection?");
 		so2 = unp->unp_conn->unp_socket;
 		/*
@@ -361,9 +361,9 @@
 		 * send buffer hiwater marks to maintain backpressure.
 		 * Wake up readers.
 		 */
-		if (control) {
+		if (control != NULL) {
 			if (sbappendcontrol(&so2->so_rcv, m, control))
-				control = 0;
+				control = NULL;
 		} else {
 			sbappend(&so2->so_rcv, m);
 		}
@@ -376,7 +376,7 @@
 		    newhiwat, RLIM_INFINITY);
 		unp->unp_conn->unp_cc = so2->so_rcv.sb_cc;
 		sorwakeup(so2);
-		m = 0;
+		m = NULL;
 		break;
 
 	default:
@@ -392,13 +392,13 @@
 		unp_shutdown(unp);
 	}
 
-	if (control && error != 0)
+	if (control != NULL && error != 0)
 		unp_dispose(control);
 
 release:
-	if (control)
+	if (control != NULL)
 		m_freem(control);
-	if (m)
+	if (m != NULL)
 		m_freem(m);
 	return (error);
 }
@@ -409,10 +409,10 @@
 	struct unpcb *unp = sotounpcb(so);
 	struct socket *so2;
 
-	if (unp == 0)
+	if (unp == NULL)
 		return (EINVAL);
 	sb->st_blksize = so->so_snd.sb_hiwat;
-	if (so->so_type == SOCK_STREAM && unp->unp_conn != 0) {
+	if (so->so_type == SOCK_STREAM && unp->unp_conn != NULL) {
 		so2 = unp->unp_conn->unp_socket;
 		sb->st_blksize += so2->so_rcv.sb_cc;
 	}
@@ -428,7 +428,7 @@
 {
 	struct unpcb *unp = sotounpcb(so);
 
-	if (unp == 0)
+	if (unp == NULL)
 		return (EINVAL);
 	socantsendmore(so);
 	unp_shutdown(unp);
@@ -440,9 +440,9 @@
 {
 	struct unpcb *unp = sotounpcb(so);
 
-	if (unp == 0)
+	if (unp == NULL)
 		return (EINVAL);
-	if (unp->unp_addr)
+	if (unp->unp_addr != NULL)
 		*nam = sodupsockaddr((struct sockaddr *)unp->unp_addr,
 		    M_WAITOK);
 	else
@@ -570,17 +570,17 @@
 	LIST_REMOVE(unp, unp_link);
 	unp->unp_gencnt = ++unp_gencnt;
 	--unp_count;
-	if (unp->unp_vnode) {
-		unp->unp_vnode->v_socket = 0;
+	if (unp->unp_vnode != NULL) {
+		unp->unp_vnode->v_socket = NULL;
 		vrele(unp->unp_vnode);
-		unp->unp_vnode = 0;
+		unp->unp_vnode = NULL;
 	}
-	if (unp->unp_conn)
+	if (unp->unp_conn != NULL)
 		unp_disconnect(unp);
 	while (!LIST_EMPTY(&unp->unp_refs))
 		unp_drop(LIST_FIRST(&unp->unp_refs), ECONNRESET);
 	soisdisconnected(unp->unp_socket);
-	unp->unp_socket->so_pcb = 0;
+	unp->unp_socket->so_pcb = NULL;
 	if (unp_rights) {
 		/*
 		 * Normally the receive buffer is flushed later,
@@ -592,7 +592,7 @@
 		sorflush(unp->unp_socket);
 		unp_gc();
 	}
-	if (unp->unp_addr)
+	if (unp->unp_addr != NULL)
 		FREE(unp->unp_addr, M_SONAME);
 	uma_zfree(unp_zone, unp);
 }
@@ -709,7 +709,7 @@
 	if (error)
 		goto bad;
 	so2 = vp->v_socket;
-	if (so2 == 0) {
+	if (so2 == NULL) {
 		error = ECONNREFUSED;
 		goto bad;
 	}
@@ -719,14 +719,14 @@
 	}
 	if (so->so_proto->pr_flags & PR_CONNREQUIRED) {
 		if ((so2->so_options & SO_ACCEPTCONN) == 0 ||
-		    (so3 = sonewconn(so2, 0)) == 0) {
+		    (so3 = sonewconn(so2, 0)) == NULL) {
 			error = ECONNREFUSED;
 			goto bad;
 		}
 		unp = sotounpcb(so);
 		unp2 = sotounpcb(so2);
 		unp3 = sotounpcb(so3);
-		if (unp2->unp_addr)
+		if (unp2->unp_addr != NULL)
 			unp3->unp_addr = (struct sockaddr_un *)
 			    sodupsockaddr((struct sockaddr *)unp2->unp_addr,
 			    M_WAITOK);
@@ -802,9 +802,9 @@
 {
 	register struct unpcb *unp2 = unp->unp_conn;
 
-	if (unp2 == 0)
+	if (unp2 == NULL)
 		return;
-	unp->unp_conn = 0;
+	unp->unp_conn = NULL;
 	switch (unp->unp_socket->so_type) {
 
 	case SOCK_DGRAM:
@@ -814,7 +814,7 @@
 
 	case SOCK_STREAM:
 		soisdisconnected(unp->unp_socket);
-		unp2->unp_conn = 0;
+		unp2->unp_conn = NULL;
 		soisdisconnected(unp2->unp_socket);
 		break;
 	}
@@ -846,14 +846,14 @@
 	 * The process of preparing the PCB list is too time-consuming and
 	 * resource-intensive to repeat twice on every request.
 	 */
-	if (req->oldptr == 0) {
+	if (req->oldptr == NULL) {
 		n = unp_count;
 		req->oldidx = 2 * (sizeof *xug)
 			+ (n + n/8) * sizeof(struct xunpcb);
 		return (0);
 	}
 
-	if (req->newptr != 0)
+	if (req->newptr != NULL)
 		return (EPERM);
 
 	/*
@@ -897,10 +897,11 @@
 			 * XXX - need more locking here to protect against
 			 * connect/disconnect races for SMP.
 			 */
-			if (unp->unp_addr)
+			if (unp->unp_addr != NULL)
 				bcopy(unp->unp_addr, &xu->xu_addr,
 				      unp->unp_addr->sun_len);
-			if (unp->unp_conn && unp->unp_conn->unp_addr)
+			if (unp->unp_conn != NULL &&
+			    unp->unp_conn->unp_addr != NULL)
 				bcopy(unp->unp_conn->unp_addr,
 				      &xu->xu_caddr,
 				      unp->unp_conn->unp_addr->sun_len);
@@ -1099,7 +1100,7 @@
 {
 	unp_zone = uma_zcreate("unpcb", sizeof(struct unpcb), NULL, NULL,
 	    NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
-	if (unp_zone == 0)
+	if (unp_zone == NULL)
 		panic("unp_init");
 	uma_zone_set_max(unp_zone, nmbclusters);
 	LIST_INIT(&unp_dhead);
@@ -1395,8 +1396,8 @@
 	 */
 	extra_ref = malloc(nfiles * sizeof(struct file *), M_TEMP, M_WAITOK);
 	sx_slock(&filelist_lock);
-	for (nunref = 0, fp = LIST_FIRST(&filehead), fpp = extra_ref; fp != 0;
-	    fp = nextfp) {
+	for (nunref = 0, fp = LIST_FIRST(&filehead), fpp = extra_ref;
+	    fp != NULL; fp = nextfp) {
 		nextfp = LIST_NEXT(fp, f_list);
 		FILE_LOCK(fp);
 		/*
@@ -1473,7 +1474,7 @@
 	socklen_t clen, datalen;
 	int qfds;
 
-	while (m0) {
+	while (m0 != NULL) {
 		for (m = m0; m; m = m->m_next) {
 			if (m->m_type != MT_CONTROL)
 				continue;

==== //depot/projects/power/sys/kern/vfs_default.c#4 (text+ko) ====

@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/vfs_default.c,v 1.91 2003/11/05 04:30:07 kan Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/vfs_default.c,v 1.92 2004/03/29 22:41:20 peter Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -369,166 +369,6 @@
 }
 
 /*
- * Stubs to use when there is no locking to be done on the underlying object.
- * A minimal shared lock is necessary to ensure that the underlying object
- * is not revoked while an operation is in progress. So, an active shared
- * count is maintained in an auxillary vnode lock structure.
- */
-int
-vop_sharedlock(ap)
-	struct vop_lock_args /* {
-		struct vnode *a_vp;
-		int a_flags;
-		struct thread *a_td;
-	} */ *ap;
-{
-	/*
-	 * This code cannot be used until all the non-locking filesystems
-	 * (notably NFS) are converted to properly lock and release nodes.
-	 * Also, certain vnode operations change the locking state within
-	 * the operation (create, mknod, remove, link, rename, mkdir, rmdir,
-	 * and symlink). Ideally these operations should not change the
-	 * lock state, but should be changed to let the caller of the
-	 * function unlock them. Otherwise all intermediate vnode layers
-	 * (such as union, umapfs, etc) must catch these functions to do
-	 * the necessary locking at their layer. Note that the inactive
-	 * and lookup operations also change their lock state, but this
-	 * cannot be avoided, so these two operations will always need
-	 * to be handled in intermediate layers.
-	 */
-	struct vnode *vp = ap->a_vp;
-	int vnflags, flags = ap->a_flags;
-
-	switch (flags & LK_TYPE_MASK) {
-	case LK_DRAIN:
-		vnflags = LK_DRAIN;
-		break;
-	case LK_EXCLUSIVE:
-#ifdef DEBUG_VFS_LOCKS
-		/*
-		 * Normally, we use shared locks here, but that confuses
-		 * the locking assertions.
-		 */
-		vnflags = LK_EXCLUSIVE;
-		break;
-#endif
-	case LK_SHARED:
-		vnflags = LK_SHARED;
-		break;
-	case LK_UPGRADE:
-	case LK_EXCLUPGRADE:
-	case LK_DOWNGRADE:
-		return (0);
-	case LK_RELEASE:
-	default:
-		panic("vop_sharedlock: bad operation %d", flags & LK_TYPE_MASK);
-	}
-	vnflags |= flags & (LK_INTERLOCK | LK_EXTFLG_MASK);
-#ifndef	DEBUG_LOCKS
-	return (lockmgr(vp->v_vnlock, vnflags, VI_MTX(vp), ap->a_td));
-#else
-	return (debuglockmgr(vp->v_vnlock, vnflags, VI_MTX(vp), ap->a_td,
-	    "vop_sharedlock", vp->filename, vp->line));
-#endif
-}
-
-/*
- * Stubs to use when there is no locking to be done on the underlying object.
- * A minimal shared lock is necessary to ensure that the underlying object
- * is not revoked while an operation is in progress. So, an active shared
- * count is maintained in an auxillary vnode lock structure.
- */
-int
-vop_nolock(ap)
-	struct vop_lock_args /* {
-		struct vnode *a_vp;
-		int a_flags;
-		struct thread *a_td;
-	} */ *ap;
-{
-#ifdef notyet
-	/*
-	 * This code cannot be used until all the non-locking filesystems
-	 * (notably NFS) are converted to properly lock and release nodes.
-	 * Also, certain vnode operations change the locking state within
-	 * the operation (create, mknod, remove, link, rename, mkdir, rmdir,
-	 * and symlink). Ideally these operations should not change the
-	 * lock state, but should be changed to let the caller of the
-	 * function unlock them. Otherwise all intermediate vnode layers
-	 * (such as union, umapfs, etc) must catch these functions to do
-	 * the necessary locking at their layer. Note that the inactive
-	 * and lookup operations also change their lock state, but this
-	 * cannot be avoided, so these two operations will always need
-	 * to be handled in intermediate layers.
-	 */
-	struct vnode *vp = ap->a_vp;
-	int vnflags, flags = ap->a_flags;
-
-	switch (flags & LK_TYPE_MASK) {
-	case LK_DRAIN:
-		vnflags = LK_DRAIN;

>>> TRUNCATED FOR MAIL (1000 lines) <<<



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