CVS commit: othersrc/usr.sbin/pkg_setup

2011-11-14 Thread Aleksey Cheusov
Module Name:othersrc
Committed By:   cheusov
Date:   Mon Nov 14 11:12:38 UTC 2011

Modified Files:
othersrc/usr.sbin/pkg_setup: pkg_setup

Log Message:
Add option '-p pkgs' for installing specified packages in addition to
pkg_install.
  Example: pkg_setup -v -d http://example.org/pkgsrc/linux/repo -p nih


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 othersrc/usr.sbin/pkg_setup/pkg_setup

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/usr.sbin/pkg_setup/pkg_setup
diff -u othersrc/usr.sbin/pkg_setup/pkg_setup:1.2 othersrc/usr.sbin/pkg_setup/pkg_setup:1.3
--- othersrc/usr.sbin/pkg_setup/pkg_setup:1.2	Sun Nov  6 17:53:52 2011
+++ othersrc/usr.sbin/pkg_setup/pkg_setup	Mon Nov 14 11:12:37 2011
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# $NetBSD: pkg_setup,v 1.2 2011/11/06 17:53:52 cheusov Exp $
+# $NetBSD: pkg_setup,v 1.3 2011/11/14 11:12:37 cheusov Exp $
 #
 # Copyright (c) 2011 Aleksey Cheusov cheu...@netbsd.org
 #
@@ -42,10 +42,19 @@ ${0##*/} downloads pkg_install binary pa
 usage: ${0##*/} [options] [-- [pkg_add options]]
 
 options:
-   -h display this screen
-   -v verbose output
-   -d url to binary repository, the default is
-  http://ftp.netbsd.org/pub/pkgsrc/packages/\$OPSYS/\$ARCH/\$OSVER
+   -hdisplay this screen
+   -vverbose output
+   -d url  url to binary repository, the default is
+http://ftp.netbsd.org/pub/pkgsrc/packages/\$OPSYS/\$ARCH/\$OSVER
+   -p packages install specified packages in addition to pkg_install
+
+Examples:
+ pkg_setup
+
+ pkg_setup -v -d http://example.org/pkgsrc/linux/repo -p nih
+
+ env FTP_CMD='ftp -4V' ./pkg_setup -v \
+   -d http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/5.0 -- -P /tmp
 EOF
 }
 
@@ -55,7 +64,7 @@ vecho (){
 fi
 }
 
-while getopts hvd: f; do
+while getopts hvd:p: f; do
 case $f in
 h)
 	usage
@@ -64,6 +73,8 @@ while getopts hvd: f; do
 	verbose=1;;
 	d)
 	URL=$OPTARG;;
+	p)
+	packages=$OPTARG;;
 \?)
 	exit 1;;
 esac
@@ -88,7 +99,14 @@ vecho Downloading $pkgname.tgz...
 $FTP_CMD $URL/All/$pkgname.tgz
 gzip -dc $pkgname.tgz | tar -xf -
 
-vecho Installing...
+vecho Installing pkg_install...
 ./sbin/pkg_add $@ ./$pkgname.tgz
 
+if test -n $packages; then
+vecho Installing $packages...
+PKG_PATH=$URL/All
+export PKG_PATH
+./sbin/pkg_add $@ $packages
+fi
+
 vecho done



CVS commit: xsrc/external/mit/xf86-video-intel/dist/src

2011-11-14 Thread Jared D. McNeill
Module Name:xsrc
Committed By:   jmcneill
Date:   Mon Nov 14 11:26:52 UTC 2011

Modified Files:
xsrc/external/mit/xf86-video-intel/dist/src: i830_quirks.c

Log Message:
Use sysctl machdep.dmi.* instead of /sys/class/dmi/id/* for extracting DMI info 
on NetBSD


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
xsrc/external/mit/xf86-video-intel/dist/src/i830_quirks.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xf86-video-intel/dist/src/i830_quirks.c
diff -u xsrc/external/mit/xf86-video-intel/dist/src/i830_quirks.c:1.1.1.2 xsrc/external/mit/xf86-video-intel/dist/src/i830_quirks.c:1.2
--- xsrc/external/mit/xf86-video-intel/dist/src/i830_quirks.c:1.1.1.2	Tue Jun  9 02:54:33 2009
+++ xsrc/external/mit/xf86-video-intel/dist/src/i830_quirks.c	Mon Nov 14 11:26:52 2011
@@ -32,8 +32,14 @@
 
 #define SUBSYS_ANY (~0)
 
+#ifdef __NetBSD__
+#include sys/param.h
+#include sys/sysctl.h
+#define DMIID_SYSCTL_PREFIX machdep.dmi.
+#else
 #define DMIID_DIR /sys/class/dmi/id/
 #define DMIID_FILE(x) (DMIID_DIR # x)
+#endif
 
 typedef struct {
 int chipType;
@@ -66,6 +72,62 @@ enum i830_dmi_data_t {
 
 static char *i830_dmi_data[dmi_data_max];
 
+#ifdef __NetBSD__
+/* NetBSD 6.0+ stores DMI data in sysctl machdep.dmi.* */
+static void
+i830_dmi_sysctl_load(enum i830_dmi_data_t field)
+{
+	const char *name;
+	char *buf;
+	size_t buflen = 0;
+	int err;
+
+	switch (field) {
+	case bios_vendor:	name = DMIID_SYSCTL_PREFIX bios-vendor; break;
+	case bios_version:	name = DMIID_SYSCTL_PREFIX bios-version; break;
+	case bios_date:		name = DMIID_SYSCTL_PREFIX bios-date; break;
+	case sys_vendor:	name = DMIID_SYSCTL_PREFIX system-vendor; break;
+	case product_name:	name = DMIID_SYSCTL_PREFIX system-product; break;
+	case product_version:	name = DMIID_SYSCTL_PREFIX system-version; break;
+	case product_serial:	name = DMIID_SYSCTL_PREFIX system-serial; break;
+	case product_uuid:	name = DMIID_SYSCTL_PREFIX system-uuid; break;
+	case board_vendor:	name = DMIID_SYSCTL_PREFIX board-vendor; break;
+	case board_name:	name = DMIID_SYSCTL_PREFIX board-product; break;
+	case board_version:	name = DMIID_SYSCTL_PREFIX board-version; break;
+	case board_serial:	name = DMIID_SYSCTL_PREFIX board-serial; break;
+	default:		goto not_found;
+	}
+
+	err = sysctlbyname(name, buf, buflen, NULL, 0);
+	if (err || buflen == 0)
+		goto not_found;
+
+	buf = xcalloc(1, buflen);
+	if (buf == NULL)
+		goto not_found;
+
+	err = sysctlbyname(name, buf, buflen, NULL, 0);
+	if (err)
+		goto not_found;
+
+	/* i830_dmi_scan uses a fixed-size buffer, use our own instead */
+	xfree(i830_dmi_data[field]);
+	i830_dmi_data[field] = buf;
+
+	return;
+
+not_found:
+	xfree(i830_dmi_data[field]);
+	i830_dmi_data[field] = NULL;
+}
+
+#define I830_DMI_FIELD_FUNC(field) \
+static void i830_dmi_store_##field(void) \
+{\
+i830_dmi_sysctl_load(field);\
+}
+#else
+/* Linux stores DMI data in /sys/class/dmi/id/... */
 #define I830_DMI_FIELD_FUNC(field) \
 static void i830_dmi_store_##field(void) \
 {\
@@ -78,6 +140,7 @@ static void i830_dmi_store_##field(void)
 fread(i830_dmi_data[field], 64, 1, f);\
 fclose(f);\
 }
+#endif
 
 I830_DMI_FIELD_FUNC(bios_vendor);
 I830_DMI_FIELD_FUNC(bios_version);



CVS commit: src/usr.sbin/puffs/rump_v7fs

2011-11-14 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Nov 14 11:28:05 UTC 2011

Modified Files:
src/usr.sbin/puffs/rump_v7fs: Makefile

Log Message:
Define RUMP_DISKFS to provide getdiskinfo from rumpdev_disk library.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/puffs/rump_v7fs/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/puffs/rump_v7fs/Makefile
diff -u src/usr.sbin/puffs/rump_v7fs/Makefile:1.1 src/usr.sbin/puffs/rump_v7fs/Makefile:1.2
--- src/usr.sbin/puffs/rump_v7fs/Makefile:1.1	Sun Jul 24 09:00:08 2011
+++ src/usr.sbin/puffs/rump_v7fs/Makefile	Mon Nov 14 11:28:05 2011
@@ -1,8 +1,9 @@
-#	$NetBSD: Makefile,v 1.1 2011/07/24 09:00:08 uch Exp $
+#	$NetBSD: Makefile,v 1.2 2011/11/14 11:28:05 njoly Exp $
 #
 
 MOUNTNAME=	v7fs
 
 ISRUMP=		# oui
+RUMP_DISKFS=
 
 .include bsd.prog.mk



CVS commit: src/sys/arch/x86/x86

2011-11-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Nov 14 11:29:48 UTC 2011

Modified Files:
src/sys/arch/x86/x86: platform.c

Log Message:
add machdep.dmi.bios-date


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/x86/x86/platform.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/x86/platform.c
diff -u src/sys/arch/x86/x86/platform.c:1.12 src/sys/arch/x86/x86/platform.c:1.13
--- src/sys/arch/x86/x86/platform.c:1.12	Mon Nov 14 02:44:59 2011
+++ src/sys/arch/x86/x86/platform.c	Mon Nov 14 11:29:48 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: platform.c,v 1.12 2011/11/14 02:44:59 jmcneill Exp $ */
+/* $NetBSD: platform.c,v 1.13 2011/11/14 11:29:48 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca
@@ -29,7 +29,7 @@
 #include isa.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: platform.c,v 1.12 2011/11/14 02:44:59 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: platform.c,v 1.13 2011/11/14 11:29:48 jmcneill Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -242,6 +242,7 @@ platform_add_date(struct smbtable *tbl, 
 		year += 1900;
 	sprintf(datestr, %04u%02u%02u, year, month, day);
 	pmf_set_platform(key, datestr);
+	platform_create_sysctl(key);
 }
 
 static void



CVS commit: src/crypto/dist/ipsec-tools/src/libipsec

2011-11-14 Thread Timo Teräs
Module Name:src
Committed By:   tteras
Date:   Mon Nov 14 13:24:05 UTC 2011

Modified Files:
src/crypto/dist/ipsec-tools/src/libipsec: pfkey.c

Log Message:
From Marcelo Leitner mleit...@redhat.com: do not shrink pfkey socket
buffers (if system default is larger than what we want as minimum)


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/crypto/dist/ipsec-tools/src/libipsec/pfkey.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/dist/ipsec-tools/src/libipsec/pfkey.c
diff -u src/crypto/dist/ipsec-tools/src/libipsec/pfkey.c:1.21 src/crypto/dist/ipsec-tools/src/libipsec/pfkey.c:1.22
--- src/crypto/dist/ipsec-tools/src/libipsec/pfkey.c:1.21	Thu Jan 20 16:08:35 2011
+++ src/crypto/dist/ipsec-tools/src/libipsec/pfkey.c	Mon Nov 14 13:24:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pfkey.c,v 1.21 2011/01/20 16:08:35 vanhu Exp $	*/
+/*	$NetBSD: pfkey.c,v 1.22 2011/11/14 13:24:04 tteras Exp $	*/
 
 /*	$KAME: pfkey.c,v 1.47 2003/10/02 19:52:12 itojun Exp $	*/
 
@@ -1783,7 +1783,9 @@ int
 pfkey_open(void)
 {
 	int so;
-	int bufsiz = 128 * 1024;	/*is 128K enough?*/
+	int bufsiz_current, bufsiz_wanted;
+	int ret;
+	socklen_t len;
 
 	if ((so = socket(PF_KEY, SOCK_RAW, PF_KEY_V2))  0) {
 		__ipsec_set_strerror(strerror(errno));
@@ -1794,14 +1796,29 @@ pfkey_open(void)
 	 * This is a temporary workaround for KAME PR 154.
 	 * Don't really care even if it fails.
 	 */
-	(void)setsockopt(so, SOL_SOCKET, SO_SNDBUF, bufsiz, sizeof(bufsiz));
-	(void)setsockopt(so, SOL_SOCKET, SO_RCVBUF, bufsiz, sizeof(bufsiz));
-	bufsiz = 256 * 1024;
-	(void)setsockopt(so, SOL_SOCKET, SO_RCVBUF, bufsiz, sizeof(bufsiz));
-	bufsiz = 512 * 1024;
-	(void)setsockopt(so, SOL_SOCKET, SO_RCVBUF, bufsiz, sizeof(bufsiz));
-	bufsiz = 1024 * 1024;
-	(void)setsockopt(so, SOL_SOCKET, SO_RCVBUF, bufsiz, sizeof(bufsiz));
+	/* Try to have 128k. If we have more, do not lower it. */
+	bufsiz_wanted = 128 * 1024;
+	len = sizeof(bufsiz_current);
+	ret = getsockopt(so, SOL_SOCKET, SO_SNDBUF,
+		bufsiz_current, len);
+	if ((ret  0) || (bufsiz_current  bufsiz_wanted))
+		(void)setsockopt(so, SOL_SOCKET, SO_SNDBUF,
+			bufsiz_wanted, sizeof(bufsiz_wanted));
+
+	/* Try to have have at least 2MB. If we have more, do not lower it. */
+	bufsiz_wanted = 2 * 1024 * 1024;
+	len = sizeof(bufsiz_current);
+	ret = getsockopt(so, SOL_SOCKET, SO_RCVBUF,
+		bufsiz_current, len);
+	if (ret  0)
+		bufsiz_current = 128 * 1024;
+
+	for (; bufsiz_wanted  bufsiz_current; bufsiz_wanted /= 2) {
+		if (setsockopt(so, SOL_SOCKET, SO_RCVBUF,
+bufsiz_wanted, sizeof(bufsiz_wanted)) == 0)
+			break;
+	}
+
 	__ipsec_errcode = EIPSEC_NO_ERROR;
 	return so;
 }



CVS commit: [ipsec-tools-0_8-branch] src/crypto/dist/ipsec-tools/src/libipsec

2011-11-14 Thread Timo Teräs
Module Name:src
Committed By:   tteras
Date:   Mon Nov 14 13:25:06 UTC 2011

Modified Files:
src/crypto/dist/ipsec-tools/src/libipsec [ipsec-tools-0_8-branch]:
pfkey.c

Log Message:
From Marcelo Leitner mleit...@redhat.com: do not shrink pfkey socket
buffers (if system default is larger than what we want as minimum)


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.21.2.1 \
src/crypto/dist/ipsec-tools/src/libipsec/pfkey.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/dist/ipsec-tools/src/libipsec/pfkey.c
diff -u src/crypto/dist/ipsec-tools/src/libipsec/pfkey.c:1.21 src/crypto/dist/ipsec-tools/src/libipsec/pfkey.c:1.21.2.1
--- src/crypto/dist/ipsec-tools/src/libipsec/pfkey.c:1.21	Thu Jan 20 16:08:35 2011
+++ src/crypto/dist/ipsec-tools/src/libipsec/pfkey.c	Mon Nov 14 13:25:06 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pfkey.c,v 1.21 2011/01/20 16:08:35 vanhu Exp $	*/
+/*	$NetBSD: pfkey.c,v 1.21.2.1 2011/11/14 13:25:06 tteras Exp $	*/
 
 /*	$KAME: pfkey.c,v 1.47 2003/10/02 19:52:12 itojun Exp $	*/
 
@@ -1783,7 +1783,9 @@ int
 pfkey_open(void)
 {
 	int so;
-	int bufsiz = 128 * 1024;	/*is 128K enough?*/
+	int bufsiz_current, bufsiz_wanted;
+	int ret;
+	socklen_t len;
 
 	if ((so = socket(PF_KEY, SOCK_RAW, PF_KEY_V2))  0) {
 		__ipsec_set_strerror(strerror(errno));
@@ -1794,14 +1796,29 @@ pfkey_open(void)
 	 * This is a temporary workaround for KAME PR 154.
 	 * Don't really care even if it fails.
 	 */
-	(void)setsockopt(so, SOL_SOCKET, SO_SNDBUF, bufsiz, sizeof(bufsiz));
-	(void)setsockopt(so, SOL_SOCKET, SO_RCVBUF, bufsiz, sizeof(bufsiz));
-	bufsiz = 256 * 1024;
-	(void)setsockopt(so, SOL_SOCKET, SO_RCVBUF, bufsiz, sizeof(bufsiz));
-	bufsiz = 512 * 1024;
-	(void)setsockopt(so, SOL_SOCKET, SO_RCVBUF, bufsiz, sizeof(bufsiz));
-	bufsiz = 1024 * 1024;
-	(void)setsockopt(so, SOL_SOCKET, SO_RCVBUF, bufsiz, sizeof(bufsiz));
+	/* Try to have 128k. If we have more, do not lower it. */
+	bufsiz_wanted = 128 * 1024;
+	len = sizeof(bufsiz_current);
+	ret = getsockopt(so, SOL_SOCKET, SO_SNDBUF,
+		bufsiz_current, len);
+	if ((ret  0) || (bufsiz_current  bufsiz_wanted))
+		(void)setsockopt(so, SOL_SOCKET, SO_SNDBUF,
+			bufsiz_wanted, sizeof(bufsiz_wanted));
+
+	/* Try to have have at least 2MB. If we have more, do not lower it. */
+	bufsiz_wanted = 2 * 1024 * 1024;
+	len = sizeof(bufsiz_current);
+	ret = getsockopt(so, SOL_SOCKET, SO_RCVBUF,
+		bufsiz_current, len);
+	if (ret  0)
+		bufsiz_current = 128 * 1024;
+
+	for (; bufsiz_wanted  bufsiz_current; bufsiz_wanted /= 2) {
+		if (setsockopt(so, SOL_SOCKET, SO_RCVBUF,
+bufsiz_wanted, sizeof(bufsiz_wanted)) == 0)
+			break;
+	}
+
 	__ipsec_errcode = EIPSEC_NO_ERROR;
 	return so;
 }



CVS commit: src/dist/nvi/common

2011-11-14 Thread Takehiko NOZAKI
Module Name:src
Committed By:   tnozaki
Date:   Mon Nov 14 13:29:07 UTC 2011

Modified Files:
src/dist/nvi/common: key.h

Log Message:
nvi cannot display international character(west european accented chars).
reported by Ian D. Leroux at current-users, thanks a lot!


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/dist/nvi/common/key.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/dist/nvi/common/key.h
diff -u src/dist/nvi/common/key.h:1.2 src/dist/nvi/common/key.h:1.3
--- src/dist/nvi/common/key.h:1.2	Mon Mar 21 14:53:02 2011
+++ src/dist/nvi/common/key.h	Mon Nov 14 13:29:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: key.h,v 1.2 2011/03/21 14:53:02 tnozaki Exp $ */
+/*	$NetBSD: key.h,v 1.3 2011/11/14 13:29:07 tnozaki Exp $ */
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -28,7 +28,7 @@
 sp-conv.input2int(sp, n, nlen, (cw), wlen, w)
 #define CONST
 #define CHAR_WIDTH(sp, ch)  wcwidth(ch)
-#define INTISWIDE(c)	(!!(c  8))	/* XXX wrong name */
+#define INTISWIDE(c)	(wctob(c) == EOF)	/* XXX wrong name */
 #else
 #define FILE2INT5(sp,buf,n,nlen,w,wlen) \
 (w = n, wlen = nlen, 0)



CVS commit: [yamt-pagecache] src/sys/uvm

2011-11-14 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Mon Nov 14 14:21:41 UTC 2011

Modified Files:
src/sys/uvm [yamt-pagecache]: uvm_page.h

Log Message:
remove now unused UVM_PAGE_TREE_PENALTY


To generate a diff of this commit:
cvs rdiff -u -r1.73.2.4 -r1.73.2.5 src/sys/uvm/uvm_page.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/uvm/uvm_page.h
diff -u src/sys/uvm/uvm_page.h:1.73.2.4 src/sys/uvm/uvm_page.h:1.73.2.5
--- src/sys/uvm/uvm_page.h:1.73.2.4	Sun Nov 13 01:18:02 2011
+++ src/sys/uvm/uvm_page.h	Mon Nov 14 14:21:41 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.h,v 1.73.2.4 2011/11/13 01:18:02 yamt Exp $	*/
+/*	$NetBSD: uvm_page.h,v 1.73.2.5 2011/11/14 14:21:41 yamt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -325,8 +325,6 @@ paddr_t uvm_vm_page_to_phys(const struct
  * macros
  */
 
-#define UVM_PAGE_TREE_PENALTY	4	/* XXX: a guess */
-
 #define VM_PAGE_TO_PHYS(entry)	uvm_vm_page_to_phys(entry)
 
 #ifdef __HAVE_VM_PAGE_MD



CVS commit: [yamt-pagecache] src/sys/uvm

2011-11-14 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Mon Nov 14 14:22:28 UTC 2011

Modified Files:
src/sys/uvm [yamt-pagecache]: uvm_page_array.h

Log Message:
comment


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/uvm/uvm_page_array.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/uvm/uvm_page_array.h
diff -u src/sys/uvm/uvm_page_array.h:1.1.2.2 src/sys/uvm/uvm_page_array.h:1.1.2.3
--- src/sys/uvm/uvm_page_array.h:1.1.2.2	Sun Nov  6 22:04:07 2011
+++ src/sys/uvm/uvm_page_array.h	Mon Nov 14 14:22:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page_array.h,v 1.1.2.2 2011/11/06 22:04:07 yamt Exp $	*/
+/*	$NetBSD: uvm_page_array.h,v 1.1.2.3 2011/11/14 14:22:28 yamt Exp $	*/
 
 /*-
  * Copyright (c)2011 YAMAMOTO Takashi,
@@ -43,7 +43,7 @@
  *	uvm_page_array_init(ar);
  *	while ((pg = uvm_page_array_fill_and_peek(ar, uobj, off, ))
  *	!= NULL) {
- *		nextoff = pg-offset + PAGE_SIZE;
+ *		off = pg-offset + PAGE_SIZE;
  *		do_something(pg);
  *		uvm_page_array_advance(ar);
  *	}



CVS commit: [yamt-pagecache] src/sys/uvm

2011-11-14 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Mon Nov 14 14:23:16 UTC 2011

Modified Files:
src/sys/uvm [yamt-pagecache]: uvm_fault.c

Log Message:
assertions


To generate a diff of this commit:
cvs rdiff -u -r1.190.2.1 -r1.190.2.2 src/sys/uvm/uvm_fault.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/uvm/uvm_fault.c
diff -u src/sys/uvm/uvm_fault.c:1.190.2.1 src/sys/uvm/uvm_fault.c:1.190.2.2
--- src/sys/uvm/uvm_fault.c:1.190.2.1	Wed Nov  2 21:54:00 2011
+++ src/sys/uvm/uvm_fault.c	Mon Nov 14 14:23:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_fault.c,v 1.190.2.1 2011/11/02 21:54:00 yamt Exp $	*/
+/*	$NetBSD: uvm_fault.c,v 1.190.2.2 2011/11/14 14:23:16 yamt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_fault.c,v 1.190.2.1 2011/11/02 21:54:00 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_fault.c,v 1.190.2.2 2011/11/14 14:23:16 yamt Exp $);
 
 #include opt_uvmhist.h
 
@@ -1186,7 +1186,10 @@ uvm_fault_upper_neighbor(
 	UVMHIST_FUNC(uvm_fault_upper_neighbor); UVMHIST_CALLED(maphist);
 
 	/* locked: amap, anon */
-
+	KASSERT(pg-uobject == NULL);
+	KASSERT(pg-uanon != NULL);
+	KASSERT(mutex_owned(pg-uanon-an_lock));
+	KASSERT(uvm_pagegetdirty(pg) != UVM_PAGE_STATUS_CLEAN);
 	mutex_enter(uvm_pageqlock);
 	uvm_pageenqueue(pg);
 	mutex_exit(uvm_pageqlock);
@@ -1462,6 +1465,7 @@ uvm_fault_upper_enter(
 	KASSERT(anon-an_lock == amap-am_lock);
 	KASSERT(oanon-an_lock == amap-am_lock);
 	KASSERT(uobj == NULL || mutex_owned(uobj-vmobjlock));
+	KASSERT(uvm_pagegetdirty(pg) != UVM_PAGE_STATUS_CLEAN);
 
 	/*
 	 * now map the page in.



CVS commit: [yamt-pagecache] src/sys/uvm

2011-11-14 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Mon Nov 14 14:24:54 UTC 2011

Modified Files:
src/sys/uvm [yamt-pagecache]: uvm_extern.h uvm_meter.c

Log Message:
might dirty - possibly dirty
suggested by wiz@


To generate a diff of this commit:
cvs rdiff -u -r1.176.2.2 -r1.176.2.3 src/sys/uvm/uvm_extern.h
cvs rdiff -u -r1.56.4.3 -r1.56.4.4 src/sys/uvm/uvm_meter.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/uvm/uvm_extern.h
diff -u src/sys/uvm/uvm_extern.h:1.176.2.2 src/sys/uvm/uvm_extern.h:1.176.2.3
--- src/sys/uvm/uvm_extern.h:1.176.2.2	Sat Nov 12 02:54:04 2011
+++ src/sys/uvm/uvm_extern.h	Mon Nov 14 14:24:54 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_extern.h,v 1.176.2.2 2011/11/12 02:54:04 yamt Exp $	*/
+/*	$NetBSD: uvm_extern.h,v 1.176.2.3 2011/11/14 14:24:54 yamt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -456,10 +456,10 @@ struct uvmexp_sysctl {
 	int64_t colorhit;
 	int64_t colormiss;
 	int64_t ncolors;
-	int64_t mightdirtypages;
+	int64_t possiblydirtypages;
 	int64_t cleanpages;
 	int64_t dirtypages;
-	int64_t mightdirtyanonpages;
+	int64_t possiblydirtyanonpages;
 	int64_t cleananonpages;
 	int64_t dirtyanonpages;
 };

Index: src/sys/uvm/uvm_meter.c
diff -u src/sys/uvm/uvm_meter.c:1.56.4.3 src/sys/uvm/uvm_meter.c:1.56.4.4
--- src/sys/uvm/uvm_meter.c:1.56.4.3	Sun Nov 13 01:36:25 2011
+++ src/sys/uvm/uvm_meter.c	Mon Nov 14 14:24:54 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_meter.c,v 1.56.4.3 2011/11/13 01:36:25 yamt Exp $	*/
+/*	$NetBSD: uvm_meter.c,v 1.56.4.4 2011/11/14 14:24:54 yamt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_meter.c,v 1.56.4.3 2011/11/13 01:36:25 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_meter.c,v 1.56.4.4 2011/11/14 14:24:54 yamt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -179,11 +179,11 @@ sysctl_vm_uvmexp2(SYSCTLFN_ARGS)
 	for (CPU_INFO_FOREACH(cii, ci)) {
 		struct uvm_cpu *ucpu = ci-ci_data.cpu_uvm;
 
-		u.mightdirtypages +=
+		u.possiblydirtypages +=
 		ucpu-pagestate[0][UVM_PAGE_STATUS_UNKNOWN];
 		u.cleanpages += ucpu-pagestate[0][UVM_PAGE_STATUS_CLEAN];
 		u.dirtypages += ucpu-pagestate[0][UVM_PAGE_STATUS_DIRTY];
-		u.mightdirtyanonpages +=
+		u.possiblydirtyanonpages +=
 		ucpu-pagestate[1][UVM_PAGE_STATUS_UNKNOWN];
 		u.cleananonpages += ucpu-pagestate[1][UVM_PAGE_STATUS_CLEAN];
 		u.dirtyanonpages += ucpu-pagestate[1][UVM_PAGE_STATUS_DIRTY];



CVS commit: [yamt-pagecache] src/usr.bin/vmstat

2011-11-14 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Mon Nov 14 14:27:53 UTC 2011

Modified Files:
src/usr.bin/vmstat [yamt-pagecache]: vmstat.c

Log Message:
might dirty - possibly dirty
suggested by wiz@


To generate a diff of this commit:
cvs rdiff -u -r1.186.2.1 -r1.186.2.2 src/usr.bin/vmstat/vmstat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/vmstat/vmstat.c
diff -u src/usr.bin/vmstat/vmstat.c:1.186.2.1 src/usr.bin/vmstat/vmstat.c:1.186.2.2
--- src/usr.bin/vmstat/vmstat.c:1.186.2.1	Sat Nov 12 04:12:52 2011
+++ src/usr.bin/vmstat/vmstat.c	Mon Nov 14 14:27:53 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.186.2.1 2011/11/12 04:12:52 yamt Exp $ */
+/* $NetBSD: vmstat.c,v 1.186.2.2 2011/11/14 14:27:53 yamt Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@ __COPYRIGHT(@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = @(#)vmstat.c	8.2 (Berkeley) 3/1/95;
 #else
-__RCSID($NetBSD: vmstat.c,v 1.186.2.1 2011/11/12 04:12:52 yamt Exp $);
+__RCSID($NetBSD: vmstat.c,v 1.186.2.2 2011/11/14 14:27:53 yamt Exp $);
 #endif
 #endif /* not lint */
 
@@ -894,14 +894,14 @@ dosum(void)
 		(void)printf(%9 PRIu64  pages inactive\n, uvmexp2.inactive);
 		(void)printf(%9 PRIu64  file pages known clean\n,
 		uvmexp2.cleanpages);
-		(void)printf(%9 PRIu64  file pages might dirty\n,
-		uvmexp2.mightdirtypages);
+		(void)printf(%9 PRIu64  file pages possibly dirty\n,
+		uvmexp2.possiblydirtypages);
 		(void)printf(%9 PRIu64  file pages known dirty\n,
 		uvmexp2.dirtypages);
 		(void)printf(%9 PRIu64  anonymous pages known clean\n,
 		uvmexp2.cleananonpages);
-		(void)printf(%9 PRIu64  anonymous pages might dirty\n,
-		uvmexp2.mightdirtyanonpages);
+		(void)printf(%9 PRIu64  anonymous pages possibly dirty\n,
+		uvmexp2.possiblydirtyanonpages);
 		(void)printf(%9 PRIu64  anonymous pages known dirty\n,
 		uvmexp2.dirtyanonpages);
 	}



CVS commit: src/common/lib/libutil

2011-11-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 14 14:36:40 UTC 2011

Modified Files:
src/common/lib/libutil: getfstypename.c

Log Message:
- fix boot block building (-D_STANDALONE)
- explain why we cast.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libutil/getfstypename.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libutil/getfstypename.c
diff -u src/common/lib/libutil/getfstypename.c:1.2 src/common/lib/libutil/getfstypename.c:1.3
--- src/common/lib/libutil/getfstypename.c:1.2	Sun Nov 13 17:21:29 2011
+++ src/common/lib/libutil/getfstypename.c	Mon Nov 14 09:36:40 2011
@@ -34,25 +34,29 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-#ifndef _KERNEL
+#if !defined(_KERNEL)  !defined(_STANDALONE)
 # if !defined(lint)
-__RCSID($NetBSD: getfstypename.c,v 1.2 2011/11/13 22:21:29 christos Exp $);
+__RCSID($NetBSD: getfstypename.c,v 1.3 2011/11/14 14:36:40 christos Exp $);
 # endif
 #else
-__KERNEL_RCSID(0, $NetBSD: getfstypename.c,v 1.2 2011/11/13 22:21:29 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: getfstypename.c,v 1.3 2011/11/14 14:36:40 christos Exp $);
 #endif
 
 #define FSTYPE_ENUMNAME fstype_enum
 #include sys/types.h
 #include sys/disk.h
 #include sys/disklabel.h
-#ifndef _KERNEL
+#if !defined(_KERNEL)  !defined(_STANDALONE)
 #include util.h
 #endif
 
 const char *
 getfstypename(int fstype)
 {
+	/*
+	 * The cast is so that the compiler can check that we
+	 * cover all the enum values
+	 */
 	switch ((enum fstype_enum)fstype) {
 	case FS_UNUSED:
 		return DKW_PTYPE_UNUSED;
@@ -115,6 +119,6 @@ getfstypename(int fstype)
 	case FSMAXTYPES:
 		return DKW_PTYPE_UNKNOWN;
 	}
-	/* Stupid gcc */
+	/* Stupid gcc, should know it is impossible to get here */
 	return DKW_PTYPE_UNKNOWN;
 }



CVS commit: src/common/lib/libutil

2011-11-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 14 14:37:13 UTC 2011

Modified Files:
src/common/lib/libutil: getfstypename.c

Log Message:
add netbsd id


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/common/lib/libutil/getfstypename.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libutil/getfstypename.c
diff -u src/common/lib/libutil/getfstypename.c:1.3 src/common/lib/libutil/getfstypename.c:1.4
--- src/common/lib/libutil/getfstypename.c:1.3	Mon Nov 14 09:36:40 2011
+++ src/common/lib/libutil/getfstypename.c	Mon Nov 14 09:37:13 2011
@@ -1,3 +1,5 @@
+/*	$NetBSD: getfstypename.c,v 1.4 2011/11/14 14:37:13 christos Exp $	*/
+
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -36,10 +38,10 @@
 #include sys/cdefs.h
 #if !defined(_KERNEL)  !defined(_STANDALONE)
 # if !defined(lint)
-__RCSID($NetBSD: getfstypename.c,v 1.3 2011/11/14 14:36:40 christos Exp $);
+__RCSID($NetBSD: getfstypename.c,v 1.4 2011/11/14 14:37:13 christos Exp $);
 # endif
 #else
-__KERNEL_RCSID(0, $NetBSD: getfstypename.c,v 1.3 2011/11/14 14:36:40 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: getfstypename.c,v 1.4 2011/11/14 14:37:13 christos Exp $);
 #endif
 
 #define FSTYPE_ENUMNAME fstype_enum



CVS commit: src/sys/arch/xen/xen

2011-11-14 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Nov 14 16:04:30 UTC 2011

Modified Files:
src/sys/arch/xen/xen: xbdback_xenbus.c

Log Message:
Bring back sys/disklabel.h for DISKUNIT and DISKPART.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/xen/xen/xbdback_xenbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/xen/xbdback_xenbus.c
diff -u src/sys/arch/xen/xen/xbdback_xenbus.c:1.49 src/sys/arch/xen/xen/xbdback_xenbus.c:1.50
--- src/sys/arch/xen/xen/xbdback_xenbus.c:1.49	Sun Nov 13 23:02:06 2011
+++ src/sys/arch/xen/xen/xbdback_xenbus.c	Mon Nov 14 16:04:29 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbdback_xenbus.c,v 1.49 2011/11/13 23:02:06 christos Exp $  */
+/*  $NetBSD: xbdback_xenbus.c,v 1.50 2011/11/14 16:04:29 hannken Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xbdback_xenbus.c,v 1.49 2011/11/13 23:02:06 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: xbdback_xenbus.c,v 1.50 2011/11/14 16:04:29 hannken Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -38,6 +38,7 @@ __KERNEL_RCSID(0, $NetBSD: xbdback_xenb
 #include sys/conf.h
 #include sys/disk.h
 #include sys/device.h
+#include sys/disklabel.h
 #include sys/fcntl.h
 #include sys/vnode.h
 #include sys/kauth.h



CVS commit: src/common/lib/libutil

2011-11-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 14 16:21:44 UTC 2011

Modified Files:
src/common/lib/libutil: getfstypename.c

Log Message:
compile into nothing if _STANDALONE


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libutil/getfstypename.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libutil/getfstypename.c
diff -u src/common/lib/libutil/getfstypename.c:1.4 src/common/lib/libutil/getfstypename.c:1.5
--- src/common/lib/libutil/getfstypename.c:1.4	Mon Nov 14 09:37:13 2011
+++ src/common/lib/libutil/getfstypename.c	Mon Nov 14 11:21:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: getfstypename.c,v 1.4 2011/11/14 14:37:13 christos Exp $	*/
+/*	$NetBSD: getfstypename.c,v 1.5 2011/11/14 16:21:44 christos Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -35,22 +35,23 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
-#include sys/cdefs.h
-#if !defined(_KERNEL)  !defined(_STANDALONE)
-# if !defined(lint)
-__RCSID($NetBSD: getfstypename.c,v 1.4 2011/11/14 14:37:13 christos Exp $);
-# endif
-#else
-__KERNEL_RCSID(0, $NetBSD: getfstypename.c,v 1.4 2011/11/14 14:37:13 christos Exp $);
-#endif
+#ifndef _STANDALONE
+# include sys/cdefs.h
+# ifndef _KERNEL
+#  if !defined(lint)
+__RCSID($NetBSD: getfstypename.c,v 1.5 2011/11/14 16:21:44 christos Exp $);
+#  endif
+# else
+__KERNEL_RCSID(0, $NetBSD: getfstypename.c,v 1.5 2011/11/14 16:21:44 christos Exp $);
+# endif /* _KERNEL */
 
-#define FSTYPE_ENUMNAME fstype_enum
-#include sys/types.h
-#include sys/disk.h
-#include sys/disklabel.h
-#if !defined(_KERNEL)  !defined(_STANDALONE)
-#include util.h
-#endif
+# define FSTYPE_ENUMNAME fstype_enum
+# include sys/types.h
+# include sys/disk.h
+# include sys/disklabel.h
+# ifndef _KERNEL
+#  include util.h
+# endif
 
 const char *
 getfstypename(int fstype)
@@ -124,3 +125,4 @@ getfstypename(int fstype)
 	/* Stupid gcc, should know it is impossible to get here */
 	return DKW_PTYPE_UNKNOWN;
 }
+#endif /* !_STANDALONE */



CVS commit: src/bin/sh

2011-11-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 14 18:24:45 UTC 2011

Modified Files:
src/bin/sh: eval.c

Log Message:
PR/45613: Aleksey Cheusov: /bin/sh: 'set -e' + 'if eval false' problem
Fixed from: http://www.freebsd.org/cgi/query-pr.cgi?pr=134881cat=


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/bin/sh/eval.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/eval.c
diff -u src/bin/sh/eval.c:1.102 src/bin/sh/eval.c:1.103
--- src/bin/sh/eval.c:1.102	Wed Aug 31 12:24:54 2011
+++ src/bin/sh/eval.c	Mon Nov 14 13:24:45 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: eval.c,v 1.102 2011/08/31 16:24:54 plunky Exp $	*/
+/*	$NetBSD: eval.c,v 1.103 2011/11/14 18:24:45 christos Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = @(#)eval.c	8.9 (Berkeley) 6/8/95;
 #else
-__RCSID($NetBSD: eval.c,v 1.102 2011/08/31 16:24:54 plunky Exp $);
+__RCSID($NetBSD: eval.c,v 1.103 2011/11/14 18:24:45 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -92,6 +92,7 @@ int evalskip;			/* set if we are skippin
 STATIC int skipcount;		/* number of levels to skip */
 MKINIT int loopnest;		/* current loop nesting level */
 int funcnest;			/* depth of function calls */
+STATIC int builtin_flags;	/* evalcommand flags for builtins */
 
 
 const char *commandname;
@@ -181,7 +182,7 @@ evalcmd(int argc, char **argv)
 STPUTC('\0', concat);
 p = grabstackstr(concat);
 }
-evalstring(p, 0);
+evalstring(p, builtin_flags  EV_TESTED);
 }
 return exitstatus;
 }
@@ -1010,6 +1011,7 @@ normal_fork:
 			/* and getopt */
 			optreset = 1;
 			optind = 1;
+			builtin_flags = flags;
 			exitstatus = cmdentry.u.bltin(argc, argv);
 		} else {
 			e = exception;



CVS commit: src/sys

2011-11-14 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Nov 14 18:35:15 UTC 2011

Modified Files:
src/sys/fs/adosfs: advfsops.c
src/sys/fs/cd9660: cd9660_vfsops.c
src/sys/fs/filecorefs: filecore_vfsops.c
src/sys/fs/hfs: hfs_subr.c
src/sys/fs/msdosfs: msdosfs_vfsops.c
src/sys/fs/nilfs: nilfs_vfsops.c
src/sys/fs/ntfs: ntfs_vfsops.c
src/sys/fs/udf: udf_vfsops.c
src/sys/ufs/ext2fs: ext2fs_vfsops.c
src/sys/ufs/ffs: ffs_vfsops.c
src/sys/ufs/lfs: lfs_vfsops.c

Log Message:
VOP_OPEN() needs a locked vnode.  All these copy-and-pasted xxxfs_mount()
implementations need more review.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/fs/adosfs/advfsops.c
cvs rdiff -u -r1.73 -r1.74 src/sys/fs/cd9660/cd9660_vfsops.c
cvs rdiff -u -r1.67 -r1.68 src/sys/fs/filecorefs/filecore_vfsops.c
cvs rdiff -u -r1.16 -r1.17 src/sys/fs/hfs/hfs_subr.c
cvs rdiff -u -r1.92 -r1.93 src/sys/fs/msdosfs/msdosfs_vfsops.c
cvs rdiff -u -r1.7 -r1.8 src/sys/fs/nilfs/nilfs_vfsops.c
cvs rdiff -u -r1.86 -r1.87 src/sys/fs/ntfs/ntfs_vfsops.c
cvs rdiff -u -r1.61 -r1.62 src/sys/fs/udf/udf_vfsops.c
cvs rdiff -u -r1.161 -r1.162 src/sys/ufs/ext2fs/ext2fs_vfsops.c
cvs rdiff -u -r1.270 -r1.271 src/sys/ufs/ffs/ffs_vfsops.c
cvs rdiff -u -r1.290 -r1.291 src/sys/ufs/lfs/lfs_vfsops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/adosfs/advfsops.c
diff -u src/sys/fs/adosfs/advfsops.c:1.62 src/sys/fs/adosfs/advfsops.c:1.63
--- src/sys/fs/adosfs/advfsops.c:1.62	Sun Jun 12 03:35:52 2011
+++ src/sys/fs/adosfs/advfsops.c	Mon Nov 14 18:35:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: advfsops.c,v 1.62 2011/06/12 03:35:52 rmind Exp $	*/
+/*	$NetBSD: advfsops.c,v 1.63 2011/11/14 18:35:12 hannken Exp $	*/
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: advfsops.c,v 1.62 2011/06/12 03:35:52 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: advfsops.c,v 1.63 2011/11/14 18:35:12 hannken Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_compat_netbsd.h
@@ -176,9 +176,13 @@ adosfs_mountfs(struct vnode *devvp, stru
 	/*
 	 * open blkdev and read root block
 	 */
-	if ((error = VOP_OPEN(devvp, FREAD, NOCRED)) != 0)
+	vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY);
+	if ((error = VOP_OPEN(devvp, FREAD, NOCRED)) != 0) {
+		VOP_UNLOCK(devvp);
 		return (error);
+	}
 	error = VOP_IOCTL(devvp, DIOCGDINFO, dl, FREAD, NOCRED);
+	VOP_UNLOCK(devvp);
 	if (error)
 		goto fail;
 

Index: src/sys/fs/cd9660/cd9660_vfsops.c
diff -u src/sys/fs/cd9660/cd9660_vfsops.c:1.73 src/sys/fs/cd9660/cd9660_vfsops.c:1.74
--- src/sys/fs/cd9660/cd9660_vfsops.c:1.73	Tue Sep 27 01:01:43 2011
+++ src/sys/fs/cd9660/cd9660_vfsops.c	Mon Nov 14 18:35:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd9660_vfsops.c,v 1.73 2011/09/27 01:01:43 christos Exp $	*/
+/*	$NetBSD: cd9660_vfsops.c,v 1.74 2011/11/14 18:35:12 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1994
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cd9660_vfsops.c,v 1.73 2011/09/27 01:01:43 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: cd9660_vfsops.c,v 1.74 2011/11/14 18:35:12 hannken Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_compat_netbsd.h
@@ -271,7 +271,9 @@ cd9660_mount(struct mount *mp, const cha
 		return (error);
 	}
 	if ((mp-mnt_flag  MNT_UPDATE) == 0) {
+		vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY);
 		error = VOP_OPEN(devvp, FREAD, FSCRED);
+		VOP_UNLOCK(devvp);
 		if (error)
 			goto fail;
 		error = iso_mountfs(devvp, mp, l, args);

Index: src/sys/fs/filecorefs/filecore_vfsops.c
diff -u src/sys/fs/filecorefs/filecore_vfsops.c:1.67 src/sys/fs/filecorefs/filecore_vfsops.c:1.68
--- src/sys/fs/filecorefs/filecore_vfsops.c:1.67	Sun Jun 12 03:35:52 2011
+++ src/sys/fs/filecorefs/filecore_vfsops.c	Mon Nov 14 18:35:13 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: filecore_vfsops.c,v 1.67 2011/06/12 03:35:52 rmind Exp $	*/
+/*	$NetBSD: filecore_vfsops.c,v 1.68 2011/11/14 18:35:13 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1994 The Regents of the University of California.
@@ -66,7 +66,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: filecore_vfsops.c,v 1.67 2011/06/12 03:35:52 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: filecore_vfsops.c,v 1.68 2011/11/14 18:35:13 hannken Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_compat_netbsd.h
@@ -326,7 +326,9 @@ filecore_mountfs(struct vnode *devvp, st
 	if ((error = vinvalbuf(devvp, V_SAVE, l-l_cred, l, 0, 0)) != 0)
 		return (error);
 
+	vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY);
 	error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED);
+	VOP_UNLOCK(devvp);
 	if (error)
 		return error;
 

Index: src/sys/fs/hfs/hfs_subr.c
diff -u src/sys/fs/hfs/hfs_subr.c:1.16 src/sys/fs/hfs/hfs_subr.c:1.17
--- src/sys/fs/hfs/hfs_subr.c:1.16	Sun Nov 13 23:03:55 2011
+++ src/sys/fs/hfs/hfs_subr.c	Mon Nov 14 18:35:13 2011
@@ -1,4 +1,4 @@
-/*	

CVS commit: src/sys/fs/union

2011-11-14 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Nov 14 18:38:14 UTC 2011

Modified Files:
src/sys/fs/union: union_subr.c

Log Message:
Remove a needless vnode lock/unlock dance.  This is a leftover from the
removal of VOP_LEASE().

Function union_removed_upper() always works on unlocked upper vnodes so
remove the test-and-unlock and add an assertion.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/fs/union/union_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/union/union_subr.c
diff -u src/sys/fs/union/union_subr.c:1.51 src/sys/fs/union/union_subr.c:1.52
--- src/sys/fs/union/union_subr.c:1.51	Tue Oct 18 09:22:53 2011
+++ src/sys/fs/union/union_subr.c	Mon Nov 14 18:38:13 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: union_subr.c,v 1.51 2011/10/18 09:22:53 hannken Exp $	*/
+/*	$NetBSD: union_subr.c,v 1.52 2011/11/14 18:38:13 hannken Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -72,7 +72,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: union_subr.c,v 1.51 2011/10/18 09:22:53 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: union_subr.c,v 1.52 2011/11/14 18:38:13 hannken Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -638,11 +638,6 @@ union_copyfile(struct vnode *fvp, struct
 	uio.uio_offset = 0;
 	UIO_SETUP_SYSSPACE(uio);
 
-	VOP_UNLOCK(fvp);			/* XXX */
-	vn_lock(fvp, LK_EXCLUSIVE | LK_RETRY);	/* XXX */
-	VOP_UNLOCK(tvp);			/* XXX */
-	vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY);	/* XXX */
-
 	tbuf = malloc(MAXBSIZE, M_TEMP, M_WAITOK);
 
 	/* ugly loop follows... */
@@ -961,6 +956,7 @@ union_removed_upper(struct union_node *u
 {
 	int hash;
 
+	KASSERT((un-un_flags  UN_ULOCK) == 0);
 #if 1
 	/*
 	 * We do not set the uppervp to NULLVP here, because lowervp
@@ -984,11 +980,6 @@ union_removed_upper(struct union_node *u
 		LIST_REMOVE(un, un_cache);
 	}
 	mutex_exit(unheadlock[hash]);
-
-	if (un-un_flags  UN_ULOCK) {
-		un-un_flags = ~UN_ULOCK;
-		VOP_UNLOCK(un-un_uppervp);
-	}
 }
 
 #if 0



CVS commit: src/sys/fs/union

2011-11-14 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Nov 14 18:42:57 UTC 2011

Modified Files:
src/sys/fs/union: union_vnops.c

Log Message:
VOP_ABORTOP() has no specific lock requirements so there is no need
to force locked vnodes here.  It should be impossible to come here
with a nil upper node.

Relock the directory vnode after copyup.  A locked union node with an
unlocked upper vnode can no longer exist so make FIXUP() an assertion.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/fs/union/union_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/union/union_vnops.c
diff -u src/sys/fs/union/union_vnops.c:1.47 src/sys/fs/union/union_vnops.c:1.48
--- src/sys/fs/union/union_vnops.c:1.47	Tue Oct 18 09:22:53 2011
+++ src/sys/fs/union/union_vnops.c	Mon Nov 14 18:42:57 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: union_vnops.c,v 1.47 2011/10/18 09:22:53 hannken Exp $	*/
+/*	$NetBSD: union_vnops.c,v 1.48 2011/11/14 18:42:57 hannken Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993, 1994, 1995
@@ -72,7 +72,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: union_vnops.c,v 1.47 2011/10/18 09:22:53 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: union_vnops.c,v 1.48 2011/11/14 18:42:57 hannken Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -134,7 +134,6 @@ int union_getpages(void *);
 int union_putpages(void *);
 int union_kqfilter(void *);
 
-static void union_fixup(struct union_node *);
 static int union_lookup1(struct vnode *, struct vnode **,
 			  struct vnode **, struct componentname *);
 
@@ -190,23 +189,12 @@ const struct vnodeopv_entry_desc union_v
 const struct vnodeopv_desc union_vnodeop_opv_desc =
 	{ union_vnodeop_p, union_vnodeop_entries };
 
-#define FIXUP(un) { \
-	if (((un)-un_flags  UN_ULOCK) == 0) { \
-		union_fixup(un); \
-	} \
-}
+#define FIXUP(un) \
+	KASSERT(((un)-un_flags  UN_ULOCK) == UN_ULOCK)
 #define NODE_IS_SPECIAL(vp) \
 	((vp)-v_type == VBLK || (vp)-v_type == VCHR || \
 	(vp)-v_type == VSOCK || (vp)-v_type == VFIFO)
 
-static void
-union_fixup(struct union_node *un)
-{
-
-	vn_lock(un-un_uppervp, LK_EXCLUSIVE | LK_RETRY);
-	un-un_flags |= UN_ULOCK;
-}
-
 static int
 union_lookup1(struct vnode *udvp, struct vnode **dvpp, struct vnode **vpp,
 	struct componentname *cnp)
@@ -1248,6 +1236,9 @@ union_link(void *v)
 			}
 			error = union_copyup(un, 1, cnp-cn_cred, curlwp);
 			if (dun-un_uppervp == un-un_dirvp) {
+vn_lock(dun-un_uppervp,
+LK_EXCLUSIVE | LK_RETRY);
+dun-un_flags |= UN_ULOCK;
 /*
  * During copyup, we dropped the lock on the
  * dir and invalidated any saved namei lookup
@@ -1583,24 +1574,11 @@ union_abortop(void *v)
 		struct vnode *a_dvp;
 		struct componentname *a_cnp;
 	} */ *ap = v;
-	int error;
-	struct vnode *vp = OTHERVP(ap-a_dvp);
-	struct union_node *un = VTOUNION(ap-a_dvp);
-	int islocked = un-un_flags  UN_LOCKED;
-	int dolock = (vp == LOWERVP(ap-a_dvp));
 
-	if (islocked) {
-		if (dolock)
-			vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
-		else
-			FIXUP(VTOUNION(ap-a_dvp));
-	}
-	ap-a_dvp = vp;
-	error = VCALL(vp, VOFFSET(vop_abortop), ap);
-	if (islocked  dolock)
-		VOP_UNLOCK(vp);
+	KASSERT(UPPERVP(ap-a_dvp) != NULL);
 
-	return (error);
+	ap-a_dvp = UPPERVP(ap-a_dvp);
+	return VCALL(ap-a_dvp, VOFFSET(vop_abortop), ap);
 }
 
 int



CVS commit: src/tests/util/sh

2011-11-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 14 20:23:29 UTC 2011

Modified Files:
src/tests/util/sh: Makefile
Added Files:
src/tests/util/sh: t_evaltested.sh

Log Message:
Add a test for PR/45613 (eval failing in a tested context)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/util/sh/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/util/sh/t_evaltested.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/util/sh/Makefile
diff -u src/tests/util/sh/Makefile:1.3 src/tests/util/sh/Makefile:1.4
--- src/tests/util/sh/Makefile:1.3	Tue Oct 20 17:58:35 2009
+++ src/tests/util/sh/Makefile	Mon Nov 14 15:23:29 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2009/10/20 21:58:35 jmmv Exp $
+# $NetBSD: Makefile,v 1.4 2011/11/14 20:23:29 christos Exp $
 
 .include bsd.own.mk
 
@@ -7,6 +7,7 @@ TESTSDIR=	${TESTSBASE}/util/sh
 TESTS_SH=	t_compexit
 TESTS_SH+=	t_exit
 TESTS_SH+=	t_expand
+TESTS_SH+=	t_evaltested
 TESTS_SH+=	t_fsplit
 TESTS_SH+=	t_here
 TESTS_SH+=	t_set_e

Added files:

Index: src/tests/util/sh/t_evaltested.sh
diff -u /dev/null src/tests/util/sh/t_evaltested.sh:1.1
--- /dev/null	Mon Nov 14 15:23:29 2011
+++ src/tests/util/sh/t_evaltested.sh	Mon Nov 14 15:23:29 2011
@@ -0,0 +1,67 @@
+# $NetBSD: t_evaltested.sh,v 1.1 2011/11/14 20:23:29 christos Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, Inc.
+# 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.
+# 3. All advertising materials mentioning features or use of this software
+#must display the following acknowledgement:
+#This product includes software developed by the NetBSD
+#Foundation, Inc. and its contributors.
+# 4. Neither the name of The NetBSD Foundation nor the names of its
+#contributors may be used to endorse or promote products derived
+#from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+#
+
+atf_test_case evaltested
+
+evaltested_head() {
+	atf_set descr Tests that eval in a tested context does not exit
+}
+
+evaltested_body() {
+	set -e
+cat  helper.sh  EOF
+set -e
+if eval false
+then
+	echo 'eval false' returned true
+	exit 1
+fi
+echo passed
+exit 0
+EOF
+	output=$(/bin/sh helper.sh)
+	[ $? = 0 ]  return
+
+	if [ -n $output ]
+	then
+		atf_fail $output
+	else
+		atf_fail 'eval false' exited from a tested context
+	fi
+
+}
+
+atf_init_test_cases() {
+	atf_add_test_case evaltested
+}



CVS commit: src/distrib/sets/lists/tests

2011-11-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 14 20:25:15 UTC 2011

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
add t_evaltested


To generate a diff of this commit:
cvs rdiff -u -r1.422 -r1.423 src/distrib/sets/lists/tests/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.422 src/distrib/sets/lists/tests/mi:1.423
--- src/distrib/sets/lists/tests/mi:1.422	Sat Nov 12 14:39:01 2011
+++ src/distrib/sets/lists/tests/mi	Mon Nov 14 15:25:15 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.422 2011/11/12 19:39:01 riz Exp $
+# $NetBSD: mi,v 1.423 2011/11/14 20:25:15 christos Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -2898,6 +2898,7 @@
 ./usr/tests/util/sh/t_exit			tests-util-tests
 ./usr/tests/util/sh/t_exitstatus		tests-obsolete	obsolete
 ./usr/tests/util/sh/t_expand			tests-util-tests
+./usr/tests/util/sh/t_evaltested		tests-util-tests
 ./usr/tests/util/sh/t_fsplit			tests-util-tests
 ./usr/tests/util/sh/t_here			tests-util-tests
 ./usr/tests/util/sh/t_set_e			tests-util-tests



CVS commit: src/tests/util/sh

2011-11-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 14 20:47:33 UTC 2011

Modified Files:
src/tests/util/sh: t_evaltested.sh

Log Message:
remove c3 and c4


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/util/sh/t_evaltested.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/util/sh/t_evaltested.sh
diff -u src/tests/util/sh/t_evaltested.sh:1.1 src/tests/util/sh/t_evaltested.sh:1.2
--- src/tests/util/sh/t_evaltested.sh:1.1	Mon Nov 14 15:23:29 2011
+++ src/tests/util/sh/t_evaltested.sh	Mon Nov 14 15:47:33 2011
@@ -1,4 +1,4 @@
-# $NetBSD: t_evaltested.sh,v 1.1 2011/11/14 20:23:29 christos Exp $
+# $NetBSD: t_evaltested.sh,v 1.2 2011/11/14 20:47:33 christos Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -11,13 +11,6 @@
 # 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.
-# 3. All advertising materials mentioning features or use of this software
-#must display the following acknowledgement:
-#This product includes software developed by the NetBSD
-#Foundation, Inc. and its contributors.
-# 4. Neither the name of The NetBSD Foundation nor the names of its
-#contributors may be used to endorse or promote products derived
-#from this software without specific prior written permission.
 #
 # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED



CVS commit: src/sys/arch/xen/xen

2011-11-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 14 21:34:50 UTC 2011

Modified Files:
src/sys/arch/xen/xen: xbdback_xenbus.c

Log Message:
Use getdiskinfo() to print the name of the device; the previous code
constructed the wrong name if it was a wedge.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/xen/xen/xbdback_xenbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/xen/xbdback_xenbus.c
diff -u src/sys/arch/xen/xen/xbdback_xenbus.c:1.50 src/sys/arch/xen/xen/xbdback_xenbus.c:1.51
--- src/sys/arch/xen/xen/xbdback_xenbus.c:1.50	Mon Nov 14 11:04:29 2011
+++ src/sys/arch/xen/xen/xbdback_xenbus.c	Mon Nov 14 16:34:50 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbdback_xenbus.c,v 1.50 2011/11/14 16:04:29 hannken Exp $  */
+/*  $NetBSD: xbdback_xenbus.c,v 1.51 2011/11/14 21:34:50 christos Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xbdback_xenbus.c,v 1.50 2011/11/14 16:04:29 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: xbdback_xenbus.c,v 1.51 2011/11/14 21:34:50 christos Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -38,7 +38,6 @@ __KERNEL_RCSID(0, $NetBSD: xbdback_xenb
 #include sys/conf.h
 #include sys/disk.h
 #include sys/device.h
-#include sys/disklabel.h
 #include sys/fcntl.h
 #include sys/vnode.h
 #include sys/kauth.h
@@ -477,11 +476,14 @@ xbdback_xenbus_destroy(void *arg)
 	}
 	/* close device */
 	if (xbdi-xbdi_size) {
-		printf(xbd backend: detach device %s%PRId32%c for domain %d\n,
-		devsw_blk2name(major(xbdi-xbdi_dev)),
-		DISKUNIT(xbdi-xbdi_dev),
-		(char)DISKPART(xbdi-xbdi_dev) + 'a',
-		xbdi-xbdi_domid);
+		const char *name;
+		struct dkwedge_info wi;
+		if (getdiskinfo(xbdi-xbdi_vp, wi) == 0)
+			name = wi.dkw_devname;
+		else
+			name = *unknown*;
+		printf(xbd backend: detach device %s for domain %d\n,
+		name, xbdi-xbdi_domid);
 		vn_close(xbdi-xbdi_vp, FREAD, NOCRED);
 	}
 	SLIST_REMOVE(xbdback_instances, xbdi, xbdback_instance, next);



CVS commit: src

2011-11-14 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Tue Nov 15 00:19:43 UTC 2011

Modified Files:
src/distrib/sets/lists/comp: mi
src/share/man/man9: Makefile

Log Message:
pool_sethardlimit.9 = pool.9


To generate a diff of this commit:
cvs rdiff -u -r1.1707 -r1.1708 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.357 -r1.358 src/share/man/man9/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1707 src/distrib/sets/lists/comp/mi:1.1708
--- src/distrib/sets/lists/comp/mi:1.1707	Sun Nov 13 22:25:21 2011
+++ src/distrib/sets/lists/comp/mi	Tue Nov 15 00:19:42 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1707 2011/11/13 22:25:21 christos Exp $
+#	$NetBSD: mi,v 1.1708 2011/11/15 00:19:42 jym Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -10400,6 +10400,7 @@
 ./usr/share/man/cat9/pool_put.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/pool_sethiwat.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/pool_setlowat.0		comp-sys-catman		.cat
+./usr/share/man/cat9/pool_sethardlimit.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/postsig.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/powerhook_disestablish.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/powerhook_establish.0	comp-sys-catman		.cat
@@ -16499,6 +16500,7 @@
 ./usr/share/man/html9/pool_put.html		comp-sys-htmlman	html
 ./usr/share/man/html9/pool_sethiwat.html	comp-sys-htmlman	html
 ./usr/share/man/html9/pool_setlowat.html	comp-sys-htmlman	html
+./usr/share/man/html9/pool_sethardlimit.html	comp-sys-htmlman	html
 ./usr/share/man/html9/postsig.html		comp-sys-htmlman	html
 ./usr/share/man/html9/powerhook_disestablish.html	comp-sys-htmlman	html
 ./usr/share/man/html9/powerhook_establish.html	comp-sys-htmlman	html
@@ -22765,6 +22767,7 @@
 ./usr/share/man/man9/pool_put.9			comp-sys-man		.man
 ./usr/share/man/man9/pool_sethiwat.9		comp-sys-man		.man
 ./usr/share/man/man9/pool_setlowat.9		comp-sys-man		.man
+./usr/share/man/man9/pool_sethardlimit.9	comp-sys-man		.man
 ./usr/share/man/man9/postsig.9			comp-sys-man		.man
 ./usr/share/man/man9/powerhook_disestablish.9	comp-sys-man		.man
 ./usr/share/man/man9/powerhook_establish.9	comp-sys-man		.man

Index: src/share/man/man9/Makefile
diff -u src/share/man/man9/Makefile:1.357 src/share/man/man9/Makefile:1.358
--- src/share/man/man9/Makefile:1.357	Tue Nov  1 13:36:15 2011
+++ src/share/man/man9/Makefile	Tue Nov 15 00:19:42 2011
@@ -1,4 +1,4 @@
-#   $NetBSD: Makefile,v 1.357 2011/11/01 13:36:15 yamt Exp $
+#   $NetBSD: Makefile,v 1.358 2011/11/15 00:19:42 jym Exp $
 
 #	Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -627,7 +627,8 @@ MLINKS+=pmf.9 pmf_device_register.9 pmf.
 	pmf.9 pmf_set_platform.9 pmf.9 pmf_get_platform.9
 MLINKS+=pool.9 pool_create.9 pool.9 pool_destroy.9 pool.9 pool_get.9 \
 	pool.9 pool_init.9 pool.9 pool_put.9 pool.9 pool_prime.9 \
-	pool.9 pool_sethiwat.9 pool.9 pool_setlowat.9
+	pool.9 pool_sethiwat.9 pool.9 pool_setlowat.9 \
+	pool.9 pool_sethardlimit.9
 MLINKS+=pool_cache.9 pool_cache_init.9 \
 	pool_cache.9 pool_cache_destroy.9 \
 	pool_cache.9 pool_cache_get_paddr.9 \



CVS commit: src/share/man/man9

2011-11-14 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Tue Nov 15 00:32:34 UTC 2011

Modified Files:
src/share/man/man9: pool_cache.9

Log Message:
Document pool_cache_sethardlimit(9), the faithful friend of
pool_sethardlimit(9).


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/share/man/man9/pool_cache.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man9/pool_cache.9
diff -u src/share/man/man9/pool_cache.9:1.18 src/share/man/man9/pool_cache.9:1.19
--- src/share/man/man9/pool_cache.9:1.18	Wed Jun  1 20:49:22 2011
+++ src/share/man/man9/pool_cache.9	Tue Nov 15 00:32:34 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: pool_cache.9,v 1.18 2011/06/01 20:49:22 dyoung Exp $
+.\	$NetBSD: pool_cache.9,v 1.19 2011/11/15 00:32:34 jym Exp $
 .\
 .\ Copyright (c)2003 YAMAMOTO Takashi,
 .\ All rights reserved.
@@ -53,7 +53,7 @@
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
 .\ 
-.Dd June 1, 2011
+.Dd November 15, 2011
 .Dt POOL_CACHE 9
 .Os
 .\ 
@@ -68,7 +68,8 @@
 .Nm pool_cache_destruct_object ,
 .Nm pool_cache_invalidate ,
 .Nm pool_cache_sethiwat ,
-.Nm pool_cache_setlowat
+.Nm pool_cache_setlowat ,
+.Nm pool_cache_sethardlimit
 .Nd resource-pool cache manager
 .\ 
 .Sh SYNOPSIS
@@ -114,6 +115,9 @@
 .Ft void
 .Fn pool_cache_setlowat \
 pool_cache_t pc int nitems
+.Ft void
+.Fn pool_cache_sethardlimit \
+pool_cache_t pc int nitems const char *warnmess int ratecap
 .\ 
 .Sh DESCRIPTION
 These utility routines provide management of pools of fixed-sized
@@ -124,8 +128,19 @@ This can be used by applications to guar
 amount of memory needed to continue operation independent of the memory
 resources currently available from the system-wide memory allocator.
 .Pp
-Global and per-CPU caches of constructed objects are maintained.
-The two levels of cache work together to allow for low overhead
+.Nm
+follows the
+.Xr pool 9
+API closely and offers routines that are functionally equivalent to
+their
+.Xr pool 9
+counterparts.
+In addition,
+.Nm
+provides object management functions used to manipulate
+objects allocated from the pool.
+It also maintains global and per-CPU caches, both levels
+of cache work together to allow for low overhead
 allocation and release of objects, and improved L1/L2/L3 hardware
 cache locality in multiprocessor systems.
 .\ 
@@ -281,7 +296,7 @@ It's implemented as a macro.
 .Pp
 Force destruction of an object
 .Fa object
-and its release back into the pool.
+and release it back into the pool.
 .\ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 .It Fn pool_cache_invalidate pc
 .Pp
@@ -320,6 +335,18 @@ at which point the VM system will try to
 Set the minimum number of items to keep in the pool.
 The number pages in the pool will not decrease below the required value to
 accommodate the minimum number of items specified by this function.
+.\ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.It Fn pool_cache_sethardlimit pc nitems warnmess ratecap
+Set the hard limit for the backing
+.Xr pool 9
+to
+.Fa nitems .
+When the hard limit is reached, the warning message
+.Fa warnmess
+will be logged.
+.Fa ratecap
+represents the minimal interval (in seconds) after which another warning
+message is issued when the pool hits its hard limit again.
 .El
 .\ 
 .Sh CODE REFERENCES



CVS commit: src

2011-11-14 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Tue Nov 15 00:50:57 UTC 2011

Modified Files:
src/distrib/sets/lists/comp: mi
src/share/man/man9: Makefile

Log Message:
pool_cache_sethiwat(9), pool_cache_setlowat(9), pool_cache_sethardlimit(9)


To generate a diff of this commit:
cvs rdiff -u -r1.1708 -r1.1709 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.358 -r1.359 src/share/man/man9/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1708 src/distrib/sets/lists/comp/mi:1.1709
--- src/distrib/sets/lists/comp/mi:1.1708	Tue Nov 15 00:19:42 2011
+++ src/distrib/sets/lists/comp/mi	Tue Nov 15 00:50:55 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1708 2011/11/15 00:19:42 jym Exp $
+#	$NetBSD: mi,v 1.1709 2011/11/15 00:50:55 jym Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -10389,6 +10389,9 @@
 ./usr/share/man/cat9/pool_cache_get_paddr.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/pool_cache_init.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/pool_cache_invalidate.0	comp-sys-catman		.cat
+./usr/share/man/cat9/pool_cache_sethiwat.0	comp-sys-catman		.cat
+./usr/share/man/cat9/pool_cache_setlowat.0	comp-sys-catman		.cat
+./usr/share/man/cat9/pool_cache_sethardlimit.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/pool_cache_invalidate_local.0	comp-obsolete	obsolete
 ./usr/share/man/cat9/pool_cache_put.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/pool_cache_put_paddr.0	comp-sys-catman		.cat
@@ -16489,6 +16492,9 @@
 ./usr/share/man/html9/pool_cache_get_paddr.html	comp-sys-htmlman	html
 ./usr/share/man/html9/pool_cache_init.html	comp-sys-htmlman	html
 ./usr/share/man/html9/pool_cache_invalidate.html	comp-sys-htmlman	html
+./usr/share/man/html9/pool_cache_sethiwat.html	comp-sys-htmlman	html
+./usr/share/man/html9/pool_cache_setlowat.html	comp-sys-htmlman	html
+./usr/share/man/html9/pool_cache_sethardlimit.html	comp-sys-htmlman	html
 ./usr/share/man/html9/pool_cache_invalidate_local.html	comp-obsolete	obsolete
 ./usr/share/man/html9/pool_cache_put.html	comp-sys-htmlman	html
 ./usr/share/man/html9/pool_cache_put_paddr.html	comp-sys-htmlman	html
@@ -22756,6 +22762,9 @@
 ./usr/share/man/man9/pool_cache_get_paddr.9	comp-sys-man		.man
 ./usr/share/man/man9/pool_cache_init.9		comp-sys-man		.man
 ./usr/share/man/man9/pool_cache_invalidate.9	comp-sys-man		.man
+./usr/share/man/man9/pool_cache_sethiwat.9	comp-sys-man		.man
+./usr/share/man/man9/pool_cache_setlowat.9	comp-sys-man		.man
+./usr/share/man/man9/pool_cache_sethardlimit.9	comp-sys-man		.man
 ./usr/share/man/man9/pool_cache_invalidate_local.9	comp-obsolete	obsolete
 ./usr/share/man/man9/pool_cache_put.9		comp-sys-man		.man
 ./usr/share/man/man9/pool_cache_put_paddr.9	comp-sys-man		.man

Index: src/share/man/man9/Makefile
diff -u src/share/man/man9/Makefile:1.358 src/share/man/man9/Makefile:1.359
--- src/share/man/man9/Makefile:1.358	Tue Nov 15 00:19:42 2011
+++ src/share/man/man9/Makefile	Tue Nov 15 00:50:55 2011
@@ -1,4 +1,4 @@
-#   $NetBSD: Makefile,v 1.358 2011/11/15 00:19:42 jym Exp $
+#   $NetBSD: Makefile,v 1.359 2011/11/15 00:50:55 jym Exp $
 
 #	Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -636,7 +636,10 @@ MLINKS+=pool_cache.9 pool_cache_init.9 \
 	pool_cache.9 pool_cache_put_paddr.9 \
 	pool_cache.9 pool_cache_put.9 \
 	pool_cache.9 pool_cache_destruct_object.9 \
-	pool_cache.9 pool_cache_invalidate.9
+	pool_cache.9 pool_cache_invalidate.9 \
+	pool_cache.9 pool_cache_sethiwat.9 \
+	pool_cache.9 pool_cache_setlowat.9 \
+	pool_cache.9 pool_cache_sethardlimit.9
 MLINKS+=powerhook_establish.9 powerhook_disestablish.9
 MLINKS+=preempt.9 yield.9
 MLINKS+=pserialize.9 pserialize_create.9 \



CVS commit: src/sys/arch/x86/acpi

2011-11-14 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Nov 15 07:20:31 UTC 2011

Modified Files:
src/sys/arch/x86/acpi: acpi_cpu_md.c

Log Message:
Add support for AMD family 12h. Also revert revision 1.67, as it implies
maintenance burden for limited value. XXX: Need to add family 15h too.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/x86/acpi/acpi_cpu_md.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/acpi/acpi_cpu_md.c
diff -u src/sys/arch/x86/acpi/acpi_cpu_md.c:1.68 src/sys/arch/x86/acpi/acpi_cpu_md.c:1.69
--- src/sys/arch/x86/acpi/acpi_cpu_md.c:1.68	Tue Oct 18 05:08:24 2011
+++ src/sys/arch/x86/acpi/acpi_cpu_md.c	Tue Nov 15 07:20:30 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_md.c,v 1.68 2011/10/18 05:08:24 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_md.c,v 1.69 2011/11/15 07:20:30 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010, 2011 Jukka Ruohonen jruoho...@iki.fi
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_cpu_md.c,v 1.68 2011/10/18 05:08:24 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_cpu_md.c,v 1.69 2011/11/15 07:20:30 jruoho Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -68,7 +68,7 @@ __KERNEL_RCSID(0, $NetBSD: acpi_cpu_md.
 #define MSR_CMPHALT_BMSTS	__BIT(29)
 
 /*
- * AMD families 10h, 11h, and 14h
+ * AMD families 10h, 11h, 12h, and 14h.
  */
 #define MSR_10H_LIMIT		0xc0010061
 #define MSR_10H_CONTROL		0xc0010062
@@ -107,7 +107,6 @@ static char	  native_idle_text[16];
 void		(*native_idle)(void) = NULL;
 
 static int	 acpicpu_md_quirk_piix4(const struct pci_attach_args *);
-static void	 acpicpu_md_quirk_amd(struct acpicpu_pstate *, uint32_t);
 static void	 acpicpu_md_pstate_hwf_reset(void *, void *);
 static int	 acpicpu_md_pstate_fidvid_get(struct acpicpu_softc *,
   uint32_t *);
@@ -274,6 +273,7 @@ acpicpu_md_flags(void)
 
 			/* FALLTHROUGH */
 
+		case 0x12:
 		case 0x14: /* AMD Fusion */
 
 			/*
@@ -336,55 +336,6 @@ acpicpu_md_quirk_piix4(const struct pci_
 	return 0;
 }
 
-static void
-acpicpu_md_quirk_amd(struct acpicpu_pstate *ps, uint32_t i)
-{
-	struct cpu_info *ci = cpu_info_primary;
-	uint32_t family, fid, freq, did, zeta;
-	uint64_t val;
-
-	if (i  7 || cpu_vendor != CPUVENDOR_AMD)
-		return;
-
-	family = CPUID2FAMILY(ci-ci_signature);
-
-	if (family == 0xf)
-		family += CPUID2EXTFAMILY(ci-ci_signature);
-
-	switch (family) {
-
-	case 0x10:
-		zeta = 0x10;
-		break;
-
-	case 0x11:
-		zeta = 0x08;
-		break;
-
-	default:
-		return;
-	}
-
-	/*
-	 * The following eight P-state control MSRs define
-	 * the static per-core values; the MSB indicates
-	 * whether the state is enabled, and the first eight
-	 * bits define the frequency divisor and multiplier.
-	 */
-	val = rdmsr(MSR_10H_CONFIG + i);
-
-	if ((val  __BIT(63)) == 0)
-		return;
-
-	fid = __SHIFTOUT(val, __BITS(0, 5));
-	did = __SHIFTOUT(val, __BITS(6, 8));
-
-	freq = 100 * (fid + zeta)  did;
-
-	if (freq != 0  ps-ps_freq != freq)
-		ps-ps_freq = freq;
-}
-
 void
 acpicpu_md_quirk_c1e(void)
 {
@@ -600,6 +551,7 @@ acpicpu_md_pstate_init(struct acpicpu_so
 
 		case 0x10:
 		case 0x11:
+		case 0x12:
 		case 0x14: /* AMD Fusion */
 			msr.ps_control_addr = MSR_10H_CONTROL;
 			msr.ps_control_mask = __BITS(0, 2);
@@ -647,13 +599,6 @@ acpicpu_md_pstate_init(struct acpicpu_so
 		if (msr.ps_control_mask != 0)
 			ps-ps_control_mask = msr.ps_control_mask;
 
-		/*
-		 * Some AMD systems may round the frequencies
-		 * reported in the tables. Try to fix these.
-		 */
-		if (cpu_vendor == CPUVENDOR_AMD)
-			acpicpu_md_quirk_amd(ps, i);
-
 		i++;
 	}
 



CVS commit: src/sys/dev/acpi

2011-11-14 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Nov 15 07:43:37 UTC 2011

Modified Files:
src/sys/dev/acpi: acpi_cpu_pstate.c

Log Message:
Add comment.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/acpi/acpi_cpu_pstate.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/acpi/acpi_cpu_pstate.c
diff -u src/sys/dev/acpi/acpi_cpu_pstate.c:1.52 src/sys/dev/acpi/acpi_cpu_pstate.c:1.53
--- src/sys/dev/acpi/acpi_cpu_pstate.c:1.52	Tue Oct 18 05:08:24 2011
+++ src/sys/dev/acpi/acpi_cpu_pstate.c	Tue Nov 15 07:43:37 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_pstate.c,v 1.52 2011/10/18 05:08:24 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_pstate.c,v 1.53 2011/11/15 07:43:37 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010, 2011 Jukka Ruohonen jruoho...@iki.fi
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_cpu_pstate.c,v 1.52 2011/10/18 05:08:24 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_cpu_pstate.c,v 1.53 2011/11/15 07:43:37 jruoho Exp $);
 
 #include sys/param.h
 #include sys/cpufreq.h
@@ -337,6 +337,15 @@ acpicpu_pstate_pss_add(struct acpicpu_ps
 	if (ps-ps_freq == 0 || ps-ps_freq  )
 		return AE_BAD_DECIMAL_CONSTANT;
 
+	/*
+	 * Sanity check also the latency levels. Some systems may
+	 * report a value zero, but we keep one microsecond as the
+	 * lower bound; see for instance AMD family 12h,
+	 *
+	 *	Advanced Micro Devices: BIOS and Kernel Developer's
+	 *	Guide (BKDG) for AMD Family 12h Processors. Section
+	 *	2.5.3.1.9.2, Revision 3.02, October, 2011.
+	 */
 	if (ps-ps_latency == 0 || ps-ps_latency  1000)
 		ps-ps_latency = 1;