PERFORCE change 156745 for review

Nathan Whitehorn nwhitehorn at FreeBSD.org
Tue Jan 27 07:07:57 PST 2009


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

Change 156745 by nwhitehorn at nwhitehorn_trantor on 2009/01/27 15:07:20

	IFC to unbreak the build.

Affected files ...

.. //depot/projects/ppc-g5/bin/chmod/chmod.1#3 integrate
.. //depot/projects/ppc-g5/etc/defaults/rc.conf#6 integrate
.. //depot/projects/ppc-g5/etc/devd.conf#4 integrate
.. //depot/projects/ppc-g5/etc/rc.d/jail#3 integrate
.. //depot/projects/ppc-g5/include/paths.h#2 integrate
.. //depot/projects/ppc-g5/lib/libarchive/archive_write_disk.c#8 integrate
.. //depot/projects/ppc-g5/lib/libarchive/test/Makefile#7 integrate
.. //depot/projects/ppc-g5/lib/libarchive/test/test_write_disk_sparse.c#1 branch
.. //depot/projects/ppc-g5/lib/libc/string/strlen.c#2 integrate
.. //depot/projects/ppc-g5/lib/libpmc/libpmc.c#5 integrate
.. //depot/projects/ppc-g5/sbin/fsck_ffs/fsutil.c#3 integrate
.. //depot/projects/ppc-g5/sbin/ipfw/Makefile#2 integrate
.. //depot/projects/ppc-g5/sbin/ipfw/dummynet.c#1 branch
.. //depot/projects/ppc-g5/sbin/ipfw/ipfw2.c#7 integrate
.. //depot/projects/ppc-g5/sbin/ipfw/ipfw2.h#1 branch
.. //depot/projects/ppc-g5/sbin/ipfw/ipv6.c#1 branch
.. //depot/projects/ppc-g5/sbin/ipfw/main.c#1 branch
.. //depot/projects/ppc-g5/sbin/ipfw/nat.c#1 branch
.. //depot/projects/ppc-g5/share/man/man4/iic.4#2 integrate
.. //depot/projects/ppc-g5/share/man/man4/man4.powerpc/Makefile#4 integrate
.. //depot/projects/ppc-g5/share/man/man5/rc.conf.5#4 integrate
.. //depot/projects/ppc-g5/share/man/man7/tuning.7#3 integrate
.. //depot/projects/ppc-g5/share/man/man9/kthread.9#2 integrate
.. //depot/projects/ppc-g5/sys/cam/cam_periph.c#4 integrate
.. //depot/projects/ppc-g5/sys/conf/kmod.mk#4 integrate
.. //depot/projects/ppc-g5/sys/dev/hwpmc/hwpmc_core.c#3 integrate
.. //depot/projects/ppc-g5/sys/dev/hwpmc/hwpmc_intel.c#3 integrate
.. //depot/projects/ppc-g5/sys/dev/hwpmc/pmc_events.h#5 integrate
.. //depot/projects/ppc-g5/sys/dev/iicbus/iic.c#3 integrate
.. //depot/projects/ppc-g5/sys/dev/iicbus/iic.h#2 integrate
.. //depot/projects/ppc-g5/sys/dev/ppbus/lpt.c#6 integrate
.. //depot/projects/ppc-g5/sys/dev/ppbus/ppbconf.c#6 integrate
.. //depot/projects/ppc-g5/sys/dev/puc/pucdata.c#5 integrate
.. //depot/projects/ppc-g5/sys/dev/sound/macio/aoa.c#2 integrate
.. //depot/projects/ppc-g5/sys/dev/sound/macio/aoa.h#2 integrate
.. //depot/projects/ppc-g5/sys/dev/sound/macio/davbus.c#2 integrate
.. //depot/projects/ppc-g5/sys/dev/sound/macio/i2s.c#2 integrate
.. //depot/projects/ppc-g5/sys/dev/sound/pci/hda/hdac.c#11 integrate
.. //depot/projects/ppc-g5/sys/dev/usb/usbdevs#11 integrate
.. //depot/projects/ppc-g5/sys/dev/usb2/bluetooth/ng_ubt2.c#5 integrate
.. //depot/projects/ppc-g5/sys/dev/usb2/bluetooth/ng_ubt2_var.h#3 integrate
.. //depot/projects/ppc-g5/sys/dev/usb2/controller/uhci2.c#7 integrate
.. //depot/projects/ppc-g5/sys/dev/usb2/controller/usb2_controller.h#4 integrate
.. //depot/projects/ppc-g5/sys/dev/usb2/core/usb2_hub.c#7 integrate
.. //depot/projects/ppc-g5/sys/dev/usb2/include/usb2_devid.h#6 integrate
.. //depot/projects/ppc-g5/sys/dev/usb2/include/usb2_devtable.h#6 integrate
.. //depot/projects/ppc-g5/sys/dev/usb2/include/usb2_ioctl.h#4 integrate
.. //depot/projects/ppc-g5/sys/dev/usb2/quirk/usb2_quirk.c#4 integrate
.. //depot/projects/ppc-g5/sys/dev/usb2/serial/u3g2.c#4 integrate
.. //depot/projects/ppc-g5/sys/dev/usb2/storage/umass2.c#6 integrate
.. //depot/projects/ppc-g5/sys/fs/fifofs/fifo_vnops.c#3 integrate
.. //depot/projects/ppc-g5/sys/kern/subr_smp.c#4 integrate
.. //depot/projects/ppc-g5/sys/kern/tty.c#10 integrate
.. //depot/projects/ppc-g5/sys/sys/pmc.h#7 integrate
.. //depot/projects/ppc-g5/usr.sbin/Makefile#8 integrate
.. //depot/projects/ppc-g5/usr.sbin/config/config.8#2 integrate
.. //depot/projects/ppc-g5/usr.sbin/i2c/Makefile#1 branch
.. //depot/projects/ppc-g5/usr.sbin/i2c/i2c.8#1 branch
.. //depot/projects/ppc-g5/usr.sbin/i2c/i2c.c#1 branch

Differences ...

==== //depot/projects/ppc-g5/bin/chmod/chmod.1#3 (text+ko) ====

@@ -30,9 +30,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\"	@(#)chmod.1	8.4 (Berkeley) 3/31/94
-.\" $FreeBSD: src/bin/chmod/chmod.1,v 1.41 2009/01/23 11:39:00 trhodes Exp $
+.\" $FreeBSD: src/bin/chmod/chmod.1,v 1.42 2009/01/26 18:14:21 trhodes Exp $
 .\"
-.Dd January 23, 2009
+.Dd January 26, 2009
 .Dt CHMOD 1
 .Os
 .Sh NAME
@@ -347,5 +347,4 @@
 .Sh BUGS
 There is no
 .Ar perm
-option for the naughty bits which are ``S'' and
-``T'' respectively.
+option for the naughty bits of a horse.

==== //depot/projects/ppc-g5/etc/defaults/rc.conf#6 (text+ko) ====

@@ -15,7 +15,7 @@
 # For a more detailed explanation of all the rc.conf variables, please
 # refer to the rc.conf(5) manual page.
 #
-# $FreeBSD: src/etc/defaults/rc.conf,v 1.348 2009/01/08 23:27:59 keramida Exp $
+# $FreeBSD: src/etc/defaults/rc.conf,v 1.349 2009/01/26 12:59:11 bz Exp $
 
 ##############################################################
 ###  Important initial Boot-time options  ####################
@@ -617,14 +617,16 @@
 # each jail, specified in jail_list, with the following variables.
 # NOTES:
 # - replace 'example' with the jail's name.
-# - except rootdir, hostname and ip, all of the following variables may be made
-#   global jail variables if you don't specify a jail name (ie. jail_interface).
+# - except rootdir, hostname, ip and the _multi<n> addresses,
+#   all of the following variables may be made global jail variables
+#   if you don't specify a jail name (ie. jail_interface, jail_devfs_ruleset).
 #
 #jail_example_rootdir="/usr/jail/default"	# Jail's root directory
 #jail_example_hostname="default.domain.com"	# Jail's hostname
-#jail_example_ip="192.0.2.10"			# Jail's IP number
-#jail_example_interface=""			# Interface to create the IP alias on
-#jail_example_fib="0"				# routing table for setfib(1) 
+#jail_example_interface=""			# Jail's interface variable to create IP aliases on
+#jail_example_fib="0"				# Routing table for setfib(1) 
+#jail_example_ip="192.0.2.10,2001:db8::17"	# Jail's primary IPv4 and IPv6 address
+#jail_example_ip_multi0="2001:db8::10"		#  and another IPv6 address
 #jail_example_exec_start="/bin/sh /etc/rc"		# command to execute in jail for starting
 #jail_example_exec_afterstart0="/bin/sh command"	# command to execute after the one for 
 							# starting the jail. More than one can be

==== //depot/projects/ppc-g5/etc/devd.conf#4 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/devd.conf,v 1.47 2008/12/23 15:47:31 thompsa Exp $
+# $FreeBSD: src/etc/devd.conf,v 1.48 2009/01/26 23:05:50 sam Exp $
 #
 # Refer to devd.conf(5) and devd(8) man pages for the details on how to
 # run and configure devd.
@@ -31,18 +31,17 @@
 # Configure the interface on attach.  Due to a historical accident, this
 # script is called pccard_ether.
 #
+# NB: DETACH events are ignored; the kernel should handle all cleanup
+#     (routes, arp cache) if you need to do something beware of races
+#     against immediate create of a device w/ the same name; e.g.
+#	ifconfig bridge0 destroy; ifconfig bridge0 create
+#
 notify 0 {
 	match "system"		"IFNET";
 	match "type"		"ATTACH";
 	action "/etc/pccard_ether $subsystem start";
 };
 
-notify 0 {
-	match "system"		"IFNET";
-	match "type"		"DETACH";
-	action "/etc/pccard_ether $subsystem stop";
-};
-
 #
 # Try to start dhclient on Ethernet like interfaces when the link comes
 # up.  Only devices that are configured to support DHCP will actually

==== //depot/projects/ppc-g5/etc/rc.d/jail#3 (text+ko) ====

@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $FreeBSD: src/etc/rc.d/jail,v 1.40 2008/09/24 15:18:27 ru Exp $
+# $FreeBSD: src/etc/rc.d/jail,v 1.41 2009/01/26 12:59:11 bz Exp $
 #
 
 # PROVIDE: jail
@@ -39,7 +39,6 @@
 	_procdir="${_rootdir}/proc"
 	eval _hostname=\"\$jail_${_j}_hostname\"
 	eval _ip=\"\$jail_${_j}_ip\"
-	eval _netmask=\"\${jail_${_j}_netmask:-255.255.255.255}\"
 	eval _interface=\"\${jail_${_j}_interface:-${jail_interface}}\"
 	eval _exec=\"\$jail_${_j}_exec\"
 	eval _exec_start=\"\${jail_${_j}_exec_start:-${jail_exec_start}}\"
@@ -94,7 +93,7 @@
 	debug "$_j mount enable: $_mount"
 	debug "$_j hostname: $_hostname"
 	debug "$_j ip: $_ip"
-	debug "$_j netmask: $_netmask"
+	jail_show_addresses ${_j}
 	debug "$_j interface: $_interface"
 	debug "$_j fib: $_fib"
 	debug "$_j root: $_rootdir"
@@ -128,10 +127,6 @@
 	if [ -z "${_rootdir}" ]; then
 		err 3 "$name: No root directory has been defined for ${_j}"
 	fi
-	if [ -z "${_ip}" ]; then
-		err 3 "$name: No IP address has been defined for ${_j}"
-	fi
-
 }
 
 # set_sysctl rc_knob mib msg
@@ -277,6 +272,208 @@
 	mount -a -F "${_fstab}"
 }
 
+# jail_show_addresses jail
+#	Debug print the input for the given _multi aliases
+#	for a jail for init_variables().
+#
+jail_show_addresses()
+{
+	local _j _type alias
+	_j="$1"
+	alias=0
+
+	if [ -z "${_j}" ]; then
+		warn "jail_show_addresses: you must specify a jail"
+		return
+	fi
+
+	while : ; do
+		eval _addr=\"\$jail_${_j}_ip_multi${alias}\"
+		if [ -n "${_addr}" ]; then
+			debug "${_j} ip_multi${alias}: $_addr"
+			alias=$((${alias} + 1))
+		else
+			break
+		fi
+	done
+}
+
+# jail_extract_address argument
+#	The second argument is the string from one of the _ip
+#	or the _multi variables. In case of a comma separated list
+#	only one argument must be passed in at a time.
+#	The function alters the _type, _iface, _addr and _mask variables.
+#
+jail_extract_address()
+{
+	local _i
+	_i=$1
+
+	if [ -z "${_i}" ]; then
+		warn "jail_extract_address: called without input"
+		return
+	fi
+
+	# Check if we have an interface prefix given and split into
+	# iFace and rest.
+	case "${_i}" in
+	*\|*)	# ifN|.. prefix there
+		_iface=${_i%%|*}
+		_r=${_i##*|}
+		;;
+	*)	_iface=""
+		_r=${_i}
+		;;
+	esac
+
+	# In case the IP has no interface given, check if we have a global one.
+	_iface=${_iface:-${_interface}}
+
+	# Set address, cut off any prefix/netmask/prefixlen.
+	_addr=${_r}
+	_addr=${_addr%%[/ ]*}
+
+	# Theoretically we can return here if interface is not set,
+	# as we only care about the _mask if we call ifconfig.
+	# This is not done because we may want to santize IP addresses
+	# based on _type later, and optionally change the type as well.
+
+	# Extract the prefix/netmask/prefixlen part by cutting off the address.
+	_mask=${_r}
+	_mask=`expr "${_mask}" : "${_addr}\(.*\)"`
+
+	# Identify type {inet,inet6}.
+	case "${_addr}" in
+	*\.*\.*\.*)	_type="inet" ;;
+	*:*)		_type="inet6" ;;
+	*)		warn "jail_extract_address: type not identified"
+			;;
+	esac
+
+	# Handle the special /netmask instead of /prefix or
+	# "netmask xxx" case for legacy IP.
+	# We do NOT support shortend class-full netmasks.
+	if [ "${_type}" = "inet" ]; then
+		case "${_mask}" in
+		/*\.*\.*\.*)	_mask=" netmask ${_mask#/}" ;;
+		*)		;;
+		esac
+
+		# In case _mask is still not set use /32.
+		_mask=${_mask:-/32}
+
+	elif [ "${_type}" = "inet6" ]; then
+		# In case _maske is not set for IPv6, use /128.
+		_mask=${_mask:-/128}
+	fi
+}
+
+# jail_handle_ips_option {add,del} input
+#	Handle a single argument imput which can be a comma separated
+#	list of addresses (theoretically with an option interface and
+#	prefix/netmask/prefixlen).
+#
+jail_handle_ips_option()
+{
+	local _x _action _type _i
+	_action=$1
+	_x=$2
+
+	if [ -z "${_x}" ]; then
+		# No IP given. This can happen for the primary address
+		# of each address family.
+		return
+	fi
+
+	# Loop, in case we find a comma separated list, we need to handle
+	# each argument on its own.
+	while [ ${#_x} -gt 0 ]; do
+		case "${_x}" in
+		*,*)	# Extract the first argument and strip it off the list.
+			_i=`expr "${_x}" : '^\([^,]*\)'`
+			_x=`expr "${_x}" : "^[^,]*,\(.*\)"`
+			;;
+		*)	_i=${_x}
+			_x=""
+			;;
+		esac
+
+		_type=""
+		_iface=""
+		_addr=""
+		_mask=""
+		jail_extract_address "${_i}"
+
+		# make sure we got an address.
+		case "${_addr}" in
+		"")	continue ;;
+		*)	;;
+		esac
+
+		# Append address to list of addresses for the jail command.
+		case "${_addrl}" in
+		"")	_addrl="${_addr}" ;;
+		*)	_addrl="${_addrl},${_addr}" ;;
+		esac
+
+		# Configure interface alias if requested by a given interface
+		# and if we could correctly parse everything.
+		case "${_iface}" in
+		"")	continue ;;
+		esac
+		case "${_type}" in
+		inet)	;;
+		inet6)	;;
+		*)	warn "Could not determine address family.  Not going" \
+			    "to ${_action} address '${_addr}' for ${_jail}."
+			continue
+			;;
+		esac
+		case "${_action}" in
+		add)	ifconfig ${_iface} ${_type} ${_addr}${_mask} alias
+			;;
+		del)	# When removing the IP, ignore the _mask.
+			ifconfig ${_iface} ${_type} ${_addr} -alias
+			;;
+		esac
+	done
+}
+
+# jail_ips {add,del}
+#	Extract the comma separated list of addresses and return them
+#	for the jail command.
+#	Handle more than one address via the _multi option as well.
+#	If an interface is given also add/remove an alias for the
+#	address with an optional netmask.
+#
+jail_ips()
+{
+	local _action
+	_action=$1
+
+	case "${_action}" in
+	add)	;;
+	del)	;;
+	*)	warn "jail_ips: invalid action '${_action}'"
+		return
+		;;
+	esac
+
+	# Handle addresses.
+	jail_handle_ips_option ${_action} "${_ip}"
+	# Handle jail_xxx_ip_multi<N>
+	alias=0
+	while : ; do
+		eval _x=\"\$jail_${_jail}_ip_multi${alias}\"
+		case "${_x}" in
+		"")	break ;;
+		*)	jail_handle_ips_option ${_action} "${_x}"
+			alias=$((${alias} + 1))
+			;;
+		esac
+	done
+}
+
 jail_start()
 {
 	echo -n 'Configuring jails:'
@@ -298,9 +495,8 @@
 			echo -n " [${_hostname} already running (/var/run/jail_${_jail}.id exists)]"
 			continue;
 		fi
-		if [ -n "${_interface}" ]; then
-			ifconfig ${_interface} alias ${_ip} netmask ${_netmask}
-		fi
+		_addrl=""
+		jail_ips "add"
 		if [ -n "${_fib}" ]; then
 			_setfib="setfib -F '${_fib}'"
 		else
@@ -360,7 +556,7 @@
 		fi
 		_tmp_jail=${_tmp_dir}/jail.$$
 		eval ${_setfib} jail ${_flags} -i ${_rootdir} ${_hostname} \
-			${_ip} ${_exec_start} > ${_tmp_jail} 2>&1
+			\"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1
 
 		if [ "$?" -eq 0 ] ; then
 			_jail_id=$(head -1 ${_tmp_jail})
@@ -381,9 +577,7 @@
 			echo ${_jail_id} > /var/run/jail_${_jail}.id
 		else
 			jail_umount_fs
-			if [ -n "${_interface}" ]; then
-				ifconfig ${_interface} -alias ${_ip}
-			fi
+			jail_ips "del"
 			echo " cannot start jail \"${_jail}\": "
 			tail +2 ${_tmp_jail}
 		fi
@@ -412,9 +606,7 @@
 				jail_umount_fs
 				echo -n " $_hostname"
 			fi
-			if [ -n "${_interface}" ]; then
-				ifconfig ${_interface} -alias ${_ip}
-			fi
+			jail_ips "del"
 			rm /var/run/jail_${_jail}.id
 		else
 			echo " cannot stop jail ${_jail}. No jail id in /var/run"

==== //depot/projects/ppc-g5/include/paths.h#2 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)paths.h	8.1 (Berkeley) 6/2/93
- * $FreeBSD: src/include/paths.h,v 1.26 2007/06/11 02:21:18 simokawa Exp $
+ * $FreeBSD: src/include/paths.h,v 1.27 2009/01/26 17:09:26 obrien Exp $
  */
 
 #ifndef _PATHS_H_
@@ -45,8 +45,7 @@
 #define	_PATH_STDPATH \
 	"/usr/bin:/bin:/usr/sbin:/sbin:"
 /* Locate system binaries */
-#define _PATH_SYSPATH	\
-	"/sbin:/usr/sbin"
+#define _PATH_SYSPATH	"/sbin:/usr/sbin"
 
 #define	_PATH_AUTHCONF	"/etc/auth.conf"
 #define	_PATH_BSHELL	"/bin/sh"

==== //depot/projects/ppc-g5/lib/libarchive/archive_write_disk.c#8 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_disk.c,v 1.43 2009/01/21 06:55:27 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_disk.c,v 1.44 2009/01/26 05:44:40 kientzle Exp $");
 
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
@@ -178,6 +178,8 @@
 	int			 fd;
 	/* Current offset for writing data to the file. */
 	off_t			 offset;
+	/* Last offset actually written to disk. */
+	off_t			 fd_offset;
 	/* Maximum size of file, -1 if unknown. */
 	off_t			 filesize;
 	/* Dir we were in before this restore; only for deep paths. */
@@ -187,8 +189,6 @@
 	/* UID/GID to use in restoring this entry. */
 	uid_t			 uid;
 	gid_t			 gid;
-	/* Last offset written to disk. */
-	off_t			 last_offset;
 };
 
 /*
@@ -235,7 +235,7 @@
 static gid_t	trivial_lookup_gid(void *, const char *, gid_t);
 static uid_t	trivial_lookup_uid(void *, const char *, uid_t);
 static ssize_t	write_data_block(struct archive_write_disk *,
-		    const char *, size_t, off_t);
+		    const char *, size_t);
 
 static struct archive_vtable *archive_write_disk_vtable(void);
 
@@ -337,7 +337,7 @@
 	}
 	a->entry = archive_entry_clone(entry);
 	a->fd = -1;
-	a->last_offset = 0;
+	a->fd_offset = 0;
 	a->offset = 0;
 	a->uid = a->user_uid;
 	a->mode = archive_entry_mode(a->entry);
@@ -513,9 +513,9 @@
 }
 
 static ssize_t
-write_data_block(struct archive_write_disk *a,
-    const char *buff, size_t size, off_t offset)
+write_data_block(struct archive_write_disk *a, const char *buff, size_t size)
 {
+	uint64_t start_size = size;
 	ssize_t bytes_written = 0;
 	ssize_t block_size = 0, bytes_to_write;
 
@@ -538,8 +538,9 @@
 #endif
 	}
 
-	if (a->filesize >= 0 && (off_t)(offset + size) > a->filesize)
-		size = (size_t)(a->filesize - offset);
+	/* If this write would run beyond the file size, truncate it. */
+	if (a->filesize >= 0 && (off_t)(a->offset + size) > a->filesize)
+		start_size = size = (size_t)(a->filesize - a->offset);
 
 	/* Write the data. */
 	while (size > 0) {
@@ -555,7 +556,7 @@
 				if (*p != '\0')
 					break;
 			}
-			offset += p - buff;
+			a->offset += p - buff;
 			size -= p - buff;
 			buff = p;
 			if (size == 0)
@@ -563,22 +564,25 @@
 
 			/* Calculate next block boundary after offset. */
 			block_end
-			    = (offset / block_size) * block_size + block_size;
+			    = (a->offset / block_size + 1) * block_size;
 
 			/* If the adjusted write would cross block boundary,
 			 * truncate it to the block boundary. */
 			bytes_to_write = size;
-			if (offset + bytes_to_write > block_end)
-				bytes_to_write = block_end - offset;
+			if (a->offset + bytes_to_write > block_end)
+				bytes_to_write = block_end - a->offset;
 		}
 
 		/* Seek if necessary to the specified offset. */
-		if (offset != a->last_offset) {
-			if (lseek(a->fd, offset, SEEK_SET) < 0) {
+		if (a->offset != a->fd_offset) {
+			if (lseek(a->fd, a->offset, SEEK_SET) < 0) {
 				archive_set_error(&a->archive, errno,
 				    "Seek failed");
 				return (ARCHIVE_FATAL);
 			}
+			a->fd_offset = a->offset;
+			a->archive.file_position = a->offset;
+			a->archive.raw_position = a->offset;
  		}
 		bytes_written = write(a->fd, buff, bytes_to_write);
 		if (bytes_written < 0) {
@@ -587,12 +591,12 @@
 		}
 		buff += bytes_written;
 		size -= bytes_written;
-		offset += bytes_written;
+		a->offset += bytes_written;
 		a->archive.file_position += bytes_written;
 		a->archive.raw_position += bytes_written;
-		a->last_offset = a->offset = offset;
+		a->fd_offset = a->offset;
 	}
-	return (bytes_written);
+	return (start_size - size);
 }
 
 static ssize_t
@@ -605,9 +609,9 @@
 	__archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC,
 	    ARCHIVE_STATE_DATA, "archive_write_disk_block");
 
-	r = write_data_block(a, buff, size, offset);
-
-	if (r < 0)
+	a->offset = offset;
+	r = write_data_block(a, buff, size);
+	if (r < ARCHIVE_OK)
 		return (r);
 	if ((size_t)r < size) {
 		archive_set_error(&a->archive, 0,
@@ -625,7 +629,7 @@
 	__archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC,
 	    ARCHIVE_STATE_DATA, "archive_write_data");
 
-	return (write_data_block(a, buff, size, a->offset));
+	return (write_data_block(a, buff, size));
 }
 
 static int
@@ -646,7 +650,7 @@
 		/* There's no file. */
 	} else if (a->filesize < 0) {
 		/* File size is unknown, so we can't set the size. */
-	} else if (a->last_offset == a->filesize) {
+	} else if (a->fd_offset == a->filesize) {
 		/* Last write ended at exactly the filesize; we're done. */
 		/* Hopefully, this is the common case. */
 	} else {

==== //depot/projects/ppc-g5/lib/libarchive/test/Makefile#7 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/lib/libarchive/test/Makefile,v 1.30 2009/01/21 06:55:27 kientzle Exp $
+# $FreeBSD: src/lib/libarchive/test/Makefile,v 1.31 2009/01/26 05:44:40 kientzle Exp $
 
 # Where to find the libarchive sources
 LA_SRCDIR=${.CURDIR}/..
@@ -62,6 +62,7 @@
 	test_write_disk_hardlink.c		\
 	test_write_disk_perms.c			\
 	test_write_disk_secure.c		\
+	test_write_disk_sparse.c		\
 	test_write_disk_times.c			\
 	test_write_format_ar.c			\
 	test_write_format_cpio.c		\

==== //depot/projects/ppc-g5/lib/libc/string/strlen.c#2 (text+ko) ====

@@ -1,6 +1,6 @@
 /*-
- * Copyright (c) 1990, 1993
- *	The Regents of the University of California.  All rights reserved.
+ * Copyright (c) 2009 Xin LI <delphij at FreeBSD.org>
+ * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -10,14 +10,11 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
  *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
@@ -27,21 +24,87 @@
  * SUCH DAMAGE.
  */
 
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)strlen.c	8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/string/strlen.c,v 1.5 2007/01/09 00:28:12 imp Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/string/strlen.c,v 1.7 2009/01/26 07:31:28 delphij Exp $");
 
+#include <sys/limits.h>
+#include <sys/types.h>
 #include <string.h>
 
+/*
+ * Portable strlen() for 32-bit and 64-bit systems.
+ *
+ * Rationale: it is generally much more efficient to do word length
+ * operations and avoid branches on modern computer systems, as
+ * compared to byte-length operations with a lot of branches.
+ *
+ * The expression:
+ *
+ *	((x - 0x01....01) & ~x & 0x80....80)
+ *
+ * would evaluate to a non-zero value iff any of the bytes in the
+ * original word is zero.  However, we can further reduce ~1/3 of
+ * time if we consider that strlen() usually operate on 7-bit ASCII
+ * by employing the following expression, which allows false positive
+ * when high bit of 1 and use the tail case to catch these case:
+ *
+ *	((x - 0x01....01) & 0x80....80)
+ *
+ * This is more than 5.2 times as fast as the raw implementation on
+ * Intel T7300 under long mode for strings longer than word length.
+ */
+
+/* Magic numbers for the algorithm */
+#if LONG_BIT == 32
+static const unsigned long mask01 = 0x01010101;
+static const unsigned long mask80 = 0x80808080;
+#elif LONG_BIT == 64
+static const unsigned long mask01 = 0x0101010101010101;
+static const unsigned long mask80 = 0x8080808080808080;
+#else
+#error Unsupported word size
+#endif
+
+#define	LONGPTR_MASK (sizeof(long) - 1)
+
+/*
+ * Helper macro to return string length if we caught the zero
+ * byte.
+ */
+#define testbyte(x)				\
+	do {					\
+		if (p[x] == '\0')		\
+		    return (p - str + x);	\
+	} while (0)
+
 size_t
-strlen(str)
-	const char *str;
+strlen(const char *str)
 {
-	const char *s;
+	const char *p;
+	const unsigned long *lp;
+
+	/* Skip the first few bytes until we have an aligned p */
+	for (p = str; (uintptr_t)p & LONGPTR_MASK; p++)
+	    if (*p == '\0')
+		return (p - str);
+
+	/* Scan the rest of the string using word sized operation */
+	for (lp = (const unsigned long *)p; ; lp++)
+	    if ((*lp - mask01) & mask80) {
+		p = (const char *)(lp);
+		testbyte(0);
+		testbyte(1);
+		testbyte(2);
+		testbyte(3);
+#if (LONG_BIT >= 64)
+		testbyte(4);
+		testbyte(5);
+		testbyte(6);
+		testbyte(7);
+#endif
+	    }
 
-	for (s = str; *s; ++s);
-	return(s - str);
+	/* NOTREACHED */
+	return (0);
 }
 

==== //depot/projects/ppc-g5/lib/libpmc/libpmc.c#5 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libpmc/libpmc.c,v 1.19 2008/12/03 17:30:36 jkoshy Exp $");
+__FBSDID("$FreeBSD: src/lib/libpmc/libpmc.c,v 1.20 2009/01/27 07:29:37 jeff Exp $");
 
 #include <sys/types.h>
 #include <sys/module.h>
@@ -152,6 +152,11 @@
 	__PMC_EV_ALIAS_CORE2()
 };
 
+static const struct pmc_event_descr corei7_event_table[] =
+{
+	__PMC_EV_ALIAS_COREI7()
+};
+
 /*
  * PMC_MDEP_TABLE(NAME, PRIMARYCLASS, ADDITIONAL_CLASSES...)
  *
@@ -165,6 +170,7 @@
 PMC_MDEP_TABLE(atom, IAP, PMC_CLASS_IAF, PMC_CLASS_TSC);
 PMC_MDEP_TABLE(core, IAP, PMC_CLASS_TSC);
 PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_IAF, PMC_CLASS_TSC);
+PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_IAF, PMC_CLASS_TSC);
 PMC_MDEP_TABLE(k7, K7, PMC_CLASS_TSC);
 PMC_MDEP_TABLE(k8, K8, PMC_CLASS_TSC);
 PMC_MDEP_TABLE(p4, P4, PMC_CLASS_TSC);
@@ -194,6 +200,7 @@
 PMC_CLASS_TABLE_DESC(atom, IAP, atom, iap);
 PMC_CLASS_TABLE_DESC(core, IAP, core, iap);
 PMC_CLASS_TABLE_DESC(core2, IAP, core2, iap);
+PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap);
 #endif
 #if	defined(__i386__)
 PMC_CLASS_TABLE_DESC(k7, K7, k7, k7);
@@ -448,6 +455,7 @@
 	EV_ALIAS(NULL, NULL)
 };
 #define	atom_aliases	core2_aliases
+#define corei7_aliases	core2_aliases
 
 #define	IAF_KW_OS		"os"
 #define	IAF_KW_USR		"usr"
@@ -604,7 +612,8 @@
 				return (-1);
 		} else if (cpu_info.pm_cputype == PMC_CPU_INTEL_ATOM ||
 		    cpu_info.pm_cputype == PMC_CPU_INTEL_CORE2 ||
-		    cpu_info.pm_cputype == PMC_CPU_INTEL_CORE2EXTREME) {
+		    cpu_info.pm_cputype == PMC_CPU_INTEL_CORE2EXTREME ||
+		    cpu_info.pm_cputype == PMC_CPU_INTEL_COREI7) {
 			if (KWMATCH(p, IAP_KW_SNOOPRESPONSE)) {
 				n = pmc_parse_mask(iap_snoopresponse_mask, p,
 				    &evmask);
@@ -2278,6 +2287,10 @@
 			ev = core2_event_table;
 			count = PMC_EVENT_TABLE_SIZE(core2);
 			break;
+		case PMC_CPU_INTEL_COREI7:
+			ev = corei7_event_table;
+			count = PMC_EVENT_TABLE_SIZE(corei7);
+			break;
 		}
 		break;
 	case PMC_CLASS_TSC:
@@ -2462,6 +2475,11 @@
 		pmc_class_table[n++] = &iaf_class_table_descr;
 		pmc_class_table[n]   = &core2_class_table_descr;
 		break;
+	case PMC_CPU_INTEL_COREI7:
+		PMC_MDEP_INIT(corei7);
+		pmc_class_table[n++] = &iaf_class_table_descr;
+		pmc_class_table[n]   = &corei7_class_table_descr;
+		break;
 	case PMC_CPU_INTEL_PIV:
 		PMC_MDEP_INIT(p4);
 		pmc_class_table[n] = &p4_class_table_descr;
@@ -2560,6 +2578,10 @@
 			ev = core2_event_table;
 			evfence = core2_event_table + PMC_EVENT_TABLE_SIZE(core2);
 			break;
+		case PMC_CPU_INTEL_COREI7:
+			ev = corei7_event_table;
+			evfence = corei7_event_table + PMC_EVENT_TABLE_SIZE(corei7);
+			break;
 		default:	/* Unknown CPU type. */
 			break;
 		}

==== //depot/projects/ppc-g5/sbin/fsck_ffs/fsutil.c#3 (text+ko) ====

@@ -33,7 +33,7 @@
 #endif /* not lint */
 #endif
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sbin/fsck_ffs/fsutil.c,v 1.28 2009/01/20 22:49:49 delphij Exp $");
+__FBSDID("$FreeBSD: src/sbin/fsck_ffs/fsutil.c,v 1.29 2009/01/27 00:29:19 delphij Exp $");
 
 #include <sys/param.h>
 #include <sys/time.h>
@@ -442,7 +442,7 @@
 			rerun = 1;
 		}
 	    } else
-		printf("YOU MAY NEED TO RERUN FSCK WITH -C IF IT CRASHED.\n");
+		printf("YOU MAY NEED TO RERUN FSCK WITH -D IF IT CRASHED.\n");
 	}
 }
 

==== //depot/projects/ppc-g5/sbin/ipfw/Makefile#2 (text+ko) ====

@@ -1,7 +1,7 @@
-# $FreeBSD: src/sbin/ipfw/Makefile,v 1.14 2004/10/03 06:32:37 green Exp $
+# $FreeBSD: src/sbin/ipfw/Makefile,v 1.18 2009/01/27 12:01:30 luigi Exp $
 
 PROG=	ipfw
-SRCS=	ipfw2.c
+SRCS=	ipfw2.c dummynet.c ipv6.c main.c nat.c
 WARNS?=	0
 MAN=	ipfw.8
 

==== //depot/projects/ppc-g5/sbin/ipfw/ipfw2.c#7 (text+ko) ====

@@ -17,14 +17,15 @@
  *
  * NEW command line interface for IP firewall facility
  *
- * $FreeBSD: src/sbin/ipfw/ipfw2.c,v 1.135 2009/01/22 23:25:28 luigi Exp $
+ * $FreeBSD: src/sbin/ipfw/ipfw2.c,v 1.143 2009/01/27 12:01:30 luigi Exp $
  */
 
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/sockio.h>
 #include <sys/sysctl.h>
-#include <sys/wait.h>
+
+#include "ipfw2.h"
 
 #include <ctype.h>
 #include <err.h>
@@ -32,7 +33,6 @@
 #include <grp.h>
 #include <netdb.h>
 #include <pwd.h>
-#include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -52,37 +52,13 @@
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
 #include <netinet/ip_icmp.h>
-#include <netinet/icmp6.h>
 #include <netinet/ip_fw.h>
-#include <netinet/ip_dummynet.h>
 #include <netinet/tcp.h>
 #include <arpa/inet.h>
-#include <alias.h>
 
-int
-		do_value_as_ip,		/* show table value as IP */
-		do_resolv,		/* Would try to resolve all */
-		do_time,		/* Show time stamps */
-		do_quiet,		/* Be quiet in add and flush */
-		do_pipe,		/* this cmd refers to a pipe */
-	        do_nat, 		/* Nat configuration. */
-		do_sort,		/* field to sort results (0 = no) */
-		do_dynamic,		/* display dynamic rules */
-		do_expired,		/* display expired dynamic rules */
-		do_compact,		/* show rules in compact mode */
-		do_force,		/* do not ask for confirmation */
-		use_set,		/* work with specified set number */
-		show_sets,		/* display rule sets */
-		test_only,		/* only check syntax */
-		comment_only,		/* only print action and comment */
-		verbose;
+struct cmdline_opts co;	/* global options */
 
-#define	IP_MASK_ALL	0xffffffff
-/*
- * the following macro returns an error message if we run out of
- * arguments.
- */
-#define NEED1(msg)      {if (!ac) errx(EX_USAGE, msg);}
+int resvd_set_number = RESVD_SET;
 
 #define GET_UINT_ARG(arg, min, max, tok, s_x) do {			\
 	if (!ac)							\
@@ -113,28 +89,17 @@
 	}								\
 } while (0)
 
-#define PRINT_UINT_ARG(str, arg) do {					\
-	if (str != NULL)						\
-		printf("%s",str);					\
-	if (arg == IP_FW_TABLEARG)					\
-		printf("tablearg");					\
-	else								\
-		printf("%u", (uint32_t)arg);				\
-} while (0)
+static void
+PRINT_UINT_ARG(const char *str, uint32_t arg)
+{
+	if (str != NULL)
+		printf("%s",str);
+	if (arg == IP_FW_TABLEARG)
+		printf("tablearg");
+	else
+		printf("%u", arg);
+}
 
-/*
- * _s_x is a structure that stores a string <-> token pairs, used in
- * various places in the parser. Entries are stored in arrays,
- * with an entry with s=NULL as terminator.
- * The search routines are match_token() and match_value().
- * Often, an element with x=0 contains an error string.
- *
- */
-struct _s_x {
-	char const *s;
-	int x;

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


More information about the p4-projects mailing list