From owner-svn-src-user@FreeBSD.ORG  Sun Nov 17 00:49:55 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C5B28CF1;
 Sun, 17 Nov 2013 00:49:55 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id B523A2E00;
 Sun, 17 Nov 2013 00:49:55 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAH0ntjT044929;
 Sun, 17 Nov 2013 00:49:55 GMT (envelope-from ray@svn.freebsd.org)
Received: (from ray@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAH0ntDx044928;
 Sun, 17 Nov 2013 00:49:55 GMT (envelope-from ray@svn.freebsd.org)
Message-Id: <201311170049.rAH0ntDx044928@svn.freebsd.org>
From: Aleksandr Rybalko <ray@FreeBSD.org>
Date: Sun, 17 Nov 2013 00:49:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258241 - user/ed/newcons/sys/dev/drm2
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 17 Nov 2013 00:49:55 -0000

Author: ray
Date: Sun Nov 17 00:49:55 2013
New Revision: 258241
URL: http://svnweb.freebsd.org/changeset/base/258241

Log:
  Lock mode_config before call drm_crtc_helper_set_config.
  
  Submitted by:	avg
  Sponsored by:	The FreeBSD Foundation

Modified:
  user/ed/newcons/sys/dev/drm2/drm_fb_helper.c

Modified: user/ed/newcons/sys/dev/drm2/drm_fb_helper.c
==============================================================================
--- user/ed/newcons/sys/dev/drm2/drm_fb_helper.c	Sat Nov 16 23:37:56 2013	(r258240)
+++ user/ed/newcons/sys/dev/drm2/drm_fb_helper.c	Sun Nov 17 00:49:55 2013	(r258241)
@@ -385,7 +385,9 @@ bool drm_fb_helper_restore_fbdev_mode(st
 	int i, ret;
 	for (i = 0; i < fb_helper->crtc_count; i++) {
 		struct drm_mode_set *mode_set = &fb_helper->crtc_info[i].mode_set;
+		sx_xlock(&fb_helper->dev->mode_config.mutex);
 		ret = drm_crtc_helper_set_config(mode_set);
+		sx_xunlock(&fb_helper->dev->mode_config.mutex);
 		if (ret)
 			error = true;
 	}

From owner-svn-src-user@FreeBSD.ORG  Sun Nov 17 21:31:12 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C9489960;
 Sun, 17 Nov 2013 21:31:12 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9F8C625B9;
 Sun, 17 Nov 2013 21:31:12 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHLVCc7073600;
 Sun, 17 Nov 2013 21:31:12 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHLVC7Q073598;
 Sun, 17 Nov 2013 21:31:12 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201311172131.rAHLVC7Q073598@svn.freebsd.org>
From: Nathan Whitehorn <nwhitehorn@FreeBSD.org>
Date: Sun, 17 Nov 2013 21:31:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258277 - in user/nwhitehorn/condorports/altjailscripts:
 . unionfs
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 17 Nov 2013 21:31:12 -0000

Author: nwhitehorn
Date: Sun Nov 17 21:31:11 2013
New Revision: 258277
URL: http://svnweb.freebsd.org/changeset/base/258277

Log:
  Alternative approaches to making build jails. This one goes in the attic
  because the in-kernel unionfs is a crashfest.

Added:
  user/nwhitehorn/condorports/altjailscripts/
  user/nwhitehorn/condorports/altjailscripts/unionfs/
  user/nwhitehorn/condorports/altjailscripts/unionfs/prepbuildjail
     - copied, changed from r258276, user/nwhitehorn/condorports/prepbuildjail
  user/nwhitehorn/condorports/altjailscripts/unionfs/reapbuildjail
     - copied unchanged from r258276, user/nwhitehorn/condorports/reapbuildjail

Copied and modified: user/nwhitehorn/condorports/altjailscripts/unionfs/prepbuildjail (from r258276, user/nwhitehorn/condorports/prepbuildjail)
==============================================================================
--- user/nwhitehorn/condorports/prepbuildjail	Sun Nov 17 20:58:31 2013	(r258276, copy source)
+++ user/nwhitehorn/condorports/altjailscripts/unionfs/prepbuildjail	Sun Nov 17 21:31:11 2013	(r258277)
@@ -8,7 +8,7 @@ case $slot in
 	*[^a-zA-Z0-9]* ) echo "Non-alphanumeric slot $slot"; exit 1
 esac
 case $release in
-	*[^a-zA-Z0-9]* ) echo "Non-alphanumeric release $release"; exit 1
+	*[^a-zA-Z0-9/-]* ) echo "Non-alphanumeric release $release"; exit 1
 esac
 case $ports in
 	*[^a-zA-Z0-9/-]* ) echo "Non-alphanumeric ports $ports"; exit 1

Copied: user/nwhitehorn/condorports/altjailscripts/unionfs/reapbuildjail (from r258276, user/nwhitehorn/condorports/reapbuildjail)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/nwhitehorn/condorports/altjailscripts/unionfs/reapbuildjail	Sun Nov 17 21:31:11 2013	(r258277, copy of r258276, user/nwhitehorn/condorports/reapbuildjail)
@@ -0,0 +1,26 @@
+#!/bin/sh
+slot=$1
+
+#Audit slot and release names
+case $slot in
+	*[^a-zA-Z0-9]* ) echo "Non-alphanumeric slot $slot"; exit 1
+esac
+if [ -z "$slot" ]; then
+	echo "Zero-length slot or release"
+	exit 1
+fi
+
+if [ ! -d /scratch/$slot ]; then
+	echo "No file system for slot!"
+	exit 1
+fi
+
+set +e
+set -o noclobber
+echo > /scratch/$slot.lock
+jail -f /scratch/$slot.conf -r $slot
+chflags -R noschg /scratch/$slot
+rm -rf /scratch/$slot /scratch/$slot.conf /scratch/$slot.fstab
+set +e
+rm /scratch/$slot.lock
+

From owner-svn-src-user@FreeBSD.ORG  Sun Nov 17 21:33:33 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 5DF93B01;
 Sun, 17 Nov 2013 21:33:33 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4DF0125DB;
 Sun, 17 Nov 2013 21:33:33 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHLXXU8073914;
 Sun, 17 Nov 2013 21:33:33 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHLXWtm073912;
 Sun, 17 Nov 2013 21:33:32 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201311172133.rAHLXWtm073912@svn.freebsd.org>
From: Nathan Whitehorn <nwhitehorn@FreeBSD.org>
Date: Sun, 17 Nov 2013 21:33:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258278 -
 user/nwhitehorn/condorports/altjailscripts/fuse-unionfs
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 17 Nov 2013 21:33:33 -0000

Author: nwhitehorn
Date: Sun Nov 17 21:33:32 2013
New Revision: 258278
URL: http://svnweb.freebsd.org/changeset/base/258278

Log:
  These use FUSE's unionfs implementation, which is much better. However,
  our FUSE kernel support is *also* a crashfest.

Added:
  user/nwhitehorn/condorports/altjailscripts/fuse-unionfs/
  user/nwhitehorn/condorports/altjailscripts/fuse-unionfs/prepbuildjail
     - copied, changed from r258277, user/nwhitehorn/condorports/prepbuildjail
  user/nwhitehorn/condorports/altjailscripts/fuse-unionfs/reapbuildjail
     - copied, changed from r258277, user/nwhitehorn/condorports/reapbuildjail

Copied and modified: user/nwhitehorn/condorports/altjailscripts/fuse-unionfs/prepbuildjail (from r258277, user/nwhitehorn/condorports/prepbuildjail)
==============================================================================
--- user/nwhitehorn/condorports/prepbuildjail	Sun Nov 17 21:31:11 2013	(r258277, copy source)
+++ user/nwhitehorn/condorports/altjailscripts/fuse-unionfs/prepbuildjail	Sun Nov 17 21:33:32 2013	(r258278)
@@ -1,7 +1,6 @@
 #!/bin/sh
 slot=$1
 release=$2
-ports=$3
 
 #Audit slot and release names
 case $slot in
@@ -10,9 +9,6 @@ esac
 case $release in
 	*[^a-zA-Z0-9]* ) echo "Non-alphanumeric release $release"; exit 1
 esac
-case $ports in
-	*[^a-zA-Z0-9/-]* ) echo "Non-alphanumeric ports $ports"; exit 1
-esac
 if [ -z "$slot" -o -z "$release" ]; then
 	echo "Zero-length slot or release"
 	exit 1
@@ -21,6 +17,7 @@ fi
 if [ -d /scratch/$slot ]; then
 	echo "Pre-existing file system for this slot!"
 	/pkgscripts/reapbuildjail $slot
+	sleep 5
 fi
 
 cleanup() {
@@ -34,33 +31,10 @@ trap cleanup EXIT
 
 #TODO: localhost networking
 
-set -o noclobber
-echo > /scratch/$slot.lock
-
-set +o noclobber
-cat << EOF > /scratch/$slot.conf
-$slot {
-	path="/scratch/$slot";
-	host.hostname="$slot.`hostname`";
-	persist="true";
-	mount.devfs="true";
-	mount.fstab="/scratch/$slot.fstab";
-}
-EOF
-# TODO: Setting nosuid seems to break "below"
-echo "/scratch/$release /scratch/$slot unionfs below,noatime 0 0" > /scratch/$slot.fstab
-if [ -n "$ports" ]; then
-	mkdir -p /scratch/$slot/$ports
-	echo "$ports /scratch/$slot/$ports nullfs ro 0 0" >> /scratch/$slot.fstab
-fi
-
 mkdir -p /scratch/$slot
+mkdir -p /scratch/tmp/$slot
+unionfs -o cow -o noatime -o nosuid -o max_files=32000 /scratch/tmp/$slot=RW:/scratch/ports=RO:/scratch/$release=RO /scratch/$slot
 
-jail -f /scratch/$slot.conf -c $slot
-ls /scratch/$slot/dev > /dev/null # Hack around unionfs bugs
-if [ -n "$ports" ]; then
-	ls /scratch/$slot/$ports > /dev/null # And once more
-fi
+jail -c name=$slot path=/scratch/$slot host.hostname=$slot.`hostname` persist=true mount.devfs=true
 trap true EXIT
-rm /scratch/$slot.lock
 

Copied and modified: user/nwhitehorn/condorports/altjailscripts/fuse-unionfs/reapbuildjail (from r258277, user/nwhitehorn/condorports/reapbuildjail)
==============================================================================
--- user/nwhitehorn/condorports/reapbuildjail	Sun Nov 17 21:31:11 2013	(r258277, copy source)
+++ user/nwhitehorn/condorports/altjailscripts/fuse-unionfs/reapbuildjail	Sun Nov 17 21:33:32 2013	(r258278)
@@ -15,12 +15,9 @@ if [ ! -d /scratch/$slot ]; then
 	exit 1
 fi
 
-set +e
-set -o noclobber
-echo > /scratch/$slot.lock
-jail -f /scratch/$slot.conf -r $slot
-chflags -R noschg /scratch/$slot
-rm -rf /scratch/$slot /scratch/$slot.conf /scratch/$slot.fstab
-set +e
-rm /scratch/$slot.lock
-
+jail -r $slot
+umount -f /scratch/$slot/dev || true
+umount -f /scratch/$slot || true
+chflags -R noschg /scratch/tmp/$slot
+rm -rf /scratch/tmp/$slot /scratch/$slot
+exit 0

From owner-svn-src-user@FreeBSD.ORG  Sun Nov 17 21:36:20 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 1C2B5ED7;
 Sun, 17 Nov 2013 21:36:20 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id E65A125F7;
 Sun, 17 Nov 2013 21:36:19 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHLaJhY074341;
 Sun, 17 Nov 2013 21:36:19 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHLaJSq074339;
 Sun, 17 Nov 2013 21:36:19 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201311172136.rAHLaJSq074339@svn.freebsd.org>
From: Nathan Whitehorn <nwhitehorn@FreeBSD.org>
Date: Sun, 17 Nov 2013 21:36:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258279 - user/nwhitehorn/condorports
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 17 Nov 2013 21:36:20 -0000

Author: nwhitehorn
Date: Sun Nov 17 21:36:19 2013
New Revision: 258279
URL: http://svnweb.freebsd.org/changeset/base/258279

Log:
  Something that is not a crashfest: use tmpfs and tar. This imposes a
  two second per job penalty on my powermac G5. Larger penalties could
  be expected for slow storage. For platforms that support it, and where
  the repo is local, zfs clone could also work. We should really fix FUSE
  not to crash.

Modified:
  user/nwhitehorn/condorports/prepbuildjail
  user/nwhitehorn/condorports/reapbuildjail

Modified: user/nwhitehorn/condorports/prepbuildjail
==============================================================================
--- user/nwhitehorn/condorports/prepbuildjail	Sun Nov 17 21:33:32 2013	(r258278)
+++ user/nwhitehorn/condorports/prepbuildjail	Sun Nov 17 21:36:19 2013	(r258279)
@@ -47,20 +47,18 @@ $slot {
 	mount.fstab="/scratch/$slot.fstab";
 }
 EOF
-# TODO: Setting nosuid seems to break "below"
-echo "/scratch/$release /scratch/$slot unionfs below,noatime 0 0" > /scratch/$slot.fstab
+
+mkdir -p /scratch/$slot
+mount -t tmpfs tmpfs /scratch/$slot
+
+#cp -a /scratch/$release/ /scratch/$slot
+tar -C /scratch/$slot -xf /scratch/$release.tar
 if [ -n "$ports" ]; then
 	mkdir -p /scratch/$slot/$ports
 	echo "$ports /scratch/$slot/$ports nullfs ro 0 0" >> /scratch/$slot.fstab
 fi
 
-mkdir -p /scratch/$slot
-
 jail -f /scratch/$slot.conf -c $slot
-ls /scratch/$slot/dev > /dev/null # Hack around unionfs bugs
-if [ -n "$ports" ]; then
-	ls /scratch/$slot/$ports > /dev/null # And once more
-fi
 trap true EXIT
 rm /scratch/$slot.lock
 

Modified: user/nwhitehorn/condorports/reapbuildjail
==============================================================================
--- user/nwhitehorn/condorports/reapbuildjail	Sun Nov 17 21:33:32 2013	(r258278)
+++ user/nwhitehorn/condorports/reapbuildjail	Sun Nov 17 21:36:19 2013	(r258279)
@@ -19,7 +19,7 @@ set +e
 set -o noclobber
 echo > /scratch/$slot.lock
 jail -f /scratch/$slot.conf -r $slot
-chflags -R noschg /scratch/$slot
+umount -f /scratch/$slot || true
 rm -rf /scratch/$slot /scratch/$slot.conf /scratch/$slot.fstab
 set +e
 rm /scratch/$slot.lock

From owner-svn-src-user@FreeBSD.ORG  Sun Nov 17 22:44:52 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id BE24B656;
 Sun, 17 Nov 2013 22:44:52 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id AA0212A2D;
 Sun, 17 Nov 2013 22:44:52 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHMiqJY099095;
 Sun, 17 Nov 2013 22:44:52 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHMiqnd099094;
 Sun, 17 Nov 2013 22:44:52 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201311172244.rAHMiqnd099094@svn.freebsd.org>
From: Nathan Whitehorn <nwhitehorn@FreeBSD.org>
Date: Sun, 17 Nov 2013 22:44:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258282 - user/nwhitehorn/condorports
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 17 Nov 2013 22:44:52 -0000

Author: nwhitehorn
Date: Sun Nov 17 22:44:52 2013
New Revision: 258282
URL: http://svnweb.freebsd.org/changeset/base/258282

Log:
  Work around bug in ports tree: bsd.pkgng.mk does not respect NO_LATEST_LINK.

Modified:
  user/nwhitehorn/condorports/buildport.sh

Modified: user/nwhitehorn/condorports/buildport.sh
==============================================================================
--- user/nwhitehorn/condorports/buildport.sh	Sun Nov 17 22:31:23 2013	(r258281)
+++ user/nwhitehorn/condorports/buildport.sh	Sun Nov 17 22:44:52 2013	(r258282)
@@ -16,7 +16,7 @@ set -e
 sudo /pkgscripts/prepbuildjail $_CONDOR_SLOT $release $portsdir
 cat $tarballname | sudo jexec $_CONDOR_SLOT tar xvf -
 sudo jexec $_CONDOR_SLOT make -C $port install USE_PACKAGE_DEPENDS=true BATCH=true WRKDIRPREFIX=/obj DISABLE_MAKE_JOBS=true PKGREPOSITORY=/packages PACKAGES=/packages DISTDIR=/distfiles
-sudo jexec $_CONDOR_SLOT make -C $port package PKGREPOSITORY=/packages BATCH=true NO_LATEST_LINK=true WRKDIRPREFIX=/obj
+sudo jexec $_CONDOR_SLOT make -C $port package PKGREPOSITORY=/packages PACKAGES=/packages BATCH=true NO_LATEST_LINK=true WRKDIRPREFIX=/obj
 sudo jexec $_CONDOR_SLOT cat /packages/$pkg > $scratchdir/$pkg
 sudo /pkgscripts/reapbuildjail $_CONDOR_SLOT
 set +e

From owner-svn-src-user@FreeBSD.ORG  Mon Nov 18 04:17:05 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 50B2A2DA;
 Mon, 18 Nov 2013 04:17:05 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 409722AE2;
 Mon, 18 Nov 2013 04:17:05 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAI4H58s012859;
 Mon, 18 Nov 2013 04:17:05 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAI4H44N012857;
 Mon, 18 Nov 2013 04:17:04 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201311180417.rAI4H44N012857@svn.freebsd.org>
From: Nathan Whitehorn <nwhitehorn@FreeBSD.org>
Date: Mon, 18 Nov 2013 04:17:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258292 - user/nwhitehorn/condorports
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Nov 2013 04:17:05 -0000

Author: nwhitehorn
Date: Mon Nov 18 04:17:04 2013
New Revision: 258292
URL: http://svnweb.freebsd.org/changeset/base/258292

Log:
  Add a (shared) loopback IP to the jails.

Modified:
  user/nwhitehorn/condorports/README
  user/nwhitehorn/condorports/prepbuildjail

Modified: user/nwhitehorn/condorports/README
==============================================================================
--- user/nwhitehorn/condorports/README	Mon Nov 18 03:24:50 2013	(r258291)
+++ user/nwhitehorn/condorports/README	Mon Nov 18 04:17:04 2013	(r258292)
@@ -82,7 +82,6 @@ Options to buildportsdag.sh are specifie
 TODO:
 ----
 Not all features are fully implemented yet. In particular:
-- Need to configure networking in the build jails
 - Need to advertise release and ports directory availability in the machine
   classad (via STARTD_CRON) so that jobs are scheduled only on hosts that
   have acquired the appropriate resources. This is especially important in

Modified: user/nwhitehorn/condorports/prepbuildjail
==============================================================================
--- user/nwhitehorn/condorports/prepbuildjail	Mon Nov 18 03:24:50 2013	(r258291)
+++ user/nwhitehorn/condorports/prepbuildjail	Mon Nov 18 04:17:04 2013	(r258292)
@@ -45,6 +45,7 @@ $slot {
 	persist="true";
 	mount.devfs="true";
 	mount.fstab="/scratch/$slot.fstab";
+	ip4.addr=127.0.0.1;
 }
 EOF
 

From owner-svn-src-user@FreeBSD.ORG  Mon Nov 18 11:29:26 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id EDA4171C;
 Mon, 18 Nov 2013 11:29:26 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id CDF5A2333;
 Mon, 18 Nov 2013 11:29:26 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIBTQjO059054;
 Mon, 18 Nov 2013 11:29:26 GMT (envelope-from pho@svn.freebsd.org)
Received: (from pho@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIBTQ1l059051;
 Mon, 18 Nov 2013 11:29:26 GMT (envelope-from pho@svn.freebsd.org)
Message-Id: <201311181129.rAIBTQ1l059051@svn.freebsd.org>
From: Peter Holm <pho@FreeBSD.org>
Date: Mon, 18 Nov 2013 11:29:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258295 - user/pho/stress2/misc
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Nov 2013 11:29:27 -0000

Author: pho
Date: Mon Nov 18 11:29:25 2013
New Revision: 258295
URL: http://svnweb.freebsd.org/changeset/base/258295

Log:
  The original copyright notice was missing.
  Reduce run time for datamove2.sh.
  
  Sponsored by:	EMC / Isilon storage division

Modified:
  user/pho/stress2/misc/datamove.sh
  user/pho/stress2/misc/datamove2.sh
  user/pho/stress2/misc/datamove3.sh

Modified: user/pho/stress2/misc/datamove.sh
==============================================================================
--- user/pho/stress2/misc/datamove.sh	Mon Nov 18 11:28:19 2013	(r258294)
+++ user/pho/stress2/misc/datamove.sh	Mon Nov 18 11:29:25 2013	(r258295)
@@ -64,6 +64,33 @@ sysctl vm.old_msync=$old
 rm -rf /tmp/dl
 exit 0
 EOF
+/*-
+ * Copyright (c) 2006, Stephan Uphoff <ups@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice unmodified, this list of conditions, and the following
+ *    disclaimer.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
 #include <sys/types.h>
 #include <unistd.h>
 #include <sys/stat.h>

Modified: user/pho/stress2/misc/datamove2.sh
==============================================================================
--- user/pho/stress2/misc/datamove2.sh	Mon Nov 18 11:28:19 2013	(r258294)
+++ user/pho/stress2/misc/datamove2.sh	Mon Nov 18 11:29:25 2013	(r258295)
@@ -40,7 +40,7 @@ sed '1,/^EOF/d' < $here/$0 > dl.c
 cc -o dl -Wall dl.c
 rm -f dl.c
 
-for i in `jot 3`; do
+for i in `jot 2`; do
 	$here/../testcases/swap/swap -t 10m -i 200 -h &
 	/tmp/dl 
 	ps | grep swap | grep -v swap | awk '{print $1}' | xargs kill
@@ -48,6 +48,32 @@ done
 rm -rf /tmp/dl
 exit 0
 EOF
+/*-
+ * Copyright (c) 2006, Stephan Uphoff <ups@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice unmodified, this list of conditions, and the following
+ *    disclaimer.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include <err.h>
 #include <fcntl.h>
 #include <stdio.h>

Modified: user/pho/stress2/misc/datamove3.sh
==============================================================================
--- user/pho/stress2/misc/datamove3.sh	Mon Nov 18 11:28:19 2013	(r258294)
+++ user/pho/stress2/misc/datamove3.sh	Mon Nov 18 11:29:25 2013	(r258295)
@@ -60,6 +60,32 @@ sysctl vm.old_msync=$old
 rm -rf /tmp/dl
 exit 0
 EOF
+/*-
+ * Copyright (c) 2006, Stephan Uphoff <ups@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice unmodified, this list of conditions, and the following
+ *    disclaimer.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include <err.h>
 #include <fcntl.h>
 #include <pthread.h>

From owner-svn-src-user@FreeBSD.ORG  Mon Nov 18 11:30:22 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id A51F6819;
 Mon, 18 Nov 2013 11:30:22 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 951002367;
 Mon, 18 Nov 2013 11:30:22 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIBUMfB059543;
 Mon, 18 Nov 2013 11:30:22 GMT (envelope-from pho@svn.freebsd.org)
Received: (from pho@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIBUMm9059542;
 Mon, 18 Nov 2013 11:30:22 GMT (envelope-from pho@svn.freebsd.org)
Message-Id: <201311181130.rAIBUMm9059542@svn.freebsd.org>
From: Peter Holm <pho@FreeBSD.org>
Date: Mon, 18 Nov 2013 11:30:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258296 - user/pho/stress2/misc
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Nov 2013 11:30:22 -0000

Author: pho
Date: Mon Nov 18 11:30:22 2013
New Revision: 258296
URL: http://svnweb.freebsd.org/changeset/base/258296

Log:
  Added old test scenario.
  
  Sponsored by:	EMC / Isilon storage division

Added:
  user/pho/stress2/misc/datamove4.sh   (contents, props changed)

Added: user/pho/stress2/misc/datamove4.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/pho/stress2/misc/datamove4.sh	Mon Nov 18 11:30:22 2013	(r258296)
@@ -0,0 +1,243 @@
+#!/bin/sh
+
+#
+# Copyright (c) 2012 Peter Holm <pho@FreeBSD.org>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 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.
+#
+# 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 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)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+#
+
+# Variation of the datamove2.sh, using TMPFS
+# Deadlock seen
+
+[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+
+. ../default.cfg
+
+here=`pwd`
+cd /tmp
+sed '1,/^EOF/d' < $here/$0 > dl.c
+cc -o dl -Wall -Wextra -O2 -g dl.c
+rm -f dl.c
+
+mount | grep -q "$mntpoint " && umount $mntpoint
+mount -t tmpfs tmpfs $mntpoint
+chmod 777 $mntpoint
+
+for i in `jot 5`; do
+	su $testuser -c "cd $mntpoint; /tmp/dl"
+done
+while mount | grep -q $mntpoint; do
+	umount -f $mntpoint > /dev/null 2>&1
+done
+
+rm -rf /tmp/dl
+exit 0
+EOF
+/*-
+ * Copyright (c) 2006, Stephan Uphoff <ups@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice unmodified, this list of conditions, and the following
+ *    disclaimer.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <err.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+
+
+int	prepareFile(char *filename, int *fdp);
+int	mapBuffer  (char **bufferp, int fd1, int fd2);
+int	startIO    (int fd, char *buffer);
+
+int	pagesize;
+
+#define FILESIZE (32*1024)
+char	wbuffer   [FILESIZE];
+
+/* Create a FILESIZE sized file - then remove file data from the cache */
+int 
+prepareFile(char *filename, int *fdp)
+{
+	int	fd;
+	int	len;
+	int	status;
+	void	*addr;
+
+	fd = open(filename, O_CREAT | O_TRUNC | O_RDWR, S_IRWXU);
+	if (fd == -1) {
+		perror(filename);
+		return fd;
+	}
+	len = write(fd, wbuffer, FILESIZE);
+	if (len < 0) {
+		perror("Write failed");
+		return 1;
+	}
+	status = fsync(fd);
+	if (status != 0) {
+		perror("fsync failed");
+		return 1;
+	}
+	addr = mmap(NULL, FILESIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+	if (addr == MAP_FAILED) {
+		perror("Mmap failed");
+		return 1;
+	}
+	status = msync(addr, FILESIZE, MS_INVALIDATE | MS_SYNC);
+	if (status != 0) {
+		perror("Msync failed");
+		return 1;
+	}
+	if (munmap(addr, FILESIZE) == -1) {
+		perror("munmap failed");
+		return 1;
+	}
+
+	*fdp = fd;
+	return 0;
+}
+
+
+/* mmap a 2 page buffer - first page is from fd1, second page from fd2 */
+int 
+mapBuffer(char **bufferp, int fd1, int fd2)
+{
+	void *addr;
+	char *buffer;
+
+	addr = mmap(NULL, pagesize * 2, PROT_READ | PROT_WRITE, MAP_SHARED, fd1, 0);
+	if (addr == MAP_FAILED) {
+		perror("Mmap failed");
+		return 1;
+	}
+	buffer = addr;
+	addr = mmap(buffer + pagesize, pagesize, PROT_READ | PROT_WRITE, MAP_FIXED |
+		    MAP_SHARED, fd2, 0);
+
+	if (addr == MAP_FAILED) {
+		perror("Mmap2 failed");
+		return 1;
+	}
+	*bufferp = buffer;
+	return 0;
+}
+
+void
+unmapBuffer(char *bufferp)
+{
+	if (munmap(bufferp, pagesize * 2) == -1)
+		err(1, "unmap 1. buffer");
+	if (munmap(bufferp + pagesize * 2, pagesize * 2) == -1)
+		err(1, "unmap 2. buffer");
+}
+
+int 
+startIO(int fd, char *buffer)
+{
+	ssize_t	len;
+
+	len = write(fd, buffer, 2 * pagesize);
+	if (len == -1) {
+		perror("write failed");
+		return 1;
+	}
+	return 0;
+}
+
+
+int 
+main()
+{
+
+	int	fdA, fdB, fdDelayA, fdDelayB;
+	int	status;
+	int	i;
+	char	*bufferA, *bufferB;
+	pid_t	pid;
+
+	pagesize = getpagesize();
+
+	for (i = 0; i < 1000; i++) {
+		if ((prepareFile("A", &fdA))
+		    || (prepareFile("B", &fdB))
+		    || (prepareFile("DelayA", &fdDelayA))
+		    || (prepareFile("DelayB", &fdDelayB))
+		    || (mapBuffer(&bufferA, fdDelayA, fdB))
+		    || (mapBuffer(&bufferB, fdDelayB, fdA)))
+			exit(1);
+
+		pid = fork();
+
+		if (pid == 0) {
+			status = startIO(fdA, bufferA);
+			exit(status);
+		}
+		if (pid == -1) {
+			perror("fork");
+			exit(1);
+		}
+		status = startIO(fdB, bufferB);
+		if (wait(&status) == -1)
+			err(1, "wait");
+
+		close(fdA);
+		close(fdB);
+		close(fdDelayA);
+		close(fdDelayB);
+		unmapBuffer(bufferA);
+		unmapBuffer(bufferB);
+		unlink("A");
+		unlink("B");
+		unlink("DelayA");
+		unlink("DelayB");
+	}
+	exit(status);
+
+}

From owner-svn-src-user@FreeBSD.ORG  Mon Nov 18 14:32:42 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id A19478FD;
 Mon, 18 Nov 2013 14:32:42 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 905072EA0;
 Mon, 18 Nov 2013 14:32:42 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIEWgXC030471;
 Mon, 18 Nov 2013 14:32:42 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIEWgSh030470;
 Mon, 18 Nov 2013 14:32:42 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201311181432.rAIEWgSh030470@svn.freebsd.org>
From: Nathan Whitehorn <nwhitehorn@FreeBSD.org>
Date: Mon, 18 Nov 2013 14:32:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258303 - user/nwhitehorn/condorports
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Nov 2013 14:32:42 -0000

Author: nwhitehorn
Date: Mon Nov 18 14:32:42 2013
New Revision: 258303
URL: http://svnweb.freebsd.org/changeset/base/258303

Log:
  Run ldconfig in jail to work around an apparent recent bug in pkg which
  triggers errors like this if run before (or without) /etc/rc:
  pkg-static: Cannot open "/var/run/ld-elf.so.hints": No such file or directory

Modified:
  user/nwhitehorn/condorports/buildport.sh

Modified: user/nwhitehorn/condorports/buildport.sh
==============================================================================
--- user/nwhitehorn/condorports/buildport.sh	Mon Nov 18 13:20:20 2013	(r258302)
+++ user/nwhitehorn/condorports/buildport.sh	Mon Nov 18 14:32:42 2013	(r258303)
@@ -15,6 +15,10 @@ scratchdir=$(pwd)
 set -e
 sudo /pkgscripts/prepbuildjail $_CONDOR_SLOT $release $portsdir
 cat $tarballname | sudo jexec $_CONDOR_SLOT tar xvf -
+
+# XXX: work around bug in pkg
+sudo jexec $_CONDOR_SLOT /etc/rc.d/ldconfig start
+
 sudo jexec $_CONDOR_SLOT make -C $port install USE_PACKAGE_DEPENDS=true BATCH=true WRKDIRPREFIX=/obj DISABLE_MAKE_JOBS=true PKGREPOSITORY=/packages PACKAGES=/packages DISTDIR=/distfiles
 sudo jexec $_CONDOR_SLOT make -C $port package PKGREPOSITORY=/packages PACKAGES=/packages BATCH=true NO_LATEST_LINK=true WRKDIRPREFIX=/obj
 sudo jexec $_CONDOR_SLOT cat /packages/$pkg > $scratchdir/$pkg

From owner-svn-src-user@FreeBSD.ORG  Mon Nov 18 14:33:45 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 091D89EC;
 Mon, 18 Nov 2013 14:33:45 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id ED4DE2EA9;
 Mon, 18 Nov 2013 14:33:44 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIEXiHb030732;
 Mon, 18 Nov 2013 14:33:44 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIEXiEx030730;
 Mon, 18 Nov 2013 14:33:44 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201311181433.rAIEXiEx030730@svn.freebsd.org>
From: Nathan Whitehorn <nwhitehorn@FreeBSD.org>
Date: Mon, 18 Nov 2013 14:33:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258304 - user/nwhitehorn/condorports
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Nov 2013 14:33:45 -0000

Author: nwhitehorn
Date: Mon Nov 18 14:33:44 2013
New Revision: 258304
URL: http://svnweb.freebsd.org/changeset/base/258304

Log:
  Some parts of ports introspect LOCALBASE to figure out what versions of
  things are in use. Disable this in scripts run on the build master.

Modified:
  user/nwhitehorn/condorports/buildportsdag.sh
  user/nwhitehorn/condorports/stagebuildfiles.sh

Modified: user/nwhitehorn/condorports/buildportsdag.sh
==============================================================================
--- user/nwhitehorn/condorports/buildportsdag.sh	Mon Nov 18 14:32:42 2013	(r258303)
+++ user/nwhitehorn/condorports/buildportsdag.sh	Mon Nov 18 14:33:44 2013	(r258304)
@@ -5,6 +5,7 @@
 : ${ARCH=`uname -p`}
 : ${RELEASE=$ARCH/`uname -r`}
 : ${STAGEDIR=$(pwd)/stage-$ARCH/$PKGSDIR}
+: ${__MAKE_CONF=/dev/null}; export __MAKE_CONF
 
 mkdir -p $STAGEDIR
 
@@ -31,7 +32,7 @@ for category in $(make -C $PORTSDIR -V S
 	echo VARS $job portsdir=\"$PORTSDIR\" >> $dagjobs
 	echo VARS $job stagetarball=\"$TARBALL\" >> $dagjobs
 	echo VARS $job release=\"$RELEASE\" >> $dagjobs
-	deps=$(make -V _DEPEND_DIRS)
+	deps=$(make -V _DEPEND_DIRS LOCALBASE=/var/empty)
 	if [ ! -z "$deps" ]; then
 		echo PARENT $deps CHILD $job >> $dagdeps
 	fi

Modified: user/nwhitehorn/condorports/stagebuildfiles.sh
==============================================================================
--- user/nwhitehorn/condorports/stagebuildfiles.sh	Mon Nov 18 14:32:42 2013	(r258303)
+++ user/nwhitehorn/condorports/stagebuildfiles.sh	Mon Nov 18 14:33:44 2013	(r258304)
@@ -5,6 +5,7 @@
 
 set -e
 export UNAME_p=$3
+export __MAKE_CONF=/dev/null
 DISTHORDE=$5
 
 # Fetch distfiles if unfetched
@@ -26,7 +27,7 @@ DIST_SUBDIR=$DISTHORDE/$(make -V DIST_SU
 ALLFILES=$(for f in `make -V ALLFILES`; do echo $DIST_SUBDIR/$f; done)
 
 # Find packages
-DEPENDS=`make all-depends-list`
+DEPENDS=`make all-depends-list LOCALBASE=/var/empty`
 PKGLIST=$(for x in $DEPENDS; do make -C $x PACKAGES=$2 -V PKGFILE; done)
 
 rm -rf $TARBALL-dir

From owner-svn-src-user@FreeBSD.ORG  Mon Nov 18 22:35:02 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id DF0C5BD0;
 Mon, 18 Nov 2013 22:35:02 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id CF24B2C07;
 Mon, 18 Nov 2013 22:35:02 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIMZ2cw034467;
 Mon, 18 Nov 2013 22:35:02 GMT (envelope-from ray@svn.freebsd.org)
Received: (from ray@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIMZ2qK034466;
 Mon, 18 Nov 2013 22:35:02 GMT (envelope-from ray@svn.freebsd.org)
Message-Id: <201311182235.rAIMZ2qK034466@svn.freebsd.org>
From: Aleksandr Rybalko <ray@FreeBSD.org>
Date: Mon, 18 Nov 2013 22:35:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258323 - user/ed/newcons/sys/dev/drm2
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Nov 2013 22:35:02 -0000

Author: ray
Date: Mon Nov 18 22:35:02 2013
New Revision: 258323
URL: http://svnweb.freebsd.org/changeset/base/258323

Log:
  Move mode_config up one level. DRM drivers call drm_fb_helper_restore_fbdev_mode
  	with that lock already held.
  
  Suggested by:	avg
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  user/ed/newcons/sys/dev/drm2/drm_fb_helper.c

Modified: user/ed/newcons/sys/dev/drm2/drm_fb_helper.c
==============================================================================
--- user/ed/newcons/sys/dev/drm2/drm_fb_helper.c	Mon Nov 18 22:18:07 2013	(r258322)
+++ user/ed/newcons/sys/dev/drm2/drm_fb_helper.c	Mon Nov 18 22:35:02 2013	(r258323)
@@ -49,10 +49,14 @@ static void vt_restore_fbdev_mode(void *
 static void
 vt_restore_fbdev_mode(void *arg, int pending)
 {
+	struct drm_fb_helper *fb_helper;
 	struct vt_kms_softc *sc;
 
 	sc = (struct vt_kms_softc *)arg;
-	drm_fb_helper_restore_fbdev_mode(sc->fb_helper);
+	fb_helper = sc->fb_helper;
+	sx_xlock(&fb_helper->dev->mode_config.mutex);
+	drm_fb_helper_restore_fbdev_mode(fb_helper);
+	sx_xunlock(&fb_helper->dev->mode_config.mutex);
 }
 
 static int
@@ -385,9 +389,7 @@ bool drm_fb_helper_restore_fbdev_mode(st
 	int i, ret;
 	for (i = 0; i < fb_helper->crtc_count; i++) {
 		struct drm_mode_set *mode_set = &fb_helper->crtc_info[i].mode_set;
-		sx_xlock(&fb_helper->dev->mode_config.mutex);
 		ret = drm_crtc_helper_set_config(mode_set);
-		sx_xunlock(&fb_helper->dev->mode_config.mutex);
 		if (ret)
 			error = true;
 	}

From owner-svn-src-user@FreeBSD.ORG  Mon Nov 18 22:39:34 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C706CE1C;
 Mon, 18 Nov 2013 22:39:34 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id B582A2C2E;
 Mon, 18 Nov 2013 22:39:34 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIMdYAn042118;
 Mon, 18 Nov 2013 22:39:34 GMT (envelope-from ray@svn.freebsd.org)
Received: (from ray@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIMdYIY042117;
 Mon, 18 Nov 2013 22:39:34 GMT (envelope-from ray@svn.freebsd.org)
Message-Id: <201311182239.rAIMdYIY042117@svn.freebsd.org>
From: Aleksandr Rybalko <ray@FreeBSD.org>
Date: Mon, 18 Nov 2013 22:39:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258325 - user/ed/newcons/sys/dev/vt
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Nov 2013 22:39:34 -0000

Author: ray
Date: Mon Nov 18 22:39:34 2013
New Revision: 258325
URL: http://svnweb.freebsd.org/changeset/base/258325

Log:
  Switch to use atomic ops for VT window flags, because some modifications can
  come from another thread.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  user/ed/newcons/sys/dev/vt/vt_core.c

Modified: user/ed/newcons/sys/dev/vt/vt_core.c
==============================================================================
--- user/ed/newcons/sys/dev/vt/vt_core.c	Mon Nov 18 22:37:01 2013	(r258324)
+++ user/ed/newcons/sys/dev/vt/vt_core.c	Mon Nov 18 22:39:34 2013	(r258325)
@@ -355,7 +355,7 @@ vt_scrollmode_kbdevent(struct vt_window 
 		/* Turn scrolling off. */
 		vt_scroll(vw, 0, VHS_END);
 		VTBUF_SLCK_DISABLE(&vw->vw_buf);
-		vw->vw_flags &= ~VWF_SCROLL;
+		atomic_clear_int(&vw->vw_flags, VWF_SCROLL);
 		break;
 	}
 	case FKEY | F(49): /* Home key. */
@@ -438,11 +438,11 @@ vt_processkey(keyboard_t *kbd, struct vt
 			VT_LOCK(vd);
 			if (state & SLKED) {
 				/* Turn scrolling on. */
-				vw->vw_flags |= VWF_SCROLL;
+				atomic_set_int(&vw->vw_flags, VWF_SCROLL);
 				VTBUF_SLCK_ENABLE(&vw->vw_buf);
 			} else {
 				/* Turn scrolling off. */
-				vw->vw_flags &= ~VWF_SCROLL;
+				atomic_clear_int(&vw->vw_flags, VWF_SCROLL);
 				VTBUF_SLCK_DISABLE(&vw->vw_buf);
 				vt_scroll(vw, 0, VHS_END);
 			}
@@ -889,12 +889,12 @@ vtterm_cngetc(struct terminal *tm)
 			kbdd_ioctl(kbd, KDGKBSTATE, (caddr_t)&state);
 			if (state & SLKED) {
 				/* Turn scrolling on. */
-				vw->vw_flags |= VWF_SCROLL;
+				atomic_set_int(&vw->vw_flags, VWF_SCROLL);
 				VTBUF_SLCK_ENABLE(&vw->vw_buf);
 			} else {
 				/* Turn scrolling off. */
 				vt_scroll(vw, 0, VHS_END);
-				vw->vw_flags &= ~VWF_SCROLL;
+				atomic_clear_int(&vw->vw_flags, VWF_SCROLL);
 				VTBUF_SLCK_DISABLE(&vw->vw_buf);
 			}
 			break;
@@ -934,9 +934,9 @@ vtterm_opened(struct terminal *tm, int o
 	VT_LOCK(vd);
 	vd->vd_flags &= ~VDF_SPLASH;
 	if (opened)
-		vw->vw_flags |= VWF_OPENED;
+		atomic_set_int(&vw->vw_flags, VWF_OPENED);
 	else {
-		vw->vw_flags &= ~VWF_OPENED;
+		atomic_clear_int(&vw->vw_flags, VWF_OPENED);
 		/* TODO: finish ACQ/REL */
 	}
 	VT_UNLOCK(vd);
@@ -974,7 +974,7 @@ vt_change_font(struct vt_window *vw, str
 		VT_UNLOCK(vd);
 		return (ENOTTY);
 	}
-	vw->vw_flags |= VWF_BUSY;
+	atomic_set_int(&vw->vw_flags, VWF_BUSY);
 	VT_UNLOCK(vd);
 
 	vt_termsize(vd, vf, &size);
@@ -997,7 +997,7 @@ vt_change_font(struct vt_window *vw, str
 	/* Force a full redraw the next timer tick. */
 	if (vd->vd_curwindow == vw)
 		vd->vd_flags |= VDF_INVALID;
-	vw->vw_flags &= ~VWF_BUSY;
+	atomic_clear_int(&vw->vw_flags, VWF_BUSY);
 	VT_UNLOCK(vd);
 	return (0);
 }
@@ -1034,7 +1034,7 @@ signal_vt_rel(struct vt_window *vw)
 		vw->vw_pid = 0;
 		return TRUE;
 	}
-	vw->vw_flags |= VWF_SWWAIT_REL;
+	atomic_set_int(&vw->vw_flags, VWF_SWWAIT_REL);
 	PROC_LOCK(vw->vw_proc);
 	kern_psignal(vw->vw_proc, vw->vw_smode.relsig);
 	PROC_UNLOCK(vw->vw_proc);
@@ -1055,7 +1055,7 @@ signal_vt_acq(struct vt_window *vw)
 		vw->vw_pid = 0;
 		return TRUE;
 	}
-	vw->vw_flags |= VWF_SWWAIT_ACQ;
+	atomic_set_int(&vw->vw_flags, VWF_SWWAIT_ACQ);
 	PROC_LOCK(vw->vw_proc);
 	kern_psignal(vw->vw_proc, vw->vw_smode.acqsig);
 	PROC_UNLOCK(vw->vw_proc);
@@ -1068,7 +1068,7 @@ finish_vt_rel(struct vt_window *vw, int 
 {
 
 	if (vw->vw_flags & VWF_SWWAIT_REL) {
-		vw->vw_flags &= ~VWF_SWWAIT_REL;
+		atomic_clear_int(&vw->vw_flags, VWF_SWWAIT_REL);
 		if (release) {
 			callout_drain(&vw->vw_proc_dead_timer);
 			vt_late_window_switch(vw->vw_switch_to);
@@ -1083,7 +1083,7 @@ finish_vt_acq(struct vt_window *vw)
 {
 
 	if (vw->vw_flags & VWF_SWWAIT_ACQ) {
-		vw->vw_flags &= ~VWF_SWWAIT_ACQ;
+		atomic_clear_int(&vw->vw_flags, VWF_SWWAIT_ACQ);
 		return 0;
 	}
 	return EINVAL;
@@ -1392,9 +1392,9 @@ vtterm_ioctl(struct terminal *tm, u_long
 	case VT_LOCKSWITCH:
 		/* TODO: Check current state, switching can be in progress. */
 		if ((*(int *)data) & 0x01)
-			vw->vw_flags |= VWF_VTYLOCK;
+			atomic_set_int(&vw->vw_flags, VWF_VTYLOCK);
 		else
-			vw->vw_flags &= ~VWF_VTYLOCK;
+			atomic_clear_int(&vw->vw_flags, VWF_VTYLOCK);
 	case VT_OPENQRY: {
 		unsigned int i;
 

From owner-svn-src-user@FreeBSD.ORG  Mon Nov 18 22:55:51 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 7B69E760;
 Mon, 18 Nov 2013 22:55:51 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6A5C32E29;
 Mon, 18 Nov 2013 22:55:51 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIMtpeV048503;
 Mon, 18 Nov 2013 22:55:51 GMT (envelope-from ray@svn.freebsd.org)
Received: (from ray@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIMtoB1048498;
 Mon, 18 Nov 2013 22:55:50 GMT (envelope-from ray@svn.freebsd.org)
Message-Id: <201311182255.rAIMtoB1048498@svn.freebsd.org>
From: Aleksandr Rybalko <ray@FreeBSD.org>
Date: Mon, 18 Nov 2013 22:55:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258327 - user/ed/newcons/sys/dev/vt
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Nov 2013 22:55:51 -0000

Author: ray
Date: Mon Nov 18 22:55:50 2013
New Revision: 258327
URL: http://svnweb.freebsd.org/changeset/base/258327

Log:
  Notify terminal about process on current terminal start to use mouse on a
  different "mouse level".
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  user/ed/newcons/sys/dev/vt/vt.h
  user/ed/newcons/sys/dev/vt/vt_core.c
  user/ed/newcons/sys/dev/vt/vt_sysmouse.c

Modified: user/ed/newcons/sys/dev/vt/vt.h
==============================================================================
--- user/ed/newcons/sys/dev/vt/vt.h	Mon Nov 18 22:53:24 2013	(r258326)
+++ user/ed/newcons/sys/dev/vt/vt.h	Mon Nov 18 22:55:50 2013	(r258327)
@@ -241,6 +241,7 @@ struct vt_window {
 #define	VWF_SCROLL	0x4	/* Keys influence scrollback. */
 #define	VWF_CONSOLE	0x8	/* Kernel message console window. */
 #define	VWF_VTYLOCK	0x10	/* Prevent window switch. */
+#define	VWF_MOUSE_HIDE	0x20	/* Disable mouse events processing. */
 #define	VWF_SWWAIT_REL	0x10000	/* Program wait for VT acquire is done. */
 #define	VWF_SWWAIT_ACQ	0x20000	/* Program wait for VT release is done. */
 	pid_t			 vw_pid;	/* Terminal holding process */
@@ -401,5 +402,9 @@ int		 vtfont_load(vfnt_t *f, struct vt_f
 /* Sysmouse. */
 void sysmouse_process_event(mouse_info_t *mi);
 void vt_mouse_event(int type, int x, int y, int event, int cnt);
+void vt_mouse_state(int show);
+#define	VT_MOUSE_SHOW 1
+#define	VT_MOUSE_HIDE 0
 
 #endif /* !_DEV_VT_VT_H_ */
+

Modified: user/ed/newcons/sys/dev/vt/vt_core.c
==============================================================================
--- user/ed/newcons/sys/dev/vt/vt_core.c	Mon Nov 18 22:53:24 2013	(r258326)
+++ user/ed/newcons/sys/dev/vt/vt_core.c	Mon Nov 18 22:55:50 2013	(r258327)
@@ -705,8 +705,11 @@ vt_flush(struct vt_device *vd)
 		vd->vd_flags &= ~VDF_INVALID;
 	}
 
-	/* Mark last mouse position as dirty to erase. */
-	vtbuf_mouse_cursor_position(&vw->vw_buf, vd->vd_mdirtyx, vd->vd_mdirtyy);
+	if ((vw->vw_flags & VWF_MOUSE_HIDE) == 0) {
+		/* Mark last mouse position as dirty to erase. */
+		vtbuf_mouse_cursor_position(&vw->vw_buf, vd->vd_mdirtyx,
+		    vd->vd_mdirtyy);
+	}
 
 	for (row = tarea.tr_begin.tp_row; row < tarea.tr_end.tp_row; row++) {
 		if (!VTBUF_DIRTYROW(&tmask, row))
@@ -722,6 +725,10 @@ vt_flush(struct vt_device *vd)
 		}
 	}
 
+	/* Mouse disabled. */
+	if (vw->vw_flags & VWF_MOUSE_HIDE)
+		return;
+
 	/* No mouse for DDB. */
 	if (kdb_active || panicstr != NULL)
 		return;
@@ -1103,6 +1110,9 @@ vt_mouse_event(int type, int x, int y, i
 	vw = vd->vd_curwindow;
 	vf = vw->vw_font;
 
+	if (vw->vw_flags & VWF_MOUSE_HIDE)
+		return; /* Mouse disabled. */
+
 	if (vf == NULL)	/* Text mode. */
 		return;
 
@@ -1226,6 +1236,25 @@ vt_mouse_event(int type, int x, int y, i
 	}
 }
 
+void
+vt_mouse_state(int show)
+{
+	struct vt_device *vd;
+	struct vt_window *vw;
+
+	vd = main_vd;
+	vw = vd->vd_curwindow;
+
+	switch (show) {
+	case VT_MOUSE_HIDE:
+		atomic_set_int(&vw->vw_flags, VWF_MOUSE_HIDE);
+		break;
+	case VT_MOUSE_SHOW:
+		atomic_clear_int(&vw->vw_flags, VWF_MOUSE_HIDE);
+		break;
+	}
+}
+
 static int
 vtterm_ioctl(struct terminal *tm, u_long cmd, caddr_t data,
     struct thread *td)

Modified: user/ed/newcons/sys/dev/vt/vt_sysmouse.c
==============================================================================
--- user/ed/newcons/sys/dev/vt/vt_sysmouse.c	Mon Nov 18 22:53:24 2013	(r258326)
+++ user/ed/newcons/sys/dev/vt/vt_sysmouse.c	Mon Nov 18 22:55:50 2013	(r258327)
@@ -224,6 +224,7 @@ sysmouse_close(struct cdev *dev, int ffl
 	mtx_lock(&sysmouse_lock);
 	free(sysmouse_buffer, M_SYSMOUSE);
 	sysmouse_buffer = NULL;
+	sysmouse_level = 0;
 	mtx_unlock(&sysmouse_lock);
 
 	return (0);
@@ -344,6 +345,7 @@ sysmouse_ioctl(struct cdev *dev, u_long 
 			return (EINVAL);
 
 		sysmouse_level = level;
+		vt_mouse_state((level == 0)?VT_MOUSE_SHOW:VT_MOUSE_HIDE);
 		return (0);
 	}
 	case MOUSE_SETMODE: {
@@ -356,6 +358,8 @@ sysmouse_ioctl(struct cdev *dev, u_long 
 		case 0:
 		case 1:
 			sysmouse_level = mode->level;
+			vt_mouse_state((mode->level == 0)?VT_MOUSE_SHOW:
+			    VT_MOUSE_HIDE);
 			break;
 		default:
 			return (EINVAL);

From owner-svn-src-user@FreeBSD.ORG  Tue Nov 19 01:07:26 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 6FA84108;
 Tue, 19 Nov 2013 01:07:26 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 506962784;
 Tue, 19 Nov 2013 01:07:26 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJ17QPa064740;
 Tue, 19 Nov 2013 01:07:26 GMT (envelope-from glebius@svn.freebsd.org)
Received: (from glebius@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJ17PYZ064737;
 Tue, 19 Nov 2013 01:07:25 GMT (envelope-from glebius@svn.freebsd.org)
Message-Id: <201311190107.rAJ17PYZ064737@svn.freebsd.org>
From: Gleb Smirnoff <glebius@FreeBSD.org>
Date: Tue, 19 Nov 2013 01:07:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258334 - user/glebius/course/07.io
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 19 Nov 2013 01:07:26 -0000

Author: glebius
Date: Tue Nov 19 01:07:25 2013
New Revision: 258334
URL: http://svnweb.freebsd.org/changeset/base/258334

Log:
  Some words on i/o.

Added:
  user/glebius/course/07.io/
  user/glebius/course/07.io/Makefile
     - copied unchanged from r258318, user/glebius/course/01.intro/Makefile
  user/glebius/course/07.io/lection.tex
  user/glebius/course/07.io/vtblk_strategy.d

Copied: user/glebius/course/07.io/Makefile (from r258318, user/glebius/course/01.intro/Makefile)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/glebius/course/07.io/Makefile	Tue Nov 19 01:07:25 2013	(r258334, copy of r258318, user/glebius/course/01.intro/Makefile)
@@ -0,0 +1,17 @@
+NAME?=	lection
+
+TMP=	$(NAME).aux $(NAME).log $(NAME).nav $(NAME).out $(NAME).snm \
+	$(NAME).toc $(NAME).vrb
+
+.MAIN: $(NAME).pdf
+
+.SUFFIXES:	.pdf .tex
+.tex.pdf:
+	pdflatex -file-line-error -halt-on-error ${.IMPSRC}
+
+clean:
+	rm -f -- $(TMP) texput.log
+
+cleanall:
+	make clean
+	rm -f $(NAME).pdf

Added: user/glebius/course/07.io/lection.tex
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/glebius/course/07.io/lection.tex	Tue Nov 19 01:07:25 2013	(r258334)
@@ -0,0 +1,223 @@
+\documentclass{beamer}
+
+\usepackage[utf8]{inputenc}
+\usepackage[russian]{babel}
+\usepackage{tikz}
+\usepackage{adjustbox}
+\usepackage{url}
+\usepackage{array}
+\usepackage{xcolor}
+\usepackage{listings}
+\usepackage{verbatim}
+\usepackage{ifthen}
+
+\usetikzlibrary{positioning}
+\usetikzlibrary{shapes}
+\usetikzlibrary{decorations.pathmorphing}
+
+\input{../course.tex}
+
+\title{Input/Output system: files and VFS}
+
+\begin{document}
+
+\begin{frame}
+\titlepage
+\end{frame}
+
+
+\begin{frame}
+\frametitle{read(2), readv(2), write(2), writev(2)}
+\begin{itemize}
+\onslide <1-> {
+  \item {Syscall handler fills in \emph{struct uio}.}
+}
+\onslide <2-> {
+  \item {Generic descriptor read/write handler 
+	 resolves file descriptor to \emph{struct file}.}
+  \item {Method from \emph{struct file} is called: fo\_read or fo\_write.}
+}
+\onslide <3-> {
+  \item {Vnode method passes \emph{uio} into VFS(9)}
+}
+\onslide <4-> {
+  \item {Eventually \emph{struct bio} reaches GEOM(4) \ldots}
+  \item {\ldots and a disk driver}
+}
+\end{itemize}
+\end{frame}
+
+
+\FootReferences{uiomove(9)}{sys/sys/uio.h}
+\begin{frame}[fragile]
+\frametitle{The user input/output structure}
+\begin{verbatim}
+struct uio {
+  struct  iovec *uio_iov;    /* scatter/gather list */
+  int     uio_iovcnt;        /* length of scatter/gather list */
+  off_t   uio_offset;        /* offset in target object */
+  ssize_t uio_resid;         /* remaining bytes to copy */
+  enum    uio_seg uio_segflg;/* address space */
+  enum    uio_rw uio_rw;     /* operation */
+  struct  thread *uio_td;    /* owner */
+};
+\end{verbatim}
+\end{frame}
+
+
+\FootReferences{}{sys/kern/sys\_generic.c, sys/kern/kern\_descrip.c}
+\begin{frame}
+\only<1> {
+  \frametitle{Resolving descriptor to \emph{struct file}}
+}
+\only<2> {
+  \frametitle{Resolving descriptor to \emph{struct file}\\
+	      \ldots and \emph{fo\_write} calling method on it}
+}
+\onslide<1-> {
+  sys/sys\_generic.c:kern\_writev():
+  \srcline {%
+	fget\_write(td, fd, cap\_rights\_init(\&rights, CAP\_WRITE), \&file);
+  }
+}
+\onslide<2-> {
+  sys/sys\_generic.c:dofilewrite():
+  \srcline {%
+	fo\_write(fp, auio, td->td\_ucred, flags, td);
+  }
+}
+\end{frame}
+
+
+\FootReferences{}{sys/sys/file.h}
+\begin{frame}[fragile]
+\frametitle{File methods}
+\small\begin{verbatim}
+typedef int fo_rdwr_t(struct file *fp, struct uio *uio,
+  struct ucred *active_cred, int flags,
+  struct thread *td);
+...
+struct fileops {
+  fo_rdwr_t       *fo_read;
+  fo_rdwr_t       *fo_write;
+  fo_truncate_t   *fo_truncate;
+  fo_ioctl_t      *fo_ioctl;
+  fo_poll_t       *fo_poll;
+  fo_kqfilter_t   *fo_kqfilter;
+  fo_stat_t       *fo_stat;
+  fo_close_t      *fo_close;
+  fo_chmod_t      *fo_chmod;
+  fo_chown_t      *fo_chown;
+  fo_sendfile_t   *fo_sendfile;
+  fo_seek_t       *fo_seek;
+};
+\end{verbatim}
+\end{frame}
+
+
+\FootReferences{}{sys/sys/file.h}
+\begin{frame}[fragile]
+\frametitle{Calling file operations (methods)}
+\small\begin{verbatim}
+static inline int
+fo_write(struct file *fp, struct uio *uio,
+  struct ucred *cred, int flags, struct thread *td)
+{
+
+    return ((*fp->f_ops->fo_write)(fp, uio, cred,
+      flags, td));
+}
+\end{verbatim}
+\onslide <2-> {
+\begin{itemize}
+  \item{Any \emph{struct file} has a valid f\_ops pointer.}
+  \item{Dead file's f\_ops point at \&badfileops.}
+\end{itemize}
+}
+\end{frame}
+
+
+\FootReferences{vnode(9)}{sys/kern/vfs\_vnops.c}
+\begin{frame}[fragile]
+\frametitle{a vnode(9) backed file}
+\srcline{%
+  fp->f\_type == DTYPE\_VNODE\\
+  fp->f\_ops == \&vnops\\
+  fp->f\_vnode != NULL
+}
+\small\begin{verbatim}
+struct vnode {
+  ...
+  enum    vtype v_type;         /* vnode type */
+  struct  vop_vector *v_op;     /* vnode operations vector */
+  void    *v_data;              /* private data for fs */
+  struct  mount *v_mount;       /* ptr to vfs we are in */
+  int     v_usecount;           /* ref count of users */
+  int     v_holdcnt;            /* prevents recycling. */
+  struct bufobj   v_bufobj;     /* Buffer cache object */
+  ...
+}
+\end{verbatim}}
+\end{frame}
+
+
+\FootReferences{vnode(9), VFS(9)}
+	{sys/kern/vfs\_default.c, ufs/ffs/ffs\_vnops.c, ufs/ufs/ufs\_vnops.c}
+\begin{frame}
+\frametitle{VFS(9) - object oriented approach to vnodes}
+\only <1> {
+  VOP\_READ() resolves to the first vop, that supports read.
+}
+\only <2> {
+  VFS(9) example: ffs/ufs vops.
+}
+\begin{figure}
+\small\begin{tikzpicture}
+\only <1> {
+  \node [name=vop1, struct, rectangle split parts=6] {
+	\textbf{struct vop\_vector}
+	\nodepart{two}struct vop\_vector *vop\_default 
+	\nodepart{three}vop\_read\_t vop\_read
+	\nodepart{four}vop\_write\_t vop\_write
+	\nodepart{five}\ldots
+	\nodepart{six}\textit{up to 70 ops}
+  };
+  \node [name=vop2, struct, right=of vop1.north east, anchor=north west,
+	 rectangle split parts=4] {
+	\textbf{struct vop\_vector}
+	\nodepart{two}struct vop\_vector *vop\_default 
+	\nodepart{three}vop\_strategy\_t vop\_strategy
+	\nodepart{four}\ldots
+  };
+  \node [name=vop3, struct, below=of vop2, rectangle split parts=1] {
+	\textbf{struct vop\_vector}
+  };
+  \draw [pointer] (vop1.two east) to [out=0, in=180] (vop2.one west);
+  \draw [pointer] (vop2.two east) -- +(5mm, 0) |- (vop3);
+}
+\only <2> {
+  \node [name=vop1, struct, rectangle split parts=5] {
+	\textbf{ffs\_vnodeops}
+	\nodepart{two}vop\_default 
+	\nodepart{three}vop\_read = ffs\_read
+	\nodepart{four}vop\_write = ffs\_write
+	\nodepart{five}\ldots
+  };
+  \node [name=vop2, struct, right=of vop1.north east, anchor=north west,
+	 rectangle split parts=4] {
+	\textbf{ufs\_vnodeops}
+	\nodepart{two}vop\_default 
+	\nodepart{three}vop\_strategy = ufs\_strategy
+	\nodepart{four}\ldots
+  };
+  \node [name=vop3, struct, below=of vop2, rectangle split parts=1] {
+	\textbf{default\_vnodeops}
+  };
+  \draw [pointer] (vop1.two east) to [out=0, in=180] (vop2.one west);
+  \draw [pointer] (vop2.two east) -- +(5mm, 0) |- (vop3);
+}
+\end{tikzpicture}
+\end{figure}
+\end{frame}
+
+\end{document}

Added: user/glebius/course/07.io/vtblk_strategy.d
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/glebius/course/07.io/vtblk_strategy.d	Tue Nov 19 01:07:25 2013	(r258334)
@@ -0,0 +1,9 @@
+#!/usr/sbin/dtrace -s
+
+/* see virtio_blk(4) */
+
+fbt::vtblk_strategy:entry /execname == "dd"/
+{
+	stack(30);
+	exit(0);
+}

From owner-svn-src-user@FreeBSD.ORG  Wed Nov 20 16:42:11 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 618EDD74;
 Wed, 20 Nov 2013 16:42:11 +0000 (UTC)
Received: from anacreon.physics.wisc.edu (unknown
 [IPv6:2607:f388:101c:0:216:cbff:fe39:3fae])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id DC392285E;
 Wed, 20 Nov 2013 16:42:10 +0000 (UTC)
Received: from anacreon.physics.wisc.edu (localhost [IPv6:::1])
 by anacreon.physics.wisc.edu (8.14.7/8.14.7) with ESMTP id rAKGg89g049926;
 Wed, 20 Nov 2013 10:42:08 -0600 (CST)
 (envelope-from nwhitehorn@freebsd.org)
Message-ID: <528CE660.5070004@freebsd.org>
Date: Wed, 20 Nov 2013 10:42:08 -0600
From: Nathan Whitehorn <nwhitehorn@freebsd.org>
User-Agent: Mozilla/5.0 (X11; FreeBSD powerpc;
 rv:24.0) Gecko/20100101 Thunderbird/24.0
MIME-Version: 1.0
To: Aleksandr Rybalko <ray@FreeBSD.org>, src-committers@freebsd.org,
 svn-src-user@freebsd.org
Subject: Re: svn commit: r258325 - user/ed/newcons/sys/dev/vt
References: <201311182239.rAIMdYIY042117@svn.freebsd.org>
In-Reply-To: <201311182239.rAIMdYIY042117@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Nov 2013 16:42:11 -0000

These atomic ops don't have their desired effect. On many platforms,
atomic_set_int()/clear_int() are just a = b, so most of this diff is a
no-op. The larger problem is code like this:

 	if (vw->vw_flags & VWF_SWWAIT_ACQ) {
		atomic_clear_int(&vw->vw_flags, VWF_SWWAIT_ACQ);

This is racy, because the entire check-and-clear operation is not
atomic. You probably want some variation on atomic_cmpset() (in a loop).
Depending on what the rest of the code is doing, you may just need
mutexes to avoid races.
-Nathan

On 11/18/13 16:39, Aleksandr Rybalko wrote:
> Author: ray
> Date: Mon Nov 18 22:39:34 2013
> New Revision: 258325
> URL: http://svnweb.freebsd.org/changeset/base/258325
>
> Log:
>   Switch to use atomic ops for VT window flags, because some modifications can
>   come from another thread.
>   
>   Sponsored by:	The FreeBSD Foundation
>
> Modified:
>   user/ed/newcons/sys/dev/vt/vt_core.c
>
> Modified: user/ed/newcons/sys/dev/vt/vt_core.c
> ==============================================================================
> --- user/ed/newcons/sys/dev/vt/vt_core.c	Mon Nov 18 22:37:01 2013	(r258324)
> +++ user/ed/newcons/sys/dev/vt/vt_core.c	Mon Nov 18 22:39:34 2013	(r258325)
> @@ -355,7 +355,7 @@ vt_scrollmode_kbdevent(struct vt_window 
>  		/* Turn scrolling off. */
>  		vt_scroll(vw, 0, VHS_END);
>  		VTBUF_SLCK_DISABLE(&vw->vw_buf);
> -		vw->vw_flags &= ~VWF_SCROLL;
> +		atomic_clear_int(&vw->vw_flags, VWF_SCROLL);
>  		break;
>  	}
>  	case FKEY | F(49): /* Home key. */
> @@ -438,11 +438,11 @@ vt_processkey(keyboard_t *kbd, struct vt
>  			VT_LOCK(vd);
>  			if (state & SLKED) {
>  				/* Turn scrolling on. */
> -				vw->vw_flags |= VWF_SCROLL;
> +				atomic_set_int(&vw->vw_flags, VWF_SCROLL);
>  				VTBUF_SLCK_ENABLE(&vw->vw_buf);
>  			} else {
>  				/* Turn scrolling off. */
> -				vw->vw_flags &= ~VWF_SCROLL;
> +				atomic_clear_int(&vw->vw_flags, VWF_SCROLL);
>  				VTBUF_SLCK_DISABLE(&vw->vw_buf);
>  				vt_scroll(vw, 0, VHS_END);
>  			}
> @@ -889,12 +889,12 @@ vtterm_cngetc(struct terminal *tm)
>  			kbdd_ioctl(kbd, KDGKBSTATE, (caddr_t)&state);
>  			if (state & SLKED) {
>  				/* Turn scrolling on. */
> -				vw->vw_flags |= VWF_SCROLL;
> +				atomic_set_int(&vw->vw_flags, VWF_SCROLL);
>  				VTBUF_SLCK_ENABLE(&vw->vw_buf);
>  			} else {
>  				/* Turn scrolling off. */
>  				vt_scroll(vw, 0, VHS_END);
> -				vw->vw_flags &= ~VWF_SCROLL;
> +				atomic_clear_int(&vw->vw_flags, VWF_SCROLL);
>  				VTBUF_SLCK_DISABLE(&vw->vw_buf);
>  			}
>  			break;
> @@ -934,9 +934,9 @@ vtterm_opened(struct terminal *tm, int o
>  	VT_LOCK(vd);
>  	vd->vd_flags &= ~VDF_SPLASH;
>  	if (opened)
> -		vw->vw_flags |= VWF_OPENED;
> +		atomic_set_int(&vw->vw_flags, VWF_OPENED);
>  	else {
> -		vw->vw_flags &= ~VWF_OPENED;
> +		atomic_clear_int(&vw->vw_flags, VWF_OPENED);
>  		/* TODO: finish ACQ/REL */
>  	}
>  	VT_UNLOCK(vd);
> @@ -974,7 +974,7 @@ vt_change_font(struct vt_window *vw, str
>  		VT_UNLOCK(vd);
>  		return (ENOTTY);
>  	}
> -	vw->vw_flags |= VWF_BUSY;
> +	atomic_set_int(&vw->vw_flags, VWF_BUSY);
>  	VT_UNLOCK(vd);
>  
>  	vt_termsize(vd, vf, &size);
> @@ -997,7 +997,7 @@ vt_change_font(struct vt_window *vw, str
>  	/* Force a full redraw the next timer tick. */
>  	if (vd->vd_curwindow == vw)
>  		vd->vd_flags |= VDF_INVALID;
> -	vw->vw_flags &= ~VWF_BUSY;
> +	atomic_clear_int(&vw->vw_flags, VWF_BUSY);
>  	VT_UNLOCK(vd);
>  	return (0);
>  }
> @@ -1034,7 +1034,7 @@ signal_vt_rel(struct vt_window *vw)
>  		vw->vw_pid = 0;
>  		return TRUE;
>  	}
> -	vw->vw_flags |= VWF_SWWAIT_REL;
> +	atomic_set_int(&vw->vw_flags, VWF_SWWAIT_REL);
>  	PROC_LOCK(vw->vw_proc);
>  	kern_psignal(vw->vw_proc, vw->vw_smode.relsig);
>  	PROC_UNLOCK(vw->vw_proc);
> @@ -1055,7 +1055,7 @@ signal_vt_acq(struct vt_window *vw)
>  		vw->vw_pid = 0;
>  		return TRUE;
>  	}
> -	vw->vw_flags |= VWF_SWWAIT_ACQ;
> +	atomic_set_int(&vw->vw_flags, VWF_SWWAIT_ACQ);
>  	PROC_LOCK(vw->vw_proc);
>  	kern_psignal(vw->vw_proc, vw->vw_smode.acqsig);
>  	PROC_UNLOCK(vw->vw_proc);
> @@ -1068,7 +1068,7 @@ finish_vt_rel(struct vt_window *vw, int 
>  {
>  
>  	if (vw->vw_flags & VWF_SWWAIT_REL) {
> -		vw->vw_flags &= ~VWF_SWWAIT_REL;
> +		atomic_clear_int(&vw->vw_flags, VWF_SWWAIT_REL);
>  		if (release) {
>  			callout_drain(&vw->vw_proc_dead_timer);
>  			vt_late_window_switch(vw->vw_switch_to);
> @@ -1083,7 +1083,7 @@ finish_vt_acq(struct vt_window *vw)
>  {
>  
>  	if (vw->vw_flags & VWF_SWWAIT_ACQ) {
> -		vw->vw_flags &= ~VWF_SWWAIT_ACQ;
> +		atomic_clear_int(&vw->vw_flags, VWF_SWWAIT_ACQ);
>  		return 0;
>  	}
>  	return EINVAL;
> @@ -1392,9 +1392,9 @@ vtterm_ioctl(struct terminal *tm, u_long
>  	case VT_LOCKSWITCH:
>  		/* TODO: Check current state, switching can be in progress. */
>  		if ((*(int *)data) & 0x01)
> -			vw->vw_flags |= VWF_VTYLOCK;
> +			atomic_set_int(&vw->vw_flags, VWF_VTYLOCK);
>  		else
> -			vw->vw_flags &= ~VWF_VTYLOCK;
> +			atomic_clear_int(&vw->vw_flags, VWF_VTYLOCK);
>  	case VT_OPENQRY: {
>  		unsigned int i;
>  


From owner-svn-src-user@FreeBSD.ORG  Wed Nov 20 22:54:10 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id DC25E746;
 Wed, 20 Nov 2013 22:54:09 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id CC1A32F71;
 Wed, 20 Nov 2013 22:54:09 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKMs9lu006704;
 Wed, 20 Nov 2013 22:54:09 GMT (envelope-from ray@svn.freebsd.org)
Received: (from ray@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKMs98T006703;
 Wed, 20 Nov 2013 22:54:09 GMT (envelope-from ray@svn.freebsd.org)
Message-Id: <201311202254.rAKMs98T006703@svn.freebsd.org>
From: Aleksandr Rybalko <ray@FreeBSD.org>
Date: Wed, 20 Nov 2013 22:54:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258408 - user/ed/newcons/sys/dev/vt
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Nov 2013 22:54:10 -0000

Author: ray
Date: Wed Nov 20 22:54:09 2013
New Revision: 258408
URL: http://svnweb.freebsd.org/changeset/base/258408

Log:
  Revert r258324. There mutexes should be used instead of atomics.
  
  Pointed by:	kib, nwhitehorn
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  user/ed/newcons/sys/dev/vt/vt_core.c

Modified: user/ed/newcons/sys/dev/vt/vt_core.c
==============================================================================
--- user/ed/newcons/sys/dev/vt/vt_core.c	Wed Nov 20 22:12:21 2013	(r258407)
+++ user/ed/newcons/sys/dev/vt/vt_core.c	Wed Nov 20 22:54:09 2013	(r258408)
@@ -355,7 +355,7 @@ vt_scrollmode_kbdevent(struct vt_window 
 		/* Turn scrolling off. */
 		vt_scroll(vw, 0, VHS_END);
 		VTBUF_SLCK_DISABLE(&vw->vw_buf);
-		atomic_clear_int(&vw->vw_flags, VWF_SCROLL);
+		vw->vw_flags &= ~VWF_SCROLL;
 		break;
 	}
 	case FKEY | F(49): /* Home key. */
@@ -438,11 +438,11 @@ vt_processkey(keyboard_t *kbd, struct vt
 			VT_LOCK(vd);
 			if (state & SLKED) {
 				/* Turn scrolling on. */
-				atomic_set_int(&vw->vw_flags, VWF_SCROLL);
+				vw->vw_flags |= VWF_SCROLL;
 				VTBUF_SLCK_ENABLE(&vw->vw_buf);
 			} else {
 				/* Turn scrolling off. */
-				atomic_clear_int(&vw->vw_flags, VWF_SCROLL);
+				vw->vw_flags &= ~VWF_SCROLL;
 				VTBUF_SLCK_DISABLE(&vw->vw_buf);
 				vt_scroll(vw, 0, VHS_END);
 			}
@@ -896,12 +896,12 @@ vtterm_cngetc(struct terminal *tm)
 			kbdd_ioctl(kbd, KDGKBSTATE, (caddr_t)&state);
 			if (state & SLKED) {
 				/* Turn scrolling on. */
-				atomic_set_int(&vw->vw_flags, VWF_SCROLL);
+				vw->vw_flags |= VWF_SCROLL;
 				VTBUF_SLCK_ENABLE(&vw->vw_buf);
 			} else {
 				/* Turn scrolling off. */
 				vt_scroll(vw, 0, VHS_END);
-				atomic_clear_int(&vw->vw_flags, VWF_SCROLL);
+				vw->vw_flags &= ~VWF_SCROLL;
 				VTBUF_SLCK_DISABLE(&vw->vw_buf);
 			}
 			break;
@@ -941,9 +941,9 @@ vtterm_opened(struct terminal *tm, int o
 	VT_LOCK(vd);
 	vd->vd_flags &= ~VDF_SPLASH;
 	if (opened)
-		atomic_set_int(&vw->vw_flags, VWF_OPENED);
+		vw->vw_flags |= VWF_OPENED;
 	else {
-		atomic_clear_int(&vw->vw_flags, VWF_OPENED);
+		vw->vw_flags &= ~VWF_OPENED;
 		/* TODO: finish ACQ/REL */
 	}
 	VT_UNLOCK(vd);
@@ -981,7 +981,7 @@ vt_change_font(struct vt_window *vw, str
 		VT_UNLOCK(vd);
 		return (ENOTTY);
 	}
-	atomic_set_int(&vw->vw_flags, VWF_BUSY);
+	vw->vw_flags |= VWF_BUSY;
 	VT_UNLOCK(vd);
 
 	vt_termsize(vd, vf, &size);
@@ -1004,7 +1004,7 @@ vt_change_font(struct vt_window *vw, str
 	/* Force a full redraw the next timer tick. */
 	if (vd->vd_curwindow == vw)
 		vd->vd_flags |= VDF_INVALID;
-	atomic_clear_int(&vw->vw_flags, VWF_BUSY);
+	vw->vw_flags &= ~VWF_BUSY;
 	VT_UNLOCK(vd);
 	return (0);
 }
@@ -1041,7 +1041,7 @@ signal_vt_rel(struct vt_window *vw)
 		vw->vw_pid = 0;
 		return TRUE;
 	}
-	atomic_set_int(&vw->vw_flags, VWF_SWWAIT_REL);
+	vw->vw_flags |= VWF_SWWAIT_REL;
 	PROC_LOCK(vw->vw_proc);
 	kern_psignal(vw->vw_proc, vw->vw_smode.relsig);
 	PROC_UNLOCK(vw->vw_proc);
@@ -1062,7 +1062,7 @@ signal_vt_acq(struct vt_window *vw)
 		vw->vw_pid = 0;
 		return TRUE;
 	}
-	atomic_set_int(&vw->vw_flags, VWF_SWWAIT_ACQ);
+	vw->vw_flags |= VWF_SWWAIT_ACQ;
 	PROC_LOCK(vw->vw_proc);
 	kern_psignal(vw->vw_proc, vw->vw_smode.acqsig);
 	PROC_UNLOCK(vw->vw_proc);
@@ -1075,7 +1075,7 @@ finish_vt_rel(struct vt_window *vw, int 
 {
 
 	if (vw->vw_flags & VWF_SWWAIT_REL) {
-		atomic_clear_int(&vw->vw_flags, VWF_SWWAIT_REL);
+		vw->vw_flags &= ~VWF_SWWAIT_REL;
 		if (release) {
 			callout_drain(&vw->vw_proc_dead_timer);
 			vt_late_window_switch(vw->vw_switch_to);
@@ -1090,7 +1090,7 @@ finish_vt_acq(struct vt_window *vw)
 {
 
 	if (vw->vw_flags & VWF_SWWAIT_ACQ) {
-		atomic_clear_int(&vw->vw_flags, VWF_SWWAIT_ACQ);
+		vw->vw_flags &= ~VWF_SWWAIT_ACQ;
 		return 0;
 	}
 	return EINVAL;
@@ -1421,9 +1421,9 @@ vtterm_ioctl(struct terminal *tm, u_long
 	case VT_LOCKSWITCH:
 		/* TODO: Check current state, switching can be in progress. */
 		if ((*(int *)data) & 0x01)
-			atomic_set_int(&vw->vw_flags, VWF_VTYLOCK);
+			vw->vw_flags |= VWF_VTYLOCK;
 		else
-			atomic_clear_int(&vw->vw_flags, VWF_VTYLOCK);
+			vw->vw_flags &= ~VWF_VTYLOCK;
 	case VT_OPENQRY: {
 		unsigned int i;
 

From owner-svn-src-user@FreeBSD.ORG  Wed Nov 20 23:02:09 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 962F1B02;
 Wed, 20 Nov 2013 23:02:09 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 86A802FEA;
 Wed, 20 Nov 2013 23:02:09 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKN29D8009917;
 Wed, 20 Nov 2013 23:02:09 GMT (envelope-from ray@svn.freebsd.org)
Received: (from ray@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKN29Wq009916;
 Wed, 20 Nov 2013 23:02:09 GMT (envelope-from ray@svn.freebsd.org)
Message-Id: <201311202302.rAKN29Wq009916@svn.freebsd.org>
From: Aleksandr Rybalko <ray@FreeBSD.org>
Date: Wed, 20 Nov 2013 23:02:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258409 - user/ed/newcons/sys/dev/vt
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Nov 2013 23:02:09 -0000

Author: ray
Date: Wed Nov 20 23:02:09 2013
New Revision: 258409
URL: http://svnweb.freebsd.org/changeset/base/258409

Log:
  Remove atomic_(set|clear)_int from mouse control too. Same as in r258408.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  user/ed/newcons/sys/dev/vt/vt_core.c

Modified: user/ed/newcons/sys/dev/vt/vt_core.c
==============================================================================
--- user/ed/newcons/sys/dev/vt/vt_core.c	Wed Nov 20 22:54:09 2013	(r258408)
+++ user/ed/newcons/sys/dev/vt/vt_core.c	Wed Nov 20 23:02:09 2013	(r258409)
@@ -1247,10 +1247,10 @@ vt_mouse_state(int show)
 
 	switch (show) {
 	case VT_MOUSE_HIDE:
-		atomic_set_int(&vw->vw_flags, VWF_MOUSE_HIDE);
+		vw->vw_flags |= VWF_MOUSE_HIDE;
 		break;
 	case VT_MOUSE_SHOW:
-		atomic_clear_int(&vw->vw_flags, VWF_MOUSE_HIDE);
+		vw->vw_flags &= ~VWF_MOUSE_HIDE;
 		break;
 	}
 }

From owner-svn-src-user@FreeBSD.ORG  Thu Nov 21 02:42:23 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D742F14D;
 Thu, 21 Nov 2013 02:42:23 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id AECA92AC8;
 Thu, 21 Nov 2013 02:42:23 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAL2gN4I083958;
 Thu, 21 Nov 2013 02:42:23 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAL2gNZS083956;
 Thu, 21 Nov 2013 02:42:23 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201311210242.rAL2gNZS083956@svn.freebsd.org>
From: "Andrey V. Elsukov" <ae@FreeBSD.org>
Date: Thu, 21 Nov 2013 02:42:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258413 - user/ae/inet6/sys/netinet6
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Nov 2013 02:42:23 -0000

Author: ae
Date: Thu Nov 21 02:42:22 2013
New Revision: 258413
URL: http://svnweb.freebsd.org/changeset/base/258413

Log:
  Add sa6_checkzone_ifp() function.
  It is similar to sa6_checkzone, but has additional argument - ifnet.
  It is used for scope zone index initialization.

Modified:
  user/ae/inet6/sys/netinet6/scope6.c
  user/ae/inet6/sys/netinet6/scope6_var.h

Modified: user/ae/inet6/sys/netinet6/scope6.c
==============================================================================
--- user/ae/inet6/sys/netinet6/scope6.c	Thu Nov 21 01:08:10 2013	(r258412)
+++ user/ae/inet6/sys/netinet6/scope6.c	Thu Nov 21 02:42:22 2013	(r258413)
@@ -500,3 +500,24 @@ sa6_checkzone(struct sockaddr_in6 *sa6)
 	/* Return error if we can't determine zone id */
 	return (sa6->sin6_scope_id ? 0: EADDRNOTAVAIL);
 }
+
+/*
+ * This function is similar to sa6_checkzone, but it uses given ifp
+ * to initialize sin6_scope_id.
+ */
+int
+sa6_checkzone_ifp(struct ifnet *ifp, struct sockaddr_in6 *sa6)
+{
+	int scope;
+
+	scope = in6_addrscope(&sa6->sin6_addr);
+	if (scope == IPV6_ADDR_SCOPE_LINKLOCAL ||
+	    scope == IPV6_ADDR_SCOPE_INTFACELOCAL) {
+		if (sa6->sin6_scope_id != 0 &&
+		    sa6->sin6_scope_id != in6_getscopezone(ifp, scope))
+			return (EADDRNOTAVAIL);
+		if (sa6->sin6_scope_id == 0)
+			sa6->sin6_scope_id = in6_getscopezone(ifp, scope);
+	}
+	return (sa6_checkzone(sa6));
+}

Modified: user/ae/inet6/sys/netinet6/scope6_var.h
==============================================================================
--- user/ae/inet6/sys/netinet6/scope6_var.h	Thu Nov 21 01:08:10 2013	(r258412)
+++ user/ae/inet6/sys/netinet6/scope6_var.h	Thu Nov 21 02:42:22 2013	(r258413)
@@ -59,6 +59,7 @@ u_int32_t scope6_addr2default(struct in6
 int	sa6_embedscope(struct sockaddr_in6 *, int);
 int	sa6_recoverscope(struct sockaddr_in6 *);
 int	sa6_checkzone(struct sockaddr_in6 *);
+int	sa6_checkzone_ifp(struct ifnet *, struct sockaddr_in6 *);
 int	in6_setscope(struct in6_addr *, struct ifnet *, u_int32_t *);
 int	in6_clearscope(struct in6_addr *);
 uint16_t in6_getscope(struct in6_addr *);

From owner-svn-src-user@FreeBSD.ORG  Thu Nov 21 02:45:08 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id A9CD525B;
 Thu, 21 Nov 2013 02:45:08 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9B2462AE3;
 Thu, 21 Nov 2013 02:45:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAL2j8VX084372;
 Thu, 21 Nov 2013 02:45:08 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAL2j88R084371;
 Thu, 21 Nov 2013 02:45:08 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201311210245.rAL2j88R084371@svn.freebsd.org>
From: "Andrey V. Elsukov" <ae@FreeBSD.org>
Date: Thu, 21 Nov 2013 02:45:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258414 - user/ae/inet6/sys/netinet6
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Nov 2013 02:45:08 -0000

Author: ae
Date: Thu Nov 21 02:45:07 2013
New Revision: 258414
URL: http://svnweb.freebsd.org/changeset/base/258414

Log:
  Use sa6_checkzone_ifp() function. Since we always know ifp, we can
  use it to initialize sin6_scope_id if user didn't done this.

Modified:
  user/ae/inet6/sys/netinet6/in6.c

Modified: user/ae/inet6/sys/netinet6/in6.c
==============================================================================
--- user/ae/inet6/sys/netinet6/in6.c	Thu Nov 21 02:42:22 2013	(r258413)
+++ user/ae/inet6/sys/netinet6/in6.c	Thu Nov 21 02:45:07 2013	(r258414)
@@ -433,10 +433,7 @@ in6_control(struct socket *so, u_long cm
 		break;
 	}
 	if (sa6 && sa6->sin6_family == AF_INET6) {
-		if (sa6->sin6_scope_id == 0)
-			sa6->sin6_scope_id = in6_getscopezone(ifp,
-			    in6_addrscope(&sa6->sin6_addr));
-		error = sa6_checkzone(sa6);
+		error = sa6_checkzone_ifp(ifp, sa6);
 		if (error != 0)
 			return (error);
 		if (td != NULL && (error = prison_check_ip6(td->td_ucred,

From owner-svn-src-user@FreeBSD.ORG  Thu Nov 21 02:54:58 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D74A4611;
 Thu, 21 Nov 2013 02:54:58 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id C847F2B6F;
 Thu, 21 Nov 2013 02:54:58 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAL2swtN087565;
 Thu, 21 Nov 2013 02:54:58 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAL2swHK087564;
 Thu, 21 Nov 2013 02:54:58 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201311210254.rAL2swHK087564@svn.freebsd.org>
From: "Andrey V. Elsukov" <ae@FreeBSD.org>
Date: Thu, 21 Nov 2013 02:54:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258416 - user/ae/inet6/sys/net
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Nov 2013 02:54:58 -0000

Author: ae
Date: Thu Nov 21 02:54:58 2013
New Revision: 258416
URL: http://svnweb.freebsd.org/changeset/base/258416

Log:
  Check and initialize zone ids of src/dst addresses before calling
  gif_set_tunnel. Also remove sa6_embedscope() calls.

Modified:
  user/ae/inet6/sys/net/if_gif.c

Modified: user/ae/inet6/sys/net/if_gif.c
==============================================================================
--- user/ae/inet6/sys/net/if_gif.c	Thu Nov 21 02:45:36 2013	(r258415)
+++ user/ae/inet6/sys/net/if_gif.c	Thu Nov 21 02:54:58 2013	(r258416)
@@ -747,6 +747,10 @@ gif_ioctl(ifp, cmd, data)
 		case AF_INET6:
 			if (src->sa_len != sizeof(struct sockaddr_in6))
 				return EINVAL;
+			error = sa6_checkzone_ifp(ifp,
+			    (struct sockaddr_in6 *)src);
+			if (error)
+				return (error);
 			break;
 #endif
 		default:
@@ -763,6 +767,10 @@ gif_ioctl(ifp, cmd, data)
 		case AF_INET6:
 			if (dst->sa_len != sizeof(struct sockaddr_in6))
 				return EINVAL;
+			error = sa6_checkzone_ifp(ifp,
+			    (struct sockaddr_in6 *)dst);
+			if (error)
+				return (error);
 			break;
 #endif
 		default:
@@ -985,16 +993,6 @@ gif_set_tunnel(ifp, src, dst)
 #endif
 #ifdef INET6
 	case AF_INET6:
-		/*
-		 * Check validity of the scope zone ID of the addresses, and
-		 * convert it into the kernel internal form if necessary.
-		 */
-		error = sa6_embedscope((struct sockaddr_in6 *)sc->gif_psrc, 0);
-		if (error != 0)
-			break;
-		error = sa6_embedscope((struct sockaddr_in6 *)sc->gif_pdst, 0);
-		if (error != 0)
-			break;
 		error = in6_gif_attach(sc);
 		break;
 #endif

From owner-svn-src-user@FreeBSD.ORG  Thu Nov 21 03:01:29 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 30B5E968;
 Thu, 21 Nov 2013 03:01:29 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 21B102C3C;
 Thu, 21 Nov 2013 03:01:29 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAL31Svr091532;
 Thu, 21 Nov 2013 03:01:28 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAL31SAW091531;
 Thu, 21 Nov 2013 03:01:28 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201311210301.rAL31SAW091531@svn.freebsd.org>
From: "Andrey V. Elsukov" <ae@FreeBSD.org>
Date: Thu, 21 Nov 2013 03:01:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258417 - user/ae/inet6/sys/net
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Nov 2013 03:01:29 -0000

Author: ae
Date: Thu Nov 21 03:01:28 2013
New Revision: 258417
URL: http://svnweb.freebsd.org/changeset/base/258417

Log:
  Since we keep sin6_scope_id initialized, there is no need to recover it.

Modified:
  user/ae/inet6/sys/net/if_gif.c

Modified: user/ae/inet6/sys/net/if_gif.c
==============================================================================
--- user/ae/inet6/sys/net/if_gif.c	Thu Nov 21 02:54:58 2013	(r258416)
+++ user/ae/inet6/sys/net/if_gif.c	Thu Nov 21 03:01:28 2013	(r258417)
@@ -830,13 +830,6 @@ gif_ioctl(ifp, cmd, data)
 		if (src->sa_len > size)
 			return EINVAL;
 		bcopy((caddr_t)src, (caddr_t)dst, src->sa_len);
-#ifdef INET6
-		if (dst->sa_family == AF_INET6) {
-			error = sa6_recoverscope((struct sockaddr_in6 *)dst);
-			if (error != 0)
-				return (error);
-		}
-#endif
 		break;
 			
 	case SIOCGIFPDSTADDR:
@@ -875,13 +868,6 @@ gif_ioctl(ifp, cmd, data)
 		if (error != 0)
 			return (error);
 		bcopy((caddr_t)src, (caddr_t)dst, src->sa_len);
-#ifdef INET6
-		if (dst->sa_family == AF_INET6) {
-			error = sa6_recoverscope((struct sockaddr_in6 *)dst);
-			if (error != 0)
-				return (error);
-		}
-#endif
 		break;
 
 	case SIOCSIFFLAGS:

From owner-svn-src-user@FreeBSD.ORG  Thu Nov 21 03:24:11 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 60A27138;
 Thu, 21 Nov 2013 03:24:11 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5043B2DA5;
 Thu, 21 Nov 2013 03:24:11 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAL3OBQm099099;
 Thu, 21 Nov 2013 03:24:11 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAL3OBVm099098;
 Thu, 21 Nov 2013 03:24:11 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201311210324.rAL3OBVm099098@svn.freebsd.org>
From: "Andrey V. Elsukov" <ae@FreeBSD.org>
Date: Thu, 21 Nov 2013 03:24:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258419 - user/ae/inet6/sys/net
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Nov 2013 03:24:11 -0000

Author: ae
Date: Thu Nov 21 03:24:10 2013
New Revision: 258419
URL: http://svnweb.freebsd.org/changeset/base/258419

Log:
  Remove in6_setscope() calls.

Modified:
  user/ae/inet6/sys/net/if_spppsubr.c

Modified: user/ae/inet6/sys/net/if_spppsubr.c
==============================================================================
--- user/ae/inet6/sys/net/if_spppsubr.c	Thu Nov 21 03:22:13 2013	(r258418)
+++ user/ae/inet6/sys/net/if_spppsubr.c	Thu Nov 21 03:24:10 2013	(r258419)
@@ -59,10 +59,6 @@
 #include <netinet/tcp.h>
 #endif
 
-#ifdef INET6
-#include <netinet6/scope6_var.h>
-#endif
-
 #include <netinet/if_ether.h>
 
 #ifdef IPX
@@ -3582,8 +3578,6 @@ sppp_ipv6cp_RCR(struct sppp *sp, struct 
 			nohisaddr = IN6_IS_ADDR_UNSPECIFIED(&desiredaddr);
 
 			desiredaddr.s6_addr16[0] = htons(0xfe80);
-			(void)in6_setscope(&desiredaddr, SP2IFP(sp), NULL);
-
 			if (!collision && !nohisaddr) {
 				/* no collision, hisaddr known - Conf-Ack */
 				type = CONF_ACK;
@@ -3730,7 +3724,6 @@ sppp_ipv6cp_RCN_nak(struct sppp *sp, str
 				break;
 			bzero(&suggestaddr, sizeof(suggestaddr));
 			suggestaddr.s6_addr16[0] = htons(0xfe80);
-			(void)in6_setscope(&suggestaddr, SP2IFP(sp), NULL);
 			bcopy(&p[2], &suggestaddr.s6_addr[8], 8);
 
 			sp->ipv6cp.opts |= (1 << IPV6CP_OPT_IFID);

From owner-svn-src-user@FreeBSD.ORG  Thu Nov 21 03:56:05 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B55D6836;
 Thu, 21 Nov 2013 03:56:05 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id A5AF72F38;
 Thu, 21 Nov 2013 03:56:05 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAL3u5CZ009095;
 Thu, 21 Nov 2013 03:56:05 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAL3u57G009093;
 Thu, 21 Nov 2013 03:56:05 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201311210356.rAL3u57G009093@svn.freebsd.org>
From: "Andrey V. Elsukov" <ae@FreeBSD.org>
Date: Thu, 21 Nov 2013 03:56:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258422 - user/ae/inet6/sys/netinet
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Nov 2013 03:56:05 -0000

Author: ae
Date: Thu Nov 21 03:56:05 2013
New Revision: 258422
URL: http://svnweb.freebsd.org/changeset/base/258422

Log:
  Remove in6_clearscope() calls and unused variable.

Modified:
  user/ae/inet6/sys/netinet/tcp_subr.c

Modified: user/ae/inet6/sys/netinet/tcp_subr.c
==============================================================================
--- user/ae/inet6/sys/netinet/tcp_subr.c	Thu Nov 21 03:40:52 2013	(r258421)
+++ user/ae/inet6/sys/netinet/tcp_subr.c	Thu Nov 21 03:56:05 2013	(r258422)
@@ -1977,7 +1977,6 @@ tcp_signature_compute(struct mbuf *m, in
 	struct tcphdr *th;
 #ifdef INET6
 	struct ip6_hdr *ip6;
-	struct in6_addr in6;
 	char ip6buf[INET6_ADDRSTRLEN];
 	uint32_t plen;
 	uint16_t nhdr;
@@ -2066,12 +2065,10 @@ tcp_signature_compute(struct mbuf *m, in
 	 * Note: Upper-Layer Packet Length comes before Next Header.
 	 */
 	case (IPV6_VERSION >> 4):
-		in6 = ip6->ip6_src;
-		in6_clearscope(&in6);
-		MD5Update(&ctx, (char *)&in6, sizeof(struct in6_addr));
-		in6 = ip6->ip6_dst;
-		in6_clearscope(&in6);
-		MD5Update(&ctx, (char *)&in6, sizeof(struct in6_addr));
+		MD5Update(&ctx, (char *)&ip6->ip6_src,
+		    sizeof(struct in6_addr));
+		MD5Update(&ctx, (char *)&ip6->ip6_dst,
+		    sizeof(struct in6_addr));
 		plen = htonl(len + sizeof(struct tcphdr) + optlen);
 		MD5Update(&ctx, (char *)&plen, sizeof(uint32_t));
 		nhdr = 0;

From owner-svn-src-user@FreeBSD.ORG  Thu Nov 21 05:17:38 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 16EAE39F;
 Thu, 21 Nov 2013 05:17:38 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0654B22E6;
 Thu, 21 Nov 2013 05:17:38 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAL5Hbw3036091;
 Thu, 21 Nov 2013 05:17:37 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAL5Hb3C036086;
 Thu, 21 Nov 2013 05:17:37 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201311210517.rAL5Hb3C036086@svn.freebsd.org>
From: "Andrey V. Elsukov" <ae@FreeBSD.org>
Date: Thu, 21 Nov 2013 05:17:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258423 - user/ae/inet6/sys/netinet
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Nov 2013 05:17:38 -0000

Author: ae
Date: Thu Nov 21 05:17:36 2013
New Revision: 258423
URL: http://svnweb.freebsd.org/changeset/base/258423

Log:
  Replace unused argument off0 in tcp_signature_compute() and
  tcp_signature_verify() functions to the pointer to struct in_conninfo.
  It contains information about scope zone index of given tcp connection,
  that is needed for SA allocation.

Modified:
  user/ae/inet6/sys/netinet/tcp_input.c
  user/ae/inet6/sys/netinet/tcp_output.c
  user/ae/inet6/sys/netinet/tcp_subr.c
  user/ae/inet6/sys/netinet/tcp_syncache.c
  user/ae/inet6/sys/netinet/tcp_var.h

Modified: user/ae/inet6/sys/netinet/tcp_input.c
==============================================================================
--- user/ae/inet6/sys/netinet/tcp_input.c	Thu Nov 21 03:56:05 2013	(r258422)
+++ user/ae/inet6/sys/netinet/tcp_input.c	Thu Nov 21 05:17:36 2013	(r258423)
@@ -234,8 +234,9 @@ static void	 tcp_newreno_partial_ack(str
 static void inline 	tcp_fields_to_host(struct tcphdr *);
 #ifdef TCP_SIGNATURE
 static void inline 	tcp_fields_to_net(struct tcphdr *);
-static int inline	tcp_signature_verify_input(struct mbuf *, int, int,
-			    int, struct tcpopt *, struct tcphdr *, u_int);
+static int inline	tcp_signature_verify_input(struct mbuf *,
+			    struct in_conninfo *, int, int,
+			    struct tcpopt *, struct tcphdr *, u_int);
 #endif
 static void inline	cc_ack_received(struct tcpcb *tp, struct tcphdr *th,
 			    uint16_t type);
@@ -479,13 +480,13 @@ tcp_fields_to_net(struct tcphdr *th)
 }
 
 static inline int
-tcp_signature_verify_input(struct mbuf *m, int off0, int tlen, int optlen,
-    struct tcpopt *to, struct tcphdr *th, u_int tcpbflag)
+tcp_signature_verify_input(struct mbuf *m, struct in_conninfo *inc, int tlen,
+    int optlen, struct tcpopt *to, struct tcphdr *th, u_int tcpbflag)
 {
 	int ret;
 
 	tcp_fields_to_net(th);
-	ret = tcp_signature_verify(m, off0, tlen, optlen, to, th, tcpbflag);
+	ret = tcp_signature_verify(m, inc, tlen, optlen, to, th, tcpbflag);
 	tcp_fields_to_host(th);
 	return (ret);
 }
@@ -1146,7 +1147,8 @@ relocked:
 			if (sig_checked == 0)  {
 				tcp_dooptions(&to, optp, optlen,
 				    (thflags & TH_SYN) ? TO_SYN : 0);
-				if (!tcp_signature_verify_input(m, off0, tlen,
+				if (!tcp_signature_verify_input(m,
+				    &tp->t_inpcb->inp_inc, tlen,
 				    optlen, &to, th, tp->t_flags)) {
 
 					/*
@@ -1388,8 +1390,8 @@ relocked:
 	if (sig_checked == 0)  {
 		tcp_dooptions(&to, optp, optlen,
 		    (thflags & TH_SYN) ? TO_SYN : 0);
-		if (!tcp_signature_verify_input(m, off0, tlen, optlen, &to,
-		    th, tp->t_flags)) {
+		if (!tcp_signature_verify_input(m, &tp->t_inpcb->inp_inc,
+		    tlen, optlen, &to, th, tp->t_flags)) {
 
 			/*
 			 * In SYN_SENT state if it receives an RST, it is

Modified: user/ae/inet6/sys/netinet/tcp_output.c
==============================================================================
--- user/ae/inet6/sys/netinet/tcp_output.c	Thu Nov 21 03:56:05 2013	(r258422)
+++ user/ae/inet6/sys/netinet/tcp_output.c	Thu Nov 21 05:17:36 2013	(r258423)
@@ -1071,7 +1071,7 @@ send:
 #ifdef TCP_SIGNATURE
 	if (tp->t_flags & TF_SIGNATURE) {
 		int sigoff = to.to_signature - opt;
-		tcp_signature_compute(m, 0, len, optlen,
+		tcp_signature_compute(m, &tp->t_inpcb->inp_inc, len, optlen,
 		    (u_char *)(th + 1) + sigoff, IPSEC_DIR_OUTBOUND);
 	}
 #endif

Modified: user/ae/inet6/sys/netinet/tcp_subr.c
==============================================================================
--- user/ae/inet6/sys/netinet/tcp_subr.c	Thu Nov 21 03:56:05 2013	(r258422)
+++ user/ae/inet6/sys/netinet/tcp_subr.c	Thu Nov 21 05:17:36 2013	(r258423)
@@ -1941,7 +1941,7 @@ tcp_signature_apply(void *fstate, void *
  *
  * Parameters:
  * m		pointer to head of mbuf chain
- * _unused	
+ * inc		pointer to struct in_conninfo
  * len		length of TCP segment data, excluding options
  * optlen	length of TCP segment options
  * buf		pointer to storage for computed MD5 digest
@@ -1960,8 +1960,8 @@ tcp_signature_apply(void *fstate, void *
  * specify per-application flows but it is unstable.
  */
 int
-tcp_signature_compute(struct mbuf *m, int _unused, int len, int optlen,
-    u_char *buf, u_int direction)
+tcp_signature_compute(struct mbuf *m, struct in_conninfo *inc, int len,
+    int optlen, u_char *buf, u_int direction)
 {
 	union sockaddr_union dst;
 #ifdef INET
@@ -2008,6 +2008,8 @@ tcp_signature_compute(struct mbuf *m, in
 		dst.sa.sa_family = AF_INET6;
 		dst.sin6.sin6_addr = (direction == IPSEC_DIR_INBOUND) ?
 		    ip6->ip6_src : ip6->ip6_dst;
+		if (IN6_IS_ADDR_LINKLOCAL(&dst.sin6.sin6_addr))
+			dst.sin6.sin6_scope_id = inc->inc6_zoneid;
 		break;
 #endif
 	default:
@@ -2129,8 +2131,8 @@ tcp_signature_compute(struct mbuf *m, in
  * Return 1 if successful, otherwise return 0.
  */
 int
-tcp_signature_verify(struct mbuf *m, int off0, int tlen, int optlen,
-    struct tcpopt *to, struct tcphdr *th, u_int tcpbflag)
+tcp_signature_verify(struct mbuf *m, struct in_conninfo *inc, int tlen,
+    int optlen, struct tcpopt *to, struct tcphdr *th, u_int tcpbflag)
 {
 	char tmpdigest[TCP_SIGLEN];
 
@@ -2161,7 +2163,7 @@ tcp_signature_verify(struct mbuf *m, int
 		TCPSTAT_INC(tcps_sig_rcvbadsig);
 		return (0);
 	}
-	if (tcp_signature_compute(m, off0, tlen, optlen, &tmpdigest[0],
+	if (tcp_signature_compute(m, inc, tlen, optlen, &tmpdigest[0],
 	    IPSEC_DIR_INBOUND) == -1) {
 		TCPSTAT_INC(tcps_sig_err_buildsig);
 		TCPSTAT_INC(tcps_sig_rcvbadsig);

Modified: user/ae/inet6/sys/netinet/tcp_syncache.c
==============================================================================
--- user/ae/inet6/sys/netinet/tcp_syncache.c	Thu Nov 21 03:56:05 2013	(r258422)
+++ user/ae/inet6/sys/netinet/tcp_syncache.c	Thu Nov 21 05:17:36 2013	(r258423)
@@ -1525,7 +1525,7 @@ syncache_respond(struct syncache *sc)
 
 #ifdef TCP_SIGNATURE
 		if (sc->sc_flags & SCF_SIGNATURE)
-			tcp_signature_compute(m, 0, 0, optlen,
+			tcp_signature_compute(m, &sc->sc_inc, 0, optlen,
 			    to.to_signature, IPSEC_DIR_OUTBOUND);
 #endif
 #ifdef INET6

Modified: user/ae/inet6/sys/netinet/tcp_var.h
==============================================================================
--- user/ae/inet6/sys/netinet/tcp_var.h	Thu Nov 21 03:56:05 2013	(r258422)
+++ user/ae/inet6/sys/netinet/tcp_var.h	Thu Nov 21 05:17:36 2013	(r258423)
@@ -698,9 +698,10 @@ int	 tcp_twcheck(struct inpcb *, struct 
 int	 tcp_twrespond(struct tcptw *, int);
 void	 tcp_setpersist(struct tcpcb *);
 #ifdef TCP_SIGNATURE
-int	 tcp_signature_compute(struct mbuf *, int, int, int, u_char *, u_int);
-int	 tcp_signature_verify(struct mbuf *, int, int, int, struct tcpopt *,
-	    struct tcphdr *, u_int);
+int	 tcp_signature_compute(struct mbuf *, struct in_conninfo *, int,
+	    int, u_char *, u_int);
+int	 tcp_signature_verify(struct mbuf *, struct in_conninfo *, int,
+	    int, struct tcpopt *, struct tcphdr *, u_int);
 #endif
 void	 tcp_slowtimo(void);
 struct tcptemp *

From owner-svn-src-user@FreeBSD.ORG  Fri Nov 22 04:02:41 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4508DC18;
 Fri, 22 Nov 2013 04:02:41 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 35794252B;
 Fri, 22 Nov 2013 04:02:41 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAM42f0T002276;
 Fri, 22 Nov 2013 04:02:41 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAM42fGw002275;
 Fri, 22 Nov 2013 04:02:41 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201311220402.rAM42fGw002275@svn.freebsd.org>
From: "Andrey V. Elsukov" <ae@FreeBSD.org>
Date: Fri, 22 Nov 2013 04:02:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258461 - user/ae/inet6/sys/dev/cxgbe/tom
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Nov 2013 04:02:41 -0000

Author: ae
Date: Fri Nov 22 04:02:40 2013
New Revision: 258461
URL: http://svnweb.freebsd.org/changeset/base/258461

Log:
  Remove in6_clearscope and in6_setscope calls.
  Simplify ifnet_has_ip6 function.

Modified:
  user/ae/inet6/sys/dev/cxgbe/tom/t4_listen.c

Modified: user/ae/inet6/sys/dev/cxgbe/tom/t4_listen.c
==============================================================================
--- user/ae/inet6/sys/dev/cxgbe/tom/t4_listen.c	Fri Nov 22 02:03:50 2013	(r258460)
+++ user/ae/inet6/sys/dev/cxgbe/tom/t4_listen.c	Fri Nov 22 04:02:40 2013	(r258461)
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/socketvar.h>
 #include <net/ethernet.h>
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_types.h>
 #include <net/if_vlan_var.h>
 #include <net/route.h>
@@ -52,7 +53,7 @@ __FBSDID("$FreeBSD$");
 #include <netinet/in_pcb.h>
 #include <netinet/ip.h>
 #include <netinet/ip6.h>
-#include <netinet6/scope6_var.h>
+#include <netinet6/in6_var.h>
 #include <netinet/tcp_timer.h>
 #include <netinet/tcp_var.h>
 #define TCPSTATES
@@ -1085,22 +1086,14 @@ static int
 ifnet_has_ip6(struct ifnet *ifp, struct in6_addr *ip6)
 {
 	struct ifaddr *ifa;
-	struct sockaddr_in6 *sin6;
 	int found = 0;
-	struct in6_addr in6 = *ip6;
-
-	/* Just as in ip6_input */
-	if (in6_clearscope(&in6) || in6_clearscope(&in6))
-		return (0);
-	in6_setscope(&in6, ifp, NULL);
 
 	if_addr_rlock(ifp);
 	TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
-		sin6 = (void *)ifa->ifa_addr;
-		if (sin6->sin6_family != AF_INET6)
+		if (ifa->ifa_addr->sa_family != AF_INET6)
 			continue;
 
-		if (IN6_ARE_ADDR_EQUAL(&sin6->sin6_addr, &in6)) {
+		if (IN6_ARE_ADDR_EQUAL(ip6, IFA_IN6(ifa))) {
 			found = 1;
 			break;
 		}

From owner-svn-src-user@FreeBSD.ORG  Fri Nov 22 04:05:24 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E7E6BD96;
 Fri, 22 Nov 2013 04:05:24 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id D8B9F2544;
 Fri, 22 Nov 2013 04:05:24 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAM45Oj5002748;
 Fri, 22 Nov 2013 04:05:24 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAM45OCJ002747;
 Fri, 22 Nov 2013 04:05:24 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201311220405.rAM45OCJ002747@svn.freebsd.org>
From: "Andrey V. Elsukov" <ae@FreeBSD.org>
Date: Fri, 22 Nov 2013 04:05:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258462 - user/ae/inet6/sys/dev/cxgbe/tom
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Nov 2013 04:05:25 -0000

Author: ae
Date: Fri Nov 22 04:05:24 2013
New Revision: 258462
URL: http://svnweb.freebsd.org/changeset/base/258462

Log:
  Remove in6_clearscope call and unused variable.

Modified:
  user/ae/inet6/sys/dev/cxgbe/tom/t4_tom.c

Modified: user/ae/inet6/sys/dev/cxgbe/tom/t4_tom.c
==============================================================================
--- user/ae/inet6/sys/dev/cxgbe/tom/t4_tom.c	Fri Nov 22 04:02:40 2013	(r258461)
+++ user/ae/inet6/sys/dev/cxgbe/tom/t4_tom.c	Fri Nov 22 04:05:24 2013	(r258462)
@@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$");
 #include <netinet/ip.h>
 #include <netinet/ip6.h>
 #include <netinet/tcp_var.h>
-#include <netinet6/scope6_var.h>
 #define TCPSTATES
 #include <netinet/tcp_fsm.h>
 #include <netinet/toecore.h>
@@ -762,7 +761,7 @@ static void
 update_clip_table(struct adapter *sc, struct tom_data *td)
 {
 	struct in6_ifaddr *ia;
-	struct in6_addr *lip, tlip;
+	struct in6_addr *lip;
 	struct clip_head stale;
 	struct clip_entry *ce, *ce_temp;
 	int rc, gen = atomic_load_acq_int(&in6_ifaddr_gen);
@@ -786,12 +785,6 @@ update_clip_table(struct adapter *sc, st
 
 		if (IN6_IS_ADDR_LOOPBACK(lip))
 			continue;
-		if (IN6_IS_SCOPE_EMBED(lip)) {
-			/* Remove the embedded scope */
-			tlip = *lip;
-			lip = &tlip;
-			in6_clearscope(lip);
-		}
 		/*
 		 * XXX: how to weed out the link local address for the loopback
 		 * interface?  It's fe80::1 usually (always?).

From owner-svn-src-user@FreeBSD.ORG  Fri Nov 22 05:25:04 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 74AB95B1;
 Fri, 22 Nov 2013 05:25:04 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 650CB290C;
 Fri, 22 Nov 2013 05:25:04 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAM5P4eZ029494;
 Fri, 22 Nov 2013 05:25:04 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAM5P4r2029492;
 Fri, 22 Nov 2013 05:25:04 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201311220525.rAM5P4r2029492@svn.freebsd.org>
From: "Andrey V. Elsukov" <ae@FreeBSD.org>
Date: Fri, 22 Nov 2013 05:25:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258468 - user/ae/inet6/sys/netinet6
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Nov 2013 05:25:04 -0000

Author: ae
Date: Fri Nov 22 05:25:03 2013
New Revision: 258468
URL: http://svnweb.freebsd.org/changeset/base/258468

Log:
  Use in6_getscopezone instead of sa6_recoverscope to initialize
  sin6_scope_id for LLA.

Modified:
  user/ae/inet6/sys/netinet6/in6.c

Modified: user/ae/inet6/sys/netinet6/in6.c
==============================================================================
--- user/ae/inet6/sys/netinet6/in6.c	Fri Nov 22 05:02:37 2013	(r258467)
+++ user/ae/inet6/sys/netinet6/in6.c	Fri Nov 22 05:25:03 2013	(r258468)
@@ -2261,11 +2261,10 @@ in6_lltable_dump(struct lltable *llt, st
 			ndpc.rtm.rtm_type = RTM_GET;
 			ndpc.rtm.rtm_flags = RTF_UP;
 			ndpc.rtm.rtm_addrs = RTA_DST | RTA_GATEWAY;
-			ndpc.sin6.sin6_family = AF_INET6;
-			ndpc.sin6.sin6_len = sizeof(ndpc.sin6);
 			bcopy(L3_ADDR(lle), &ndpc.sin6, L3_ADDR_LEN(lle));
-			if (V_deembed_scopeid)
-				sa6_recoverscope(&ndpc.sin6);
+			if (IN6_IS_ADDR_LINKLOCAL(&ndpc.sin6.sin6_addr))
+				ndpc.sin6.sin6_scope_id = in6_getscopezone(
+				    ifp, IPV6_ADDR_SCOPE_LINKLOCAL);
 
 			/* publish */
 			if (lle->la_flags & LLE_PUB)

From owner-svn-src-user@FreeBSD.ORG  Fri Nov 22 23:36:42 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8A9D04C1;
 Fri, 22 Nov 2013 23:36:42 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7A3F82574;
 Fri, 22 Nov 2013 23:36:42 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAMNagIe022417;
 Fri, 22 Nov 2013 23:36:42 GMT (envelope-from ray@svn.freebsd.org)
Received: (from ray@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAMNagnU022416;
 Fri, 22 Nov 2013 23:36:42 GMT (envelope-from ray@svn.freebsd.org)
Message-Id: <201311222336.rAMNagnU022416@svn.freebsd.org>
From: Aleksandr Rybalko <ray@FreeBSD.org>
Date: Fri, 22 Nov 2013 23:36:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258491 - user/ed/newcons/sys/dev/fb
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Nov 2013 23:36:42 -0000

Author: ray
Date: Fri Nov 22 23:36:41 2013
New Revision: 258491
URL: http://svnweb.freebsd.org/changeset/base/258491

Log:
  Implement minimum ioctls set for framebuffer device.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  user/ed/newcons/sys/dev/fb/fbd.c

Modified: user/ed/newcons/sys/dev/fb/fbd.c
==============================================================================
--- user/ed/newcons/sys/dev/fb/fbd.c	Fri Nov 22 22:12:11 2013	(r258490)
+++ user/ed/newcons/sys/dev/fb/fbd.c	Fri Nov 22 23:36:41 2013	(r258491)
@@ -109,8 +109,39 @@ static int
 fb_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
     struct thread *td)
 {
+	struct fb_info *info;
+	int error;
 
-	return (0);
+	error = 0;
+	info = dev->si_drv1;
+
+	switch (cmd) {
+	case FBIOGTYPE:
+		bcopy(info, (struct fbtype *)data, sizeof(struct fbtype));
+		break;
+
+	case FBIO_GETWINORG:	/* get frame buffer window origin */
+		*(u_int *)data = 0;
+		break;
+
+	case FBIO_GETDISPSTART:	/* get display start address */
+		((video_display_start_t *)data)->x = 0;
+		((video_display_start_t *)data)->y = 0;
+		break;
+
+	case FBIO_GETLINEWIDTH:	/* get scan line width in bytes */
+		*(u_int *)data = info->fb_stride;
+		break;
+
+	case FBIO_BLANK:	/* blank display */
+		error = 0;	/* TODO */
+		break;
+
+	default:
+		error = ENOIOCTL;
+		break;
+	}
+	return (error);
 }
 
 static int

From owner-svn-src-user@FreeBSD.ORG  Sat Nov 23 17:20:24 2013
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9A6E8E4A;
 Sat, 23 Nov 2013 17:20:24 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7AB6C21C8;
 Sat, 23 Nov 2013 17:20:24 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rANHKOf1088858;
 Sat, 23 Nov 2013 17:20:24 GMT (envelope-from pho@svn.freebsd.org)
Received: (from pho@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id rANHKOrW088857;
 Sat, 23 Nov 2013 17:20:24 GMT (envelope-from pho@svn.freebsd.org)
Message-Id: <201311231720.rANHKOrW088857@svn.freebsd.org>
From: Peter Holm <pho@FreeBSD.org>
Date: Sat, 23 Nov 2013 17:20:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r258500 - user/pho/stress2/misc
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 23 Nov 2013 17:20:24 -0000

Author: pho
Date: Sat Nov 23 17:20:24 2013
New Revision: 258500
URL: http://svnweb.freebsd.org/changeset/base/258500

Log:
  Added regression test.
  
  Sponsored by:	EMC / Isilon storage division

Added:
  user/pho/stress2/misc/signal0.sh   (contents, props changed)

Added: user/pho/stress2/misc/signal0.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/pho/stress2/misc/signal0.sh	Sat Nov 23 17:20:24 2013	(r258500)
@@ -0,0 +1,88 @@
+#!/bin/sh
+
+#
+# Copyright (c) 2013 EMC Corp.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 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.
+#
+# 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 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)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+#
+
+# Zero signal number seen.
+# Test scenario by Vitaly Magerya <vmagerya gmail com>
+# http://people.freebsd.org/~pho/stress/log/kostik646.txt
+# Panic fixed in r258497
+# Signal number fixed in r258499
+
+dir=/tmp
+odir=`pwd`
+cd $dir
+sed '1,/^EOF/d' < $odir/$0 > $dir/signal0.c
+c99 -o signal0  signal0.c -lpthread || exit 1
+rm -f signal0.c
+cd $odir
+
+(cd ../testcases/swap; ./swap -t 5m -i 20 -h -v) > /dev/null 2>&1 &
+for i in `jot 500`; do
+	/tmp/signal0
+done
+killall -q swap
+
+rm -f /tmp/signal0
+exit
+
+EOF
+#include <pthread.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+void signal_handler(int signum, siginfo_t *si, void *context) {
+     if (signum != SIGUSR1) {
+         printf("FAIL bad signal, signum=%d\n", signum);
+         exit(1);
+     }
+}
+
+void *thread_func(void *arg) {
+     return arg;
+}
+
+int main(void) {
+     struct sigaction sa = { 0 };
+     sa.sa_flags = SA_SIGINFO;
+     sa.sa_sigaction = signal_handler;
+     if (sigfillset(&sa.sa_mask) != 0) abort();
+     if (sigaction(SIGUSR1, &sa, NULL) != 0) abort();
+     for (int i = 0; i < 10000; i++) {
+         pthread_t t;
+         pthread_create(&t, NULL, thread_func, NULL);
+         pthread_kill(t, SIGUSR1);
+	/*
+	 Side note.  pthread_kill(3) call behaviour is undefined if pthread_create(3)
+	 in the line before failed.
+	 */
+
+     }
+     return 0;
+}