PERFORCE change 118450 for review

Kip Macy kmacy at FreeBSD.org
Fri Apr 20 06:07:24 UTC 2007


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

Change 118450 by kmacy at kmacy_vt-x:opentoe_init on 2007/04/20 06:07:14

	IFC

Affected files ...

.. //depot/projects/opentoe/UPDATING#4 integrate
.. //depot/projects/opentoe/etc/mtree/BSD.include.dist#2 integrate
.. //depot/projects/opentoe/lib/libc/stdio/fputs.3#2 integrate
.. //depot/projects/opentoe/libexec/ftpd/ftpcmd.y#2 integrate
.. //depot/projects/opentoe/libexec/ftpd/ftpd.8#2 integrate
.. //depot/projects/opentoe/libexec/ftpd/ftpd.c#2 integrate
.. //depot/projects/opentoe/share/man/man7/hier.7#4 integrate
.. //depot/projects/opentoe/sys/bsm/audit.h#2 integrate
.. //depot/projects/opentoe/sys/bsm/audit_internal.h#2 integrate
.. //depot/projects/opentoe/sys/bsm/audit_kevents.h#2 integrate
.. //depot/projects/opentoe/sys/bsm/audit_record.h#2 integrate
.. //depot/projects/opentoe/sys/cam/cam_periph.c#3 integrate
.. //depot/projects/opentoe/sys/cam/cam_periph.h#3 integrate
.. //depot/projects/opentoe/sys/cam/cam_sim.c#3 integrate
.. //depot/projects/opentoe/sys/cam/cam_sim.h#3 integrate
.. //depot/projects/opentoe/sys/cam/cam_xpt.c#3 integrate
.. //depot/projects/opentoe/sys/cam/scsi/scsi_da.c#3 integrate
.. //depot/projects/opentoe/sys/cam/scsi/scsi_pt.c#3 integrate
.. //depot/projects/opentoe/sys/cam/scsi/scsi_sa.c#3 integrate
.. //depot/projects/opentoe/sys/compat/opensolaris/kern/opensolaris_vfs.c#2 integrate
.. //depot/projects/opentoe/sys/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c#2 integrate
.. //depot/projects/opentoe/sys/dev/aic7xxx/aic79xx.c#3 integrate
.. //depot/projects/opentoe/sys/dev/aic7xxx/aic79xx.h#3 integrate
.. //depot/projects/opentoe/sys/dev/aic7xxx/aic7xxx.c#3 integrate
.. //depot/projects/opentoe/sys/dev/aic7xxx/aic7xxx.h#3 integrate
.. //depot/projects/opentoe/sys/dev/aic7xxx/aic7xxx_inline.h#2 integrate
.. //depot/projects/opentoe/sys/dev/ath/if_ath.c#2 integrate
.. //depot/projects/opentoe/sys/dev/cxgb/cxgb_sge.c#7 integrate
.. //depot/projects/opentoe/sys/dev/cxgb/sys/uipc_mvec.c#2 integrate
.. //depot/projects/opentoe/sys/dev/hwpmc/hwpmc_logging.c#2 integrate
.. //depot/projects/opentoe/sys/dev/hwpmc/hwpmc_mod.c#2 integrate
.. //depot/projects/opentoe/sys/dev/hwpmc/hwpmc_piv.c#2 integrate
.. //depot/projects/opentoe/sys/dev/ral/rt2560.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/pci/envy24.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/pci/envy24ht.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/pcm/ac97.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/pcm/ac97.h#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/pcm/ac97_patch.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/pcm/ac97_patch.h#2 integrate
.. //depot/projects/opentoe/sys/dev/usb/if_ural.c#3 integrate
.. //depot/projects/opentoe/sys/dev/wi/if_wi.c#2 integrate
.. //depot/projects/opentoe/sys/fs/devfs/devfs_vnops.c#4 integrate
.. //depot/projects/opentoe/sys/i386/i386/bios.c#2 integrate
.. //depot/projects/opentoe/sys/kern/kern_intr.c#2 integrate
.. //depot/projects/opentoe/sys/kern/sched_ule.c#3 integrate
.. //depot/projects/opentoe/sys/kern/subr_witness.c#5 integrate
.. //depot/projects/opentoe/sys/kern/uipc_syscalls.c#4 integrate
.. //depot/projects/opentoe/sys/netinet/sctp_indata.c#6 integrate
.. //depot/projects/opentoe/sys/netinet/sctp_input.c#6 integrate
.. //depot/projects/opentoe/sys/netinet/sctp_lock_bsd.h#2 integrate
.. //depot/projects/opentoe/sys/netinet/sctp_output.c#6 integrate
.. //depot/projects/opentoe/sys/netinet/sctp_pcb.c#6 integrate
.. //depot/projects/opentoe/sys/netinet/sctp_structs.h#5 integrate
.. //depot/projects/opentoe/sys/netinet/sctp_uio.h#5 integrate
.. //depot/projects/opentoe/sys/netinet/sctp_usrreq.c#6 integrate
.. //depot/projects/opentoe/sys/netinet/sctp_var.h#4 integrate
.. //depot/projects/opentoe/sys/netinet/sctputil.c#6 integrate
.. //depot/projects/opentoe/sys/netinet/sctputil.h#4 integrate
.. //depot/projects/opentoe/sys/pci/intpm.c#2 integrate
.. //depot/projects/opentoe/sys/powerpc/powerpc/nexus.c#2 integrate
.. //depot/projects/opentoe/sys/sys/interrupt.h#2 integrate
.. //depot/projects/opentoe/sys/sys/socket.h#2 integrate
.. //depot/projects/opentoe/sys/vm/vm_contig.c#2 integrate
.. //depot/projects/opentoe/sys/vm/vm_param.h#2 integrate
.. //depot/projects/opentoe/tools/regression/sockets/sendfile/Makefile#2 integrate
.. //depot/projects/opentoe/tools/regression/sockets/sendfile/sendfile.c#2 integrate
.. //depot/projects/opentoe/usr.bin/lastcomm/lastcomm.1#3 integrate
.. //depot/projects/opentoe/usr.bin/lastcomm/lastcomm.c#3 integrate
.. //depot/projects/opentoe/usr.bin/tar/test/test-basic.sh#4 integrate
.. //depot/projects/opentoe/usr.bin/tar/util.c#2 integrate

Differences ...

==== //depot/projects/opentoe/UPDATING#4 (text+ko) ====

@@ -21,6 +21,17 @@
 	developers choose to disable these features on build machines
 	to maximize performance.
 
+20070418:
+	A new acct(5) format is imminent.  If you want to maintain access
+	to your accounting files, use the new lastcomm(1) -X functionality to
+	export them into text format, and keep around a copy of the lastcomm
+	binary.  An updated lastcomm(1) program will allow you to import
+	the text files into the new acct(5) format.  The change will also
+	invalidate the condensed summary files /var/account/savacct and
+	/var/account/usracct.  If your process accounting system relies
+	on them, you will need to save their contents in a readable format
+	before the switch.
+
 20070417:
 	The new trunk(4) driver has been renamed to lagg(4) as it better
 	reflects its purpose. ifconfig will need to be recompiled.
@@ -767,4 +778,4 @@
 Contact Warner Losh if you have any questions about your use of
 this document.
 
-$FreeBSD: src/UPDATING,v 1.486 2007/04/17 00:41:59 thompsa Exp $
+$FreeBSD: src/UPDATING,v 1.487 2007/04/18 17:34:59 dds Exp $

==== //depot/projects/opentoe/etc/mtree/BSD.include.dist#2 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/mtree/BSD.include.dist,v 1.111 2007/02/27 04:01:57 mjacob Exp $
+# $FreeBSD: src/etc/mtree/BSD.include.dist,v 1.112 2007/04/18 10:16:42 trhodes Exp $
 #
 # Please see the file src/etc/mtree/README before making changes to this file.
 #
@@ -209,8 +209,6 @@
     ..
     pccard
     ..
-    posix4
-    ..
     protocols
     ..
     readline

==== //depot/projects/opentoe/lib/libc/stdio/fputs.3#2 (text+ko) ====

@@ -30,7 +30,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)fputs.3	8.1 (Berkeley) 6/4/93
-.\" $FreeBSD: src/lib/libc/stdio/fputs.3,v 1.12 2007/01/09 00:28:06 imp Exp $
+.\" $FreeBSD: src/lib/libc/stdio/fputs.3,v 1.13 2007/04/19 09:38:31 phk Exp $
 .\"
 .Dd June 4, 1993
 .Dt FPUTS 3
@@ -66,12 +66,9 @@
 to the stream
 .Dv stdout .
 .Sh RETURN VALUES
-The
+The functions
 .Fn fputs
-function
-returns 0 on success and
-.Dv EOF
-on error;
+and
 .Fn puts
 returns a nonnegative integer on success and
 .Dv EOF

==== //depot/projects/opentoe/libexec/ftpd/ftpcmd.y#2 (text+ko) ====

@@ -47,7 +47,7 @@
 #endif /* not lint */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/libexec/ftpd/ftpcmd.y,v 1.65 2006/06/05 15:50:34 yar Exp $");
+__FBSDID("$FreeBSD: src/libexec/ftpd/ftpcmd.y,v 1.66 2007/04/18 22:43:39 yar Exp $");
 
 #include <sys/param.h>
 #include <sys/socket.h>
@@ -95,6 +95,7 @@
 extern	int usedefault;
 extern  char tmpline[];
 extern	int readonly;
+extern	int assumeutf8;
 extern	int noepsv;
 extern	int noretr;
 extern	int noguestretr;
@@ -135,7 +136,7 @@
 	ABOR	DELE	CWD	LIST	NLST	SITE
 	STAT	HELP	NOOP	MKD	RMD	PWD
 	CDUP	STOU	SMNT	SYST	SIZE	MDTM
-	LPRT	LPSV	EPRT	EPSV
+	LPRT	LPSV	EPRT	EPSV	FEAT
 
 	UMASK	IDLE	CHMOD	MDFIVE
 
@@ -687,6 +688,25 @@
 			if ($4 != NULL)
 				free($4);
 		}
+	| FEAT CRLF
+		{
+			lreply(211, "Extensions supported:");
+#if 0
+			/* XXX these two keywords are non-standard */
+			printf(" EPRT\r\n");
+			if (!noepsv)
+				printf(" EPSV\r\n");
+#endif
+			printf(" MDTM\r\n");
+			printf(" REST STREAM\r\n");
+			printf(" SIZE\r\n");
+			if (assumeutf8) {
+				/* TVFS requires UTF8, see RFC 3659 */
+				printf(" TVFS\r\n");
+				printf(" UTF8\r\n");
+			}
+			reply(211, "End.");
+		}
 	| SYST check_login CRLF
 		{
 			if ($2) {
@@ -1112,6 +1132,7 @@
 	{ "NLST", NLST, OSTR, 1,	"[ <sp> path-name ]" },
 	{ "SITE", SITE, SITECMD, 1,	"site-cmd [ <sp> arguments ]" },
 	{ "SYST", SYST, ARGS, 1,	"(get type of operating system)" },
+	{ "FEAT", FEAT, ARGS, 1,	"(get extended features)" },
 	{ "STAT", STAT, OSTR, 1,	"[ <sp> path-name ]" },
 	{ "HELP", HELP, OSTR, 1,	"[ <sp> <string> ]" },
 	{ "NOOP", NOOP, ARGS, 1,	"" },

==== //depot/projects/opentoe/libexec/ftpd/ftpd.8#2 (text+ko) ====

@@ -30,7 +30,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)ftpd.8	8.2 (Berkeley) 4/19/94
-.\" $FreeBSD: src/libexec/ftpd/ftpd.8,v 1.71 2006/01/29 13:10:38 yar Exp $
+.\" $FreeBSD: src/libexec/ftpd/ftpd.8,v 1.72 2007/04/18 22:43:39 yar Exp $
 .\"
 .Dd January 21, 2006
 .Dt FTPD 8
@@ -40,7 +40,7 @@
 .Nd Internet File Transfer Protocol server
 .Sh SYNOPSIS
 .Nm
-.Op Fl 46ADdEhMmOoRrSUvW
+.Op Fl 468ADdEhMmOoRrSUvW
 .Op Fl l Op Fl l
 .Op Fl a Ar address
 .Op Fl P Ar port
@@ -78,6 +78,21 @@
 is specified, accept connections via
 .Dv AF_INET6
 socket.
+.It Fl 8
+The server is running in transparent UTF-8 mode.
+That is, it just encourages RFC\ 2640 compliant clients to send
+paths encoded in UTF-8 in their commands.
+In particular, the names of files uploaded by such clients will
+have UTF-8 encoding.
+The clients will also assume that server replies and existing file
+names have UTF-8 encoding, too.
+The names of files preloaded to the server should meet this expectation
+for the clients to present the correct file names to their users.
+Own messages of
+.Nm
+are always encoded in ASCII, which in fact is a subset of UTF-8.
+.Pp
+Note that this option does not make the server do any encoding conversion.
 .It Fl A
 Allow only anonymous ftp access.
 .It Fl a
@@ -250,6 +265,7 @@
 .It DELE Ta "delete a file [RW]"
 .It EPRT Ta "specify data connection port, multiprotocol"
 .It EPSV Ta "prepare for server-to-server transfer, multiprotocol"
+.It FEAT Ta "give information on extended features of server"
 .It HELP Ta "give help information"
 .It LIST Ta "give list files in a directory" Pq Dq Li "ls -lgA"
 .It LPRT Ta "specify data connection port, multiprotocol"

==== //depot/projects/opentoe/libexec/ftpd/ftpd.c#2 (text+ko) ====

@@ -46,7 +46,7 @@
 #endif /* not lint */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/libexec/ftpd/ftpd.c,v 1.211 2007/02/09 17:18:39 yar Exp $");
+__FBSDID("$FreeBSD: src/libexec/ftpd/ftpd.c,v 1.212 2007/04/18 22:43:39 yar Exp $");
 
 /*
  * FTP server.
@@ -128,6 +128,7 @@
 int	restricted_data_ports = 1;
 int	paranoid = 1;	  /* be extra careful about security */
 int	anon_only = 0;    /* Only anonymous ftp allowed */
+int	assumeutf8 = 0;   /* Assume that server file names are in UTF-8 */
 int	guest;
 int	dochroot;
 char	*chrootdir;
@@ -308,7 +309,7 @@
 	openlog("ftpd", LOG_PID | LOG_NDELAY, LOG_FTP);
 
 	while ((ch = getopt(argc, argv,
-	                    "46a:AdDEhlmMoOp:P:rRSt:T:u:UvW")) != -1) {
+	                    "468a:AdDEhlmMoOp:P:rRSt:T:u:UvW")) != -1) {
 		switch (ch) {
 		case '4':
 			family = (family == AF_INET6) ? AF_UNSPEC : AF_INET;
@@ -318,6 +319,10 @@
 			family = (family == AF_INET) ? AF_UNSPEC : AF_INET6;
 			break;
 
+		case '8':
+			assumeutf8 = 1;
+			break;
+
 		case 'a':
 			bindname = optarg;
 			break;

==== //depot/projects/opentoe/share/man/man7/hier.7#4 (text+ko) ====

@@ -30,9 +30,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\"	@(#)hier.7	8.1 (Berkeley) 6/5/93
-.\" $FreeBSD: src/share/man/man7/hier.7,v 1.125 2007/04/04 00:14:36 chinsan Exp $
+.\" $FreeBSD: src/share/man/man7/hier.7,v 1.126 2007/04/18 10:16:43 trhodes Exp $
 .\"
-.Dd April 3, 2007
+.Dd April 18, 2007
 .Dt HIER 7
 .Os
 .Sh NAME
@@ -349,10 +349,6 @@
 OpenSSL (Cryptography/SSL toolkit) headers
 .It Pa pccard/
 PC-CARD controllers
-.It Pa posix4/
-POSIX real-time extensions includes;
-see
-.Xr p1003_1b 9
 .It Pa protocols/
 C include files for Berkeley service protocols
 .It Pa readline/

==== //depot/projects/opentoe/sys/bsm/audit.h#2 (text) ====

@@ -30,8 +30,8 @@
  *
  * @APPLE_BSD_LICENSE_HEADER_END@
  *
- * $P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit.h#34 $
- * $FreeBSD: src/sys/bsm/audit.h,v 1.6 2006/09/21 07:27:02 rwatson Exp $
+ * P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit.h#36
+ * $FreeBSD: src/sys/bsm/audit.h,v 1.8 2007/04/17 12:27:08 rwatson Exp $
  */
 
 #ifndef _BSM_AUDIT_H

==== //depot/projects/opentoe/sys/bsm/audit_internal.h#2 (text) ====

@@ -34,8 +34,8 @@
  *
  * @APPLE_BSD_LICENSE_HEADER_END@
  *
- * $P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_internal.h#14 $
- * $FreeBSD: src/sys/bsm/audit_internal.h,v 1.5 2006/09/21 07:27:02 rwatson Exp $
+ * P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_internal.h#16
+ * $FreeBSD: src/sys/bsm/audit_internal.h,v 1.7 2007/04/17 12:27:08 rwatson Exp $
  */
 
 #ifndef _AUDIT_INTERNAL_H

==== //depot/projects/opentoe/sys/bsm/audit_kevents.h#2 (text) ====

@@ -30,8 +30,8 @@
  *
  * @APPLE_BSD_LICENSE_HEADER_END@
  *
- * $P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_kevents.h#29 $
- * $FreeBSD: src/sys/bsm/audit_kevents.h,v 1.9 2006/09/25 12:22:07 rwatson Exp $
+ * P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_kevents.h#32
+ * $FreeBSD: src/sys/bsm/audit_kevents.h,v 1.11 2007/04/17 12:27:08 rwatson Exp $
  */
 
 #ifndef _BSM_AUDIT_KEVENTS_H_
@@ -475,6 +475,28 @@
 #define	AUE_READDIR		43118	/* Linux. */
 #define	AUE_IOPL		43119	/* Linux. */
 #define	AUE_VM86		43120	/* Linux. */
+#define	AUE_MAC_GET_PROC	43121	/* FreeBSD. */
+#define	AUE_MAC_SET_PROC	43122	/* FreeBSD. */
+#define	AUE_MAC_GET_FD		43123	/* FreeBSD. */
+#define	AUE_MAC_GET_FILE	43124	/* FreeBSD. */
+#define	AUE_MAC_SET_FD		43125	/* FreeBSD. */
+#define	AUE_MAC_SET_FILE	43126	/* FreeBSD. */
+#define	AUE_MAC_SYSCALL		43127	/* FreeBSD. */
+#define	AUE_MAC_GET_PID		43128	/* FreeBSD. */
+#define	AUE_MAC_GET_LINK	43129	/* FreeBSD. */
+#define	AUE_MAC_SET_LINK	43130	/* FreeBSD. */
+#define	AUE_MAC_EXECVE		43131	/* FreeBSD. */
+#define	AUE_GETPATH_FROMFD	43132	/* FreeBSD. */
+#define	AUE_GETPATH_FROMADDR	43133	/* FreeBSD. */
+#define	AUE_MQ_OPEN		43134	/* FreeBSD. */
+#define	AUE_MQ_SETATTR		43135	/* FreeBSD. */
+#define	AUE_MQ_TIMEDRECEIVE	43136	/* FreeBSD. */
+#define	AUE_MQ_TIMEDSEND	43137	/* FreeBSD. */
+#define	AUE_MQ_NOTIFY		43138	/* FreeBSD. */
+#define	AUE_MQ_UNLINK		43139	/* FreeBSD. */
+#define	AUE_LISTEN		43140	/* FreeBSD/Darwin/Linux. */
+#define	AUE_MLOCKALL		43141	/* FreeBSD. */
+#define	AUE_MUNLOCKALL		43142	/* FreeBSD. */
 
 /*
  * Darwin BSM uses a number of AUE_O_* definitions, which are aliased to the
@@ -572,16 +594,13 @@
 #define	AUE_GETSOCKOPT		AUE_NULL
 #define	AUE_GTSOCKOPT		AUE_GETSOCKOPT	/* XXX: Typo in Darwin. */
 #define	AUE_ISSETUGID		AUE_NULL
-#define	AUE_LISTEN		AUE_NULL
 #define	AUE_LSTATV		AUE_NULL
 #define	AUE_MADVISE		AUE_NULL
 #define	AUE_MINCORE		AUE_NULL
 #define	AUE_MKCOMPLEX		AUE_NULL
-#define	AUE_MLOCKALL		AUE_NULL
 #define	AUE_MODWATCH		AUE_NULL
 #define	AUE_MSGCL		AUE_NULL
 #define	AUE_MSYNC		AUE_NULL
-#define	AUE_MUNLOCKALL		AUE_NULL
 #define	AUE_PREAD		AUE_NULL
 #define	AUE_PWRITE		AUE_NULL
 #define	AUE_PREADV		AUE_NULL

==== //depot/projects/opentoe/sys/bsm/audit_record.h#2 (text) ====

@@ -30,8 +30,8 @@
  *
  * @APPLE_BSD_LICENSE_HEADER_END@
  *
- * $P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_record.h#21 $
- * $FreeBSD: src/sys/bsm/audit_record.h,v 1.6 2006/09/21 07:27:02 rwatson Exp $
+ * P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_record.h#24
+ * $FreeBSD: src/sys/bsm/audit_record.h,v 1.9 2007/04/17 12:27:08 rwatson Exp $
  */
 
 #ifndef _BSM_AUDIT_RECORD_H_
@@ -86,6 +86,7 @@
 /* XXXRW: Additional X11 tokens not defined? */
 #define	AUT_CMD			0x51
 #define	AUT_EXIT		0x52
+#define	AUT_ZONENAME		0x60
 /* XXXRW: OpenBSM AUT_HOST 0x70? */
 #define	AUT_ARG64		0x71
 #define	AUT_RETURN64		0x72
@@ -247,6 +248,8 @@
 
 token_t	*au_to_header32_tm(int rec_size, au_event_t e_type, au_emod_t e_mod,
 	    struct timeval tm);
+token_t	*au_to_header64_tm(int rec_size, au_event_t e_type, au_emod_t e_mod,
+	    struct timeval tm);
 #if !defined(KERNEL) && !defined(_KERNEL)
 token_t	*au_to_header(int rec_size, au_event_t e_type, au_emod_t e_mod);
 token_t	*au_to_header32(int rec_size, au_event_t e_type, au_emod_t e_mod);
@@ -329,6 +332,7 @@
 token_t	*au_to_text(char *text);
 token_t	*au_to_kevent(struct kevent *kev);
 token_t	*au_to_trailer(int rec_size);
+token_t	*au_to_zonename(char *zonename);
 
 __END_DECLS
 

==== //depot/projects/opentoe/sys/cam/cam_periph.c#3 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.66 2007/04/16 19:42:23 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.68 2007/04/19 23:34:51 scottl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -131,7 +131,6 @@
 	lun_id_t	lun_id;
 	cam_status	status;
 	u_int		init_level;
-	int s;
 
 	init_level = 0;
 	/*
@@ -200,7 +199,6 @@
 	if (status != CAM_REQ_CMP)
 		goto failure;
 
-	s = splsoftcam();
 	cur_periph = TAILQ_FIRST(&(*p_drv)->units);
 	while (cur_periph != NULL
 	    && cur_periph->unit_number < periph->unit_number)
@@ -213,8 +211,6 @@
 		(*p_drv)->generation++;
 	}
 
-	splx(s);
-
 	init_level++;
 
 	status = periph_ctor(periph, arg);
@@ -228,9 +224,7 @@
 		/* Initialized successfully */
 		break;
 	case 3:
-		s = splsoftcam();
 		TAILQ_REMOVE(&(*p_drv)->units, periph, unit_links);
-		splx(s);
 		xpt_remove_periph(periph);
 		/* FALLTHROUGH */
 	case 2:
@@ -258,24 +252,25 @@
 {
 	struct periph_driver **p_drv;
 	struct cam_periph *periph;
-	int s;
 
+	xpt_lock_buses();
 	for (p_drv = periph_drivers; *p_drv != NULL; p_drv++) {
 
 		if (name != NULL && (strcmp((*p_drv)->driver_name, name) != 0))
 			continue;
 
-		s = splsoftcam();
 		TAILQ_FOREACH(periph, &(*p_drv)->units, unit_links) {
 			if (xpt_path_comp(periph->path, path) == 0) {
-				splx(s);
+				xpt_unlock_buses();
 				return(periph);
 			}
 		}
-		splx(s);
-		if (name != NULL)
+		if (name != NULL) {
+			xpt_unlock_buses();
 			return(NULL);
+		}
 	}
+	xpt_unlock_buses();
 	return(NULL);
 }
 
@@ -372,11 +367,9 @@
 {
 	struct	cam_periph *periph;
 	char	*periph_name;
-	int	s;
 	int	i, val, dunit, r;
 	const char *dname, *strval;
 
-	s = splsoftcam();
 	periph_name = p_drv->driver_name;
 	for (;;newunit++) {
 
@@ -422,7 +415,6 @@
 		if (r != 0)
 			break;
 	}
-	splx(s);
 	return (newunit);
 }
 
@@ -480,8 +472,7 @@
 
 	/*
 	 * We only call this routine the first time a peripheral is
-	 * invalidated.  The oninvalidate() routine is always called at
-	 * splsoftcam().
+	 * invalidated.
 	 */
 	if (((periph->flags & CAM_PERIPH_INVALID) == 0)
 	 && (periph->periph_oninval != NULL))
@@ -550,26 +541,6 @@
 }
 
 /*
- * Wait interruptibly for an exclusive lock.
- */
-void
-cam_periph_lock(struct cam_periph *periph)
-{
-
-	mtx_lock(periph->sim->mtx);
-}
-
-/*
- * Unlock and wake up any waiters.
- */
-void
-cam_periph_unlock(struct cam_periph *periph)
-{
-
-	mtx_unlock(periph->sim->mtx);
-}
-
-/*
  * Map user virtual pointers into kernel virtual address space, so we can
  * access the memory.  This won't work on physical pointers, for now it's
  * up to the caller to check for that.  (XXX KDM -- should we do that here
@@ -808,9 +779,7 @@
 {
 	struct mtx *mtx;
 	struct cam_sim *sim;
-	int s;
 
-	s = splsoftcam();
 	sim = xpt_path_sim(ccb->ccb_h.path);
 	if (sim->mtx == &Giant)
 		mtx = NULL;
@@ -819,8 +788,6 @@
 	if ((ccb->ccb_h.pinfo.index != CAM_UNQUEUED_INDEX)
 	 || ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INPROG))
 		msleep(&ccb->ccb_h.cbfcnp, mtx, PRIBIO, "cbwait", 0);
-
-	splx(s);
 }
 
 int
@@ -1225,11 +1192,8 @@
 {
 	struct timeval delta;
 	struct timeval duration_tv;
-	int s;
 
-	s = splclock();
 	microtime(&delta);
-	splx(s);
 	timevalsub(&delta, event_time);
 	duration_tv.tv_sec = duration_ms / 1000;
 	duration_tv.tv_usec = (duration_ms % 1000) * 1000;

==== //depot/projects/opentoe/sys/cam/cam_periph.h#3 (text+ko) ====

@@ -25,13 +25,14 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/cam/cam_periph.h,v 1.17 2007/04/15 08:49:09 scottl Exp $
+ * $FreeBSD: src/sys/cam/cam_periph.h,v 1.18 2007/04/19 22:46:26 scottl Exp $
  */
 
 #ifndef _CAM_CAM_PERIPH_H
 #define _CAM_CAM_PERIPH_H 1
 
 #include <sys/queue.h>
+#include <cam/cam_sim.h>
 
 #ifdef _KERNEL
 
@@ -138,8 +139,6 @@
 			    char *name, cam_periph_type type, struct cam_path *,
 			    ac_callback_t *, ac_code, void *arg);
 struct cam_periph *cam_periph_find(struct cam_path *path, char *name);
-void		cam_periph_lock(struct cam_periph *periph);
-void		cam_periph_unlock(struct cam_periph *periph);
 cam_status	cam_periph_acquire(struct cam_periph *periph);
 void		cam_periph_release(struct cam_periph *periph);
 int		cam_periph_hold(struct cam_periph *periph, int priority);
@@ -177,5 +176,17 @@
 int		cam_periph_error(union ccb *ccb, cam_flags camflags,
 				 u_int32_t sense_flags, union ccb *save_ccb);
 
+static __inline void
+cam_periph_lock(struct cam_periph *periph)
+{
+	mtx_lock(periph->sim->mtx);
+}
+
+static __inline void
+cam_periph_unlock(struct cam_periph *periph)
+{
+	mtx_unlock(periph->sim->mtx);
+}
+
 #endif /* _KERNEL */
 #endif /* _CAM_CAM_PERIPH_H */

==== //depot/projects/opentoe/sys/cam/cam_sim.c#3 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/cam_sim.c,v 1.10 2007/04/15 08:49:09 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/cam_sim.c,v 1.11 2007/04/19 14:28:43 scottl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -95,6 +95,7 @@
 	}
 
 	SLIST_INIT(&sim->ccb_freeq);
+	TAILQ_INIT(&sim->sim_doneq);
 
 	return (sim);
 }

==== //depot/projects/opentoe/sys/cam/cam_sim.h#3 (text+ko) ====

@@ -25,7 +25,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/cam/cam_sim.h,v 1.7 2007/04/15 08:49:09 scottl Exp $
+ * $FreeBSD: src/sys/cam/cam_sim.h,v 1.8 2007/04/19 14:28:43 scottl Exp $
  */
 
 #ifndef _CAM_CAM_SIM_H
@@ -92,6 +92,8 @@
 	const char		*sim_name;
 	void			*softc;
 	struct mtx		*mtx;
+	TAILQ_HEAD(, ccb_hdr)	sim_doneq;
+	TAILQ_ENTRY(cam_sim)	links;
 	u_int32_t		path_id;/* The Boot device may set this to 0? */
 	u_int32_t		unit_number;
 	u_int32_t		bus_id;
@@ -100,6 +102,7 @@
 	u_int32_t		flags;
 #define	CAM_SIM_REL_TIMEOUT_PENDING	0x01
 #define	CAM_SIM_MPSAFE			0x02
+#define CAM_SIM_ON_DONEQ		0x04
 	struct callout		callout;
 	struct cam_devq 	*devq;	/* Device Queue to use for this SIM */
 

==== //depot/projects/opentoe/sys/cam/cam_xpt.c#3 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.178 2007/04/18 04:58:52 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.182 2007/04/19 23:34:51 scottl Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -665,8 +665,9 @@
 
 /* Queues for our software interrupt handler */
 typedef TAILQ_HEAD(cam_isrq, ccb_hdr) cam_isrq_t;
-static cam_isrq_t cam_bioq;
-static struct mtx cam_bioq_lock;
+typedef TAILQ_HEAD(cam_simq, cam_sim) cam_simq_t;
+static cam_simq_t cam_simq;
+static struct mtx cam_simq_lock;
 
 /* Pointers to software interrupt handlers */
 static void *cambio_ih;
@@ -821,6 +822,7 @@
 static void	 xptaction(struct cam_sim *sim, union ccb *work_ccb);
 static void	 xptpoll(struct cam_sim *sim);
 static void	 camisr(void *);
+static void	 camisr_runqueue(void *);
 static dev_match_ret	xptbusmatch(struct dev_match_pattern *patterns,
 				    u_int num_patterns, struct cam_eb *bus);
 static dev_match_ret	xptdevicematch(struct dev_match_pattern *patterns,
@@ -1208,7 +1210,7 @@
 	 * we never return a status of CAM_GDEVLIST_LIST_CHANGED.  It is
 	 * (or rather should be) impossible for the device peripheral driver
 	 * list to change since we look at the whole thing in one pass, and
-	 * we do it with splcam protection.
+	 * we do it with lock protection.
 	 * 
 	 */
 	case CAMGETPASSTHRU: {
@@ -1220,13 +1222,12 @@
 		u_int cur_generation;
 		int base_periph_found;
 		int splbreaknum;
-		int s;
 
 		ccb = (union ccb *)addr;
 		unit = ccb->cgdl.unit_number;
 		name = ccb->cgdl.periph_name;
 		/*
-		 * Every 100 devices, we want to drop our spl protection to
+		 * Every 100 devices, we want to drop our lock protection to
 		 * give the software interrupt handler a chance to run.
 		 * Most systems won't run into this check, but this should
 		 * avoid starvation in the software interrupt handler in
@@ -1248,7 +1249,7 @@
 		}
 
 		/* Keep the list from changing while we traverse it */
-		s = splcam();
+		mtx_lock(&xsoftc.xpt_topo_lock);
 ptstartover:
 		cur_generation = xsoftc.xpt_generation;
 
@@ -1258,7 +1259,7 @@
 				break;
 
 		if (*p_drv == NULL) {
-			splx(s);
+			mtx_unlock(&xsoftc.xpt_topo_lock);
 			ccb->ccb_h.status = CAM_REQ_CMP_ERR;
 			ccb->cgdl.status = CAM_GDEVLIST_ERROR;
 			*ccb->cgdl.periph_name = '\0';
@@ -1280,8 +1281,8 @@
 			if (periph->unit_number == unit) {
 				break;
 			} else if (--splbreaknum == 0) {
-				splx(s);
-				s = splcam();
+				mtx_unlock(&xsoftc.xpt_topo_lock);
+				mtx_lock(&xsoftc.xpt_topo_lock);
 				splbreaknum = 100;
 				if (cur_generation != xsoftc.xpt_generation)
 				       goto ptstartover;
@@ -1370,7 +1371,7 @@
 				       "your kernel config file\n");
 			}
 		}
-		splx(s);
+		mtx_unlock(&xsoftc.xpt_topo_lock);
 		break;
 		}
 	default:
@@ -1426,7 +1427,7 @@
 			TAILQ_REMOVE(&queue, &ccb->ccb_h, sim_links.tqe);
 
 			sim = ccb->ccb_h.path->bus->sim;
-			mtx_lock(sim->mtx);
+			CAM_SIM_LOCK(sim);
 
 			ccb->ccb_h.func_code = XPT_SCAN_BUS;
 			ccb->ccb_h.cbfcnp = xptdone;
@@ -1434,7 +1435,7 @@
 			cam_periph_runccb(ccb, NULL, 0, 0, NULL);
 			xpt_free_path(ccb->ccb_h.path);
 			xpt_free_ccb(ccb);
-			mtx_unlock(sim->mtx);
+			CAM_SIM_UNLOCK(sim);
 		}
 	}
 }
@@ -1472,12 +1473,12 @@
 	cam_status status;
 
 	TAILQ_INIT(&xsoftc.xpt_busses);
-	TAILQ_INIT(&cam_bioq);
+	TAILQ_INIT(&cam_simq);
 	TAILQ_INIT(&xsoftc.ccb_scanq);
 	STAILQ_INIT(&xsoftc.highpowerq);
 	xsoftc.num_highpower = CAM_MAX_HIGHPOWER;
 
-	mtx_init(&cam_bioq_lock, "CAM BIOQ lock", NULL, MTX_DEF);
+	mtx_init(&cam_simq_lock, "CAM SIMQ lock", NULL, MTX_DEF);
 	mtx_init(&xsoftc.xpt_lock, "XPT lock", NULL, MTX_DEF);
 	mtx_init(&xsoftc.xpt_topo_lock, "XPT topology lock", NULL, MTX_DEF);
 
@@ -1551,7 +1552,7 @@
 		printf("xpt_init: failed to create rescan thread\n");
 	}
 	/* Install our software interrupt handlers */
-	swi_add(NULL, "cambio", camisr, &cam_bioq, SWI_CAMBIO, INTR_MPSAFE, &cambio_ih);
+	swi_add(NULL, "cambio", camisr, NULL, SWI_CAMBIO, INTR_MPSAFE, &cambio_ih);
 
 	return (0);
 }
@@ -1590,25 +1591,22 @@
 	status = CAM_REQ_CMP;
 
 	if (device != NULL) {
-		int s;
-
 		/*
 		 * Make room for this peripheral
 		 * so it will fit in the queue
 		 * when it's scheduled to run
 		 */
-		s = splsoftcam();
 		status = camq_resize(&device->drvq,
 				     device->drvq.array_size + 1);
 
 		device->generation++;
 
 		SLIST_INSERT_HEAD(periph_head, periph, periph_links);
-
-		splx(s);
 	}
 
-	atomic_add_int(&xsoftc.xpt_generation, 1);
+	mtx_lock(&xsoftc.xpt_topo_lock);
+	xsoftc.xpt_generation++;
+	mtx_unlock(&xsoftc.xpt_topo_lock);
 
 	return (status);
 }
@@ -1623,24 +1621,21 @@
 	device = periph->path->device;
 
 	if (device != NULL) {
-		int s;
 		struct periph_list *periph_head;
 
 		periph_head = &device->periphs;
 		
 		/* Release the slot for this peripheral */
-		s = splsoftcam();
 		camq_resize(&device->drvq, device->drvq.array_size - 1);
 
 		device->generation++;
 
 		SLIST_REMOVE(periph_head, periph, cam_periph, periph_links);
-
-		splx(s);
 	}
 
-	atomic_add_int(&xsoftc.xpt_generation, 1);
-
+	mtx_lock(&xsoftc.xpt_topo_lock);
+	xsoftc.xpt_generation++;
+	mtx_unlock(&xsoftc.xpt_topo_lock);
 }
 
 
@@ -1653,7 +1648,6 @@
 	u_int	speed;
 	u_int	freq;
 	u_int	mb;
-	int	s;
 
 	mtx_assert(periph->sim->mtx, MA_OWNED);
 
@@ -1662,7 +1656,6 @@
 	 * To ensure that this is printed in one piece,
 	 * mask out CAM interrupts.
 	 */
-	s = splsoftcam();
 	printf("%s%d at %s%d bus %d target %d lun %d\n",
 	       periph->periph_name, periph->unit_number,
 	       path->bus->sim->sim_name,
@@ -1778,7 +1771,6 @@
 	if (announce_string != NULL)
 		printf("%s%d: %s\n", periph->periph_name,
 		       periph->unit_number, announce_string);
-	splx(s);
 }
 
 static dev_match_ret
@@ -2659,9 +2651,9 @@
 		next_bus = TAILQ_NEXT(bus, links);
 
 		mtx_unlock(&xsoftc.xpt_topo_lock);
-		mtx_lock(bus->sim->mtx);
+		CAM_SIM_LOCK(bus->sim);
 		retval = tr_func(bus, arg);
-		mtx_unlock(bus->sim->mtx);
+		CAM_SIM_UNLOCK(bus->sim);
 		if (retval == 0)
 			return(retval);
 		mtx_lock(&xsoftc.xpt_topo_lock);
@@ -2982,13 +2974,11 @@
 void
 xpt_action(union ccb *start_ccb)
 {
-	int iopl;
 
 	CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("xpt_action\n"));
 
 	start_ccb->ccb_h.status = CAM_REQ_INPROG;
 
-	iopl = splsoftcam();
 	switch (start_ccb->ccb_h.func_code) {
 	case XPT_SCSI_IO:
 	{
@@ -3042,18 +3032,15 @@
 	{
 		struct cam_path *path;
 		struct cam_sim *sim;
-		int s;
 		int runq;
 
 		path = start_ccb->ccb_h.path;
-		s = splsoftcam();
 
 		sim = path->bus->sim;
 		if (SIM_DEAD(sim)) {
 			/* The SIM has gone; just execute the CCB directly. */
 			cam_ccbq_send_ccb(&path->device->ccbq, start_ccb);
 			(*(sim->sim_action))(sim, start_ccb);
-			splx(s);
 			break;
 		}
 
@@ -3062,7 +3049,6 @@
 			runq = xpt_schedule_dev_sendq(path->bus, path->device);
 		else
 			runq = 0;
-		splx(s);
 		if (runq != 0)
 			xpt_run_dev_sendq(path->bus);
 		break;
@@ -3109,7 +3095,6 @@
 	case XPT_ABORT:
 	{
 		union ccb* abort_ccb;
-		int s;				
 
 		abort_ccb = start_ccb->cab.abort_ccb;
 		if (XPT_FC_IS_DEV_QUEUED(abort_ccb)) {
@@ -3122,9 +3107,7 @@
 				abort_ccb->ccb_h.status =
 				    CAM_REQ_ABORTED|CAM_DEV_QFRZN;
 				xpt_freeze_devq(abort_ccb->ccb_h.path, 1);

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


More information about the p4-projects mailing list