svn commit: r253311 - in user/attilio/vmobj-readlock: . bin/sh lib/libc/gen lib/libc/sparc64/gen lib/libc/stdio lib/libthread_db/arch/sparc64 lib/msun/src sbin/devfs sbin/nvmecontrol sbin/recoverdi...

Attilio Rao attilio at FreeBSD.org
Sat Jul 13 00:52:16 UTC 2013


Author: attilio
Date: Sat Jul 13 00:52:12 2013
New Revision: 253311
URL: http://svnweb.freebsd.org/changeset/base/253311

Log:
  MFC

Added:
  user/attilio/vmobj-readlock/share/man/man9/vmem.9
     - copied unchanged from r253310, user/attilio/vmcontention/share/man/man9/vmem.9
  user/attilio/vmobj-readlock/tools/build/options/WITH_PKGTOOLS
     - copied unchanged from r253310, user/attilio/vmcontention/tools/build/options/WITH_PKGTOOLS
  user/attilio/vmobj-readlock/tools/regression/bin/sh/execution/int-cmd1.0
     - copied unchanged from r253310, user/attilio/vmcontention/tools/regression/bin/sh/execution/int-cmd1.0
Deleted:
  user/attilio/vmobj-readlock/tools/build/options/WITHOUT_PKGTOOLS
Modified:
  user/attilio/vmobj-readlock/UPDATING
  user/attilio/vmobj-readlock/bin/sh/main.c
  user/attilio/vmobj-readlock/lib/libc/gen/sysctl.3
  user/attilio/vmobj-readlock/lib/libc/sparc64/gen/makecontext.c
  user/attilio/vmobj-readlock/lib/libc/sparc64/gen/signalcontext.c
  user/attilio/vmobj-readlock/lib/libc/stdio/fwrite.c
  user/attilio/vmobj-readlock/lib/libthread_db/arch/sparc64/libpthread_md.c
  user/attilio/vmobj-readlock/lib/msun/src/math.h
  user/attilio/vmobj-readlock/sbin/devfs/devfs.8
  user/attilio/vmobj-readlock/sbin/nvmecontrol/firmware.c
  user/attilio/vmobj-readlock/sbin/recoverdisk/recoverdisk.1
  user/attilio/vmobj-readlock/share/man/man5/rc.conf.5
  user/attilio/vmobj-readlock/share/man/man5/src.conf.5
  user/attilio/vmobj-readlock/share/man/man9/Makefile
  user/attilio/vmobj-readlock/sys/arm/arm/db_trace.c
  user/attilio/vmobj-readlock/sys/cam/scsi/scsi_ch.c
  user/attilio/vmobj-readlock/sys/cam/scsi/scsi_da.c
  user/attilio/vmobj-readlock/sys/dev/e1000/if_em.c
  user/attilio/vmobj-readlock/sys/dev/e1000/if_igb.c
  user/attilio/vmobj-readlock/sys/dev/e1000/if_lem.c
  user/attilio/vmobj-readlock/sys/dev/hptnr/hptnr_osm_bsd.c
  user/attilio/vmobj-readlock/sys/dev/ixgbe/ixgbe.c
  user/attilio/vmobj-readlock/sys/dev/ixgbe/ixv.c
  user/attilio/vmobj-readlock/sys/fs/fuse/fuse_internal.h
  user/attilio/vmobj-readlock/sys/fs/fuse/fuse_kernel.h
  user/attilio/vmobj-readlock/sys/modules/em/Makefile
  user/attilio/vmobj-readlock/sys/modules/igb/Makefile
  user/attilio/vmobj-readlock/sys/net/if_gif.c
  user/attilio/vmobj-readlock/sys/net/rtsock.c
  user/attilio/vmobj-readlock/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
  user/attilio/vmobj-readlock/sys/netinet/in_pcb.c
  user/attilio/vmobj-readlock/sys/netinet/tcp_syncache.h
  user/attilio/vmobj-readlock/sys/netinet6/in6_pcb.c
  user/attilio/vmobj-readlock/sys/powerpc/aim/mmu_oea64.c
  user/attilio/vmobj-readlock/sys/sparc64/include/ucontext.h
  user/attilio/vmobj-readlock/sys/sparc64/sparc64/machdep.c
  user/attilio/vmobj-readlock/sys/ufs/ffs/ffs_snapshot.c
  user/attilio/vmobj-readlock/tools/build/mk/OptionalObsoleteFiles.inc
  user/attilio/vmobj-readlock/tools/build/options/makeman
  user/attilio/vmobj-readlock/usr.bin/netstat/main.c
  user/attilio/vmobj-readlock/usr.bin/netstat/netstat.1
  user/attilio/vmobj-readlock/usr.bin/netstat/netstat.h
  user/attilio/vmobj-readlock/usr.bin/netstat/route.c
  user/attilio/vmobj-readlock/usr.sbin/ypserv/yp_main.c
Directory Properties:
  user/attilio/vmobj-readlock/   (props changed)
  user/attilio/vmobj-readlock/lib/libc/   (props changed)
  user/attilio/vmobj-readlock/sbin/   (props changed)
  user/attilio/vmobj-readlock/sys/   (props changed)

Modified: user/attilio/vmobj-readlock/UPDATING
==============================================================================
--- user/attilio/vmobj-readlock/UPDATING	Sat Jul 13 00:50:38 2013	(r253310)
+++ user/attilio/vmobj-readlock/UPDATING	Sat Jul 13 00:52:12 2013	(r253311)
@@ -32,6 +32,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
 	"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
 20130709:
+	pkg_install has been disconnected from the build if you really need it
+	you should add WITH_PKGTOOLS in your src.conf(5).
+
+20130709:
 	Most of network statistics structures were changed to be able
 	keep 64-bits counters. Thus all tools, that work with networking
 	statistics, must be rebuilded (netstat(1), bsnmpd(1), etc.)

Modified: user/attilio/vmobj-readlock/bin/sh/main.c
==============================================================================
--- user/attilio/vmobj-readlock/bin/sh/main.c	Sat Jul 13 00:50:38 2013	(r253310)
+++ user/attilio/vmobj-readlock/bin/sh/main.c	Sat Jul 13 00:52:12 2013	(r253311)
@@ -170,8 +170,8 @@ state3:
 	if (minusc) {
 		evalstring(minusc, sflag ? 0 : EV_EXIT);
 	}
+state4:
 	if (sflag || minusc == NULL) {
-state4:	/* XXX ??? - why isn't this before the "if" statement */
 		cmdloop(1);
 	}
 	exitshell(exitstatus);

Modified: user/attilio/vmobj-readlock/lib/libc/gen/sysctl.3
==============================================================================
--- user/attilio/vmobj-readlock/lib/libc/gen/sysctl.3	Sat Jul 13 00:50:38 2013	(r253310)
+++ user/attilio/vmobj-readlock/lib/libc/gen/sysctl.3	Sat Jul 13 00:52:12 2013	(r253311)
@@ -28,7 +28,7 @@
 .\"	@(#)sysctl.3	8.4 (Berkeley) 5/9/95
 .\" $FreeBSD$
 .\"
-.Dd February 11, 2012
+.Dd May 17, 2013
 .Dt SYSCTL 3
 .Os
 .Sh NAME
@@ -547,14 +547,14 @@ The length of each message is contained 
 The third level name is a protocol number, which is currently always 0.
 The fourth level name is an address family, which may be set to 0 to
 select all address families.
-The fifth and sixth level names are as follows:
-.Bl -column "Fifth level nameXXXXXX" "Sixth level is:XXX" -offset indent
-.It Sy "Fifth level name	Sixth level is:"
-.It "NET_RT_FLAGS	rtflags"
-.It "NET_RT_DUMP	None"
-.It "NET_RT_IFLIST	0 or if_index"
-.It "NET_RT_IFMALIST	0 or if_index"
-.It "NET_RT_IFLISTL	0 or if_index"
+The fifth, sixth, and seventh level names are as follows:
+.Bl -column "Fifth level	" "Sixth level	" -offset indent
+.It Sy "Fifth level	Sixth level	Seventh level"
+.It "NET_RT_FLAGS	rtflags			None"
+.It "NET_RT_DUMP	None			None or fib number"
+.It "NET_RT_IFLIST	0 or if_index		None"
+.It "NET_RT_IFMALIST	0 or if_index		None"
+.It "NET_RT_IFLISTL	0 or if_index		None"
 .El
 .Pp
 The

Modified: user/attilio/vmobj-readlock/lib/libc/sparc64/gen/makecontext.c
==============================================================================
--- user/attilio/vmobj-readlock/lib/libc/sparc64/gen/makecontext.c	Sat Jul 13 00:50:38 2013	(r253310)
+++ user/attilio/vmobj-readlock/lib/libc/sparc64/gen/makecontext.c	Sat Jul 13 00:52:12 2013	(r253311)
@@ -54,12 +54,12 @@ __makecontext(ucontext_t *ucp, void (*st
 
 	mc = &ucp->uc_mcontext;
 	if (ucp == NULL ||
-	    (mc->mc_flags & ((1L << _MC_VERSION_BITS) - 1)) != _MC_VERSION)
+	    (mc->_mc_flags & ((1L << _MC_VERSION_BITS) - 1)) != _MC_VERSION)
 		return;
 	if ((argc < 0) || (argc > 6) ||
 	    (ucp->uc_stack.ss_sp == NULL) ||
 	    (ucp->uc_stack.ss_size < MINSIGSTKSZ)) {
-		mc->mc_flags = 0;
+		mc->_mc_flags = 0;
 		return;
 	}
 	mc = &ucp->uc_mcontext;
@@ -71,8 +71,8 @@ __makecontext(ucontext_t *ucp, void (*st
 	mc->mc_global[1] = (uint64_t)start;
 	mc->mc_global[2] = (uint64_t)ucp;
 	mc->mc_out[6] = sp - SPOFF - sizeof(struct frame);
-	mc->mc_tnpc = (uint64_t)_ctx_start + 4;
-	mc->mc_tpc = (uint64_t)_ctx_start;
+	mc->_mc_tnpc = (uint64_t)_ctx_start + 4;
+	mc->_mc_tpc = (uint64_t)_ctx_start;
 }
 
 void
@@ -82,7 +82,7 @@ _ctx_done(ucontext_t *ucp)
 	if (ucp->uc_link == NULL)
 		exit(0);
 	else {
-		ucp->uc_mcontext.mc_flags = 0;
+		ucp->uc_mcontext._mc_flags = 0;
 		setcontext((const ucontext_t *)ucp->uc_link);
 		abort();
 	}

Modified: user/attilio/vmobj-readlock/lib/libc/sparc64/gen/signalcontext.c
==============================================================================
--- user/attilio/vmobj-readlock/lib/libc/sparc64/gen/signalcontext.c	Sat Jul 13 00:50:38 2013	(r253310)
+++ user/attilio/vmobj-readlock/lib/libc/sparc64/gen/signalcontext.c	Sat Jul 13 00:52:12 2013	(r253311)
@@ -52,7 +52,7 @@ __signalcontext(ucontext_t *ucp, int sig
 	mcontext_t *mc;
 
 	mc = &ucp->uc_mcontext;
-	sfp = (struct sigframe *)(mc->mc_sp + SPOFF) - 1;
+	sfp = (struct sigframe *)(mc->_mc_sp + SPOFF) - 1;
 	fp = (struct frame *)sfp - 1;
 
 	bzero(fp, sizeof(*fp));
@@ -67,8 +67,8 @@ __signalcontext(ucontext_t *ucp, int sig
 	mc->mc_out[1] = (uint64_t)&sfp->sf_si;
 	mc->mc_out[2] = (uint64_t)&sfp->sf_uc;
 	mc->mc_out[6] = (uint64_t)fp - SPOFF;
-	mc->mc_tnpc = (uint64_t)_ctx_start + 4;
-	mc->mc_tpc = (uint64_t)_ctx_start;
+	mc->_mc_tnpc = (uint64_t)_ctx_start + 4;
+	mc->_mc_tpc = (uint64_t)_ctx_start;
 
 	ucp->uc_link = &sfp->sf_uc;
 	sigdelset(&ucp->uc_sigmask, sig);

Modified: user/attilio/vmobj-readlock/lib/libc/stdio/fwrite.c
==============================================================================
--- user/attilio/vmobj-readlock/lib/libc/stdio/fwrite.c	Sat Jul 13 00:50:38 2013	(r253310)
+++ user/attilio/vmobj-readlock/lib/libc/stdio/fwrite.c	Sat Jul 13 00:52:12 2013	(r253311)
@@ -65,7 +65,7 @@ fwrite(const void * __restrict buf, size
 	/*
 	 * Check for integer overflow.  As an optimization, first check that
 	 * at least one of {count, size} is at least 2^16, since if both
-	 * values are less than that, their product can't possible overflow
+	 * values are less than that, their product can't possibly overflow
 	 * (size_t is always at least 32 bits on FreeBSD).
 	 */
 	if (((count | size) > 0xFFFF) &&

Modified: user/attilio/vmobj-readlock/lib/libthread_db/arch/sparc64/libpthread_md.c
==============================================================================
--- user/attilio/vmobj-readlock/lib/libthread_db/arch/sparc64/libpthread_md.c	Sat Jul 13 00:50:38 2013	(r253310)
+++ user/attilio/vmobj-readlock/lib/libthread_db/arch/sparc64/libpthread_md.c	Sat Jul 13 00:52:12 2013	(r253311)
@@ -57,9 +57,9 @@ pt_fpreg_to_ucontext(const struct fpreg*
 
 	memcpy(mc->mc_fp, r->fr_regs, MIN(sizeof(mc->mc_fp),
 	    sizeof(r->fr_regs)));
-	mc->mc_fsr = r->fr_fsr;
-	mc->mc_gsr = r->fr_gsr;
-	mc->mc_fprs |= FPRS_FEF;
+	mc->_mc_fsr = r->fr_fsr;
+	mc->_mc_gsr = r->fr_gsr;
+	mc->_mc_fprs |= FPRS_FEF;
 }
 
 void
@@ -67,11 +67,11 @@ pt_ucontext_to_fpreg(const ucontext_t *u
 {
 	const mcontext_t *mc = &uc->uc_mcontext;
 
-	if ((mc->mc_fprs & FPRS_FEF) != 0) {
+	if ((mc->_mc_fprs & FPRS_FEF) != 0) {
 		memcpy(r->fr_regs, mc->mc_fp, MIN(sizeof(mc->mc_fp),
 		    sizeof(r->fr_regs)));
-		r->fr_fsr = mc->mc_fsr;
-		r->fr_gsr = mc->mc_gsr;
+		r->fr_fsr = mc->_mc_fsr;
+		r->fr_gsr = mc->_mc_gsr;
 	} else
 		memset(r, 0, sizeof(*r));
 }

Modified: user/attilio/vmobj-readlock/lib/msun/src/math.h
==============================================================================
--- user/attilio/vmobj-readlock/lib/msun/src/math.h	Sat Jul 13 00:50:38 2013	(r253310)
+++ user/attilio/vmobj-readlock/lib/msun/src/math.h	Sat Jul 13 00:52:12 2013	(r253311)
@@ -81,12 +81,13 @@ extern const union __nan_un {
 #define	FP_SUBNORMAL	0x08
 #define	FP_ZERO		0x10
 
-#if __STDC_VERSION__ >= 201112L && defined(__clang__)
+#if (__STDC_VERSION__ >= 201112L && defined(__clang__)) || \
+    __has_extension(c_generic_selections)
 #define	__fp_type_select(x, f, d, ld) _Generic((x),     \
 	float: f(x),                                    \
 	double: d(x),                                   \
 	long double: ld(x))
-#elif __GNUC_PREREQ__(3, 1)
+#elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus)
 #define	__fp_type_select(x, f, d, ld) __builtin_choose_expr(              \
 	__builtin_types_compatible_p(__typeof(x), long double), ld(x),    \
 	__builtin_choose_expr(                                            \

Modified: user/attilio/vmobj-readlock/sbin/devfs/devfs.8
==============================================================================
--- user/attilio/vmobj-readlock/sbin/devfs/devfs.8	Sat Jul 13 00:50:38 2013	(r253310)
+++ user/attilio/vmobj-readlock/sbin/devfs/devfs.8	Sat Jul 13 00:52:12 2013	(r253311)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 21, 2013
+.Dd July 12, 2013
 .Dt DEVFS 8
 .Os
 .Sh NAME
@@ -190,6 +190,7 @@ Nodes may later be revived manually with
 or with the
 .Cm unhide
 action.
+Hiding a directory node effectively hides all of its child nodes.
 .It Cm include Ar ruleset
 Apply all the rules in ruleset number
 .Ar ruleset
@@ -213,6 +214,8 @@ which may be a user name
 or number.
 .It Cm unhide
 Unhide the node.
+If the node resides in a subdirectory,
+all parent directory nodes must be visible to be able to access the node.
 .El
 .Sh IMPLEMENTATION NOTES
 Rulesets are created by the kernel at the first reference

Modified: user/attilio/vmobj-readlock/sbin/nvmecontrol/firmware.c
==============================================================================
--- user/attilio/vmobj-readlock/sbin/nvmecontrol/firmware.c	Sat Jul 13 00:50:38 2013	(r253310)
+++ user/attilio/vmobj-readlock/sbin/nvmecontrol/firmware.c	Sat Jul 13 00:52:12 2013	(r253311)
@@ -94,7 +94,7 @@ read_image_file(char *path, void **buf, 
 		    path, (intmax_t)sb.st_size);
 	filesize = (int32_t)sb.st_size;
 	if ((*buf = malloc(filesize)) == NULL)
-		errx(1, "unable to malloc %zd bytes", filesize);
+		errx(1, "unable to malloc %d bytes", filesize);
 	if ((*size = read(fd, *buf, filesize)) < 0)
 		err(1, "error reading '%s'", path);
 	/* XXX assuming no short reads */

Modified: user/attilio/vmobj-readlock/sbin/recoverdisk/recoverdisk.1
==============================================================================
--- user/attilio/vmobj-readlock/sbin/recoverdisk/recoverdisk.1	Sat Jul 13 00:50:38 2013	(r253310)
+++ user/attilio/vmobj-readlock/sbin/recoverdisk/recoverdisk.1	Sat Jul 13 00:52:12 2013	(r253311)
@@ -125,9 +125,9 @@ recoverdisk -b 0 /dev/ad3 /somewhere
 .Ed
 .Sh SEE ALSO
 .Xr dd 1 ,
-.Xr ada 4,
-.Xr cam 4,
-.Xr cd 4,
+.Xr ada 4 ,
+.Xr cam 4 ,
+.Xr cd 4 ,
 .Xr da 4
 .Sh HISTORY
 The

Modified: user/attilio/vmobj-readlock/share/man/man5/rc.conf.5
==============================================================================
--- user/attilio/vmobj-readlock/share/man/man5/rc.conf.5	Sat Jul 13 00:50:38 2013	(r253310)
+++ user/attilio/vmobj-readlock/share/man/man5/rc.conf.5	Sat Jul 13 00:52:12 2013	(r253311)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 9, 2013
+.Dd July 12, 2013
 .Dt RC.CONF 5
 .Os
 .Sh NAME
@@ -3875,6 +3875,11 @@ configure multiple jails.
 The names specified in this list will be used to
 identify settings common to an instance of a jail,
 and should contain alphanumeric characters only.
+The literal jail name of
+.Dq Li 0
+.Pq zero
+is not allowed.
+.Pp
 Assuming that the jail in question was named
 .Li vjail ,
 you would have the following dependent variables:

Modified: user/attilio/vmobj-readlock/share/man/man5/src.conf.5
==============================================================================
--- user/attilio/vmobj-readlock/share/man/man5/src.conf.5	Sat Jul 13 00:50:38 2013	(r253310)
+++ user/attilio/vmobj-readlock/share/man/man5/src.conf.5	Sat Jul 13 00:52:12 2013	(r253311)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
-.\" from FreeBSD: head/tools/build/options/makeman 251685 2013-06-13 13:05:08Z emaste
+.\" from FreeBSD: head/tools/build/options/makeman 253304 2013-07-12 23:08:44Z bapt
 .\" $FreeBSD$
-.Dd July 3, 2013
+.Dd July 13, 2013
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -962,9 +962,9 @@ When set, it also enforces the following
 Set to not build
 .Xr pkg 1
 bootstrap tool
-.It Va WITHOUT_PKGTOOLS
-.\" from FreeBSD: head/tools/build/options/WITHOUT_PKGTOOLS 183242 2008-09-21 22:02:26Z sam
-Set to not build
+.It Va WITH_PKGTOOLS
+.\" from FreeBSD: head/tools/build/options/WITH_PKGTOOLS 253305 2013-07-12 23:11:17Z bapt
+Set to build
 .Xr pkg_add 8
 and related programs.
 .It Va WITHOUT_PMC

Modified: user/attilio/vmobj-readlock/share/man/man9/Makefile
==============================================================================
--- user/attilio/vmobj-readlock/share/man/man9/Makefile	Sat Jul 13 00:50:38 2013	(r253310)
+++ user/attilio/vmobj-readlock/share/man/man9/Makefile	Sat Jul 13 00:52:12 2013	(r253311)
@@ -339,6 +339,7 @@ MAN=	accept_filter.9 \
 	vm_page_wakeup.9 \
 	vm_page_wire.9 \
 	vm_set_page_size.9 \
+	vmem.9 \
 	vn_fullpath.9 \
 	vn_isdisk.9 \
 	vnode.9 \

Copied: user/attilio/vmobj-readlock/share/man/man9/vmem.9 (from r253310, user/attilio/vmcontention/share/man/man9/vmem.9)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/attilio/vmobj-readlock/share/man/man9/vmem.9	Sat Jul 13 00:52:12 2013	(r253311, copy of r253310, user/attilio/vmcontention/share/man/man9/vmem.9)
@@ -0,0 +1,315 @@
+.\"	$NetBSD: vmem.9,v 1.15 2013/01/29 22:02:17 wiz Exp $
+.\"
+.\" Copyright (c)2006 YAMAMOTO Takashi,
+.\" 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$
+.\"
+.\" ------------------------------------------------------------
+.Dd July 12, 2013
+.Dt VMEM 9
+.Os
+.\" ------------------------------------------------------------
+.Sh NAME
+.Nm vmem
+.Nd general purpose resource allocator
+.\" ------------------------------------------------------------
+.Sh SYNOPSIS
+.In sys/vmem.h
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Ft vmem_t *
+.Fn vmem_create \
+"const char *name" "vmem_addr_t base" "vmem_size_t size" "vmem_size_t quantum" \
+"vmem_size_t qcache_max" "int flags"
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Ft int
+.Fn vmem_add \
+"vmem_t *vm" "vmem_addr_t addr" "vmem_size_t size" "int flags"
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Ft int
+.Fn vmem_xalloc \
+"vmem_t *vm" "const vmem_size_t size" "vmem_size_t align" \
+"const vmem_size_t phase" "const vmem_size_t nocross" \
+"const vmem_addr_t minaddr" "const vmem_addr_t maxaddr" "int flags" \
+"vmem_addr_t *addrp"
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Ft void
+.Fn vmem_xfree "vmem_t *vm" "vmem_addr_t addr" "vmem_size_t size"
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Ft int
+.Fn vmem_alloc "vmem_t *vm" "vmem_size_t size" "int flags" "vmem_addr_t *addrp"
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Ft void
+.Fn vmem_free "vmem_t *vm" "vmem_addr_t addr" "vmem_size_t size"
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Ft void
+.Fn vmem_destroy "vmem_t *vm"
+.\" ------------------------------------------------------------
+.Sh DESCRIPTION
+The
+.Nm
+is a general purpose resource allocator.
+Despite its name, it can be used for arbitrary resources
+other than virtual memory.
+.Pp
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Fn vmem_create
+creates a new vmem arena.
+.Bl -tag -width qcache_max
+.It Fa name
+The string to describe the vmem.
+.It Fa base
+The start address of the initial span.
+Pass
+.Dv 0
+if no initial span is required.
+.It Fa size
+The size of the initial span.
+Pass
+.Dv 0
+if no initial span is required.
+.It Fa quantum
+The smallest unit of allocation.
+.It Fa qcache_max
+The largest size of allocations which can be served by quantum cache.
+It is merely a hint and can be ignored.
+.It Fa flags
+Combination of
+.Xr malloc 9
+wait flag and
+.Nm
+allocation strategy flag:
+.Bl -tag -width M_FIRSTFIT
+.It Dv M_FIRSTFIT
+Prefer allocation performance.
+.It Dv M_BESTFIT
+Prefer space efficiency.
+.El
+.El
+.Pp
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Fn vmem_add
+adds a span of size
+.Fa size
+starting at
+.Fa addr
+to the arena.
+Returns
+0
+on success,
+.Dv ENOMEM
+on failure.
+.Fa flags
+is
+.Xr malloc 9
+wait flag.
+.Pp
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Fn vmem_xalloc
+allocates a resource from the arena.
+.Bl -tag -width nocross
+.It Fa vm
+The arena which we allocate from.
+.It Fa size
+Specify the size of the allocation.
+.It Fa align
+If zero, don't care about the alignment of the allocation.
+Otherwise, request a resource segment starting at
+offset
+.Fa phase
+from an
+.Fa align
+aligned boundary.
+.It Fa phase
+See the above description of
+.Fa align .
+If
+.Fa align
+is zero,
+.Fa phase
+should be zero.
+Otherwise,
+.Fa phase
+should be smaller than
+.Fa align .
+.It Fa nocross
+Request a resource which doesn't cross
+.Fa nocross
+aligned boundary.
+.It Fa minaddr
+Specify the minimum address which can be allocated, or
+.Dv VMEM_ADDR_MIN
+if the caller does not care.
+.It Fa maxaddr
+Specify the maximum address which can be allocated, or
+.Dv VMEM_ADDR_MAX
+if the caller does not care.
+.It Fa flags
+A bitwise OR of an allocation strategy and a
+.Xr malloc 9
+wait flag.
+The allocation strategy is one of
+.Dv M_FIRSTFIT
+and
+.Dv M_BESTFIT .
+.It Fa addrp
+On success, if
+.Fa addrp
+is not
+.Dv NULL ,
+.Fn vmem_xalloc
+overwrites it with the start address of the allocated span.
+.El
+.Pp
+.\" ------------------------------------------------------------
+.Fn vmem_xfree
+frees resource allocated by
+.Fn vmem_xalloc
+to the arena.
+.Bl -tag -width addr
+.It Fa vm
+The arena which we free to.
+.It Fa addr
+The resource being freed.
+It must be the one returned by
+.Fn vmem_xalloc .
+Notably, it must not be the one from
+.Fn vmem_alloc .
+Otherwise, the behaviour is undefined.
+.It Fa size
+The size of the resource being freed.
+It must be the same as the
+.Fa size
+argument used for
+.Fn vmem_xalloc .
+.El
+.Pp
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Fn vmem_alloc
+allocates a resource from the arena.
+.Bl -tag -width flags
+.It Fa vm
+The arena which we allocate from.
+.It Fa size
+Specify the size of the allocation.
+.It Fa flags
+A bitwise OR of an
+.Nm
+allocation strategy flag (see above) and a
+.Xr malloc 9
+sleep flag.
+.It Fa addrp
+On success, if
+.Fa addrp
+is not
+.Dv NULL ,
+.Fn vmem_alloc
+overwrites it with the start address of the allocated span.
+.El
+.Pp
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Fn vmem_free
+frees resource allocated by
+.Fn vmem_alloc
+to the arena.
+.Bl -tag -width addr
+.It Fa vm
+The arena which we free to.
+.It Fa addr
+The resource being freed.
+It must be the one returned by
+.Fn vmem_alloc .
+Notably, it must not be the one from
+.Fn vmem_xalloc .
+Otherwise, the behaviour is undefined.
+.It Fa size
+The size of the resource being freed.
+It must be the same as the
+.Fa size
+argument used for
+.Fn vmem_alloc .
+.El
+.Pp
+.\" ------------------------------------------------------------
+.Fn vmem_destroy
+destroys a vmem arena.
+.Bl -tag -width vm
+.It Fa vm
+The vmem arena being destroyed.
+The caller should ensure that no one will use it anymore.
+.El
+.\" ------------------------------------------------------------
+.Sh RETURN VALUES
+.Fn vmem_create
+returns a pointer to the newly allocated vmem_t.
+Otherwise, it returns
+.Dv NULL .
+.Pp
+On success,
+.Fn vmem_xalloc
+and
+.Fn vmem_alloc
+return 0.
+Otherwise,
+.Dv ENOMEM
+is returned.
+.\" ------------------------------------------------------------
+.Sh CODE REFERENCES
+The
+.Nm
+subsystem is implemented within the file
+.Pa sys/kern/subr_vmem.c .
+.\" ------------------------------------------------------------
+.Sh SEE ALSO
+.Xr malloc 9
+.Rs
+.%A Jeff Bonwick
+.%A Jonathan Adams
+.%T "Magazines and Vmem: Extending the Slab Allocator to Many CPUs and Arbitrary Resources"
+.%J "2001 USENIX Annual Technical Conference"
+.%D 2001
+.Re
+.\" ------------------------------------------------------------
+.Sh HISTORY
+The
+.Nm
+allocator was originally implemented in
+.Nx .
+It was introduced in
+.Fx 10.0 .
+.Sh AUTHORS
+.An -nosplit
+Original implementation of
+.Nm
+was written by
+.An "YAMAMOTO Takashi" .
+The
+.Fx
+port was made by
+.An "Jeff Roberson" .
+.Sh BUGS
+.Nm
+relies on
+.Xr malloc 9 ,
+so it cannot be used as early during system bootstrap.

Modified: user/attilio/vmobj-readlock/sys/arm/arm/db_trace.c
==============================================================================
--- user/attilio/vmobj-readlock/sys/arm/arm/db_trace.c	Sat Jul 13 00:50:38 2013	(r253310)
+++ user/attilio/vmobj-readlock/sys/arm/arm/db_trace.c	Sat Jul 13 00:52:12 2013	(r253311)
@@ -515,11 +515,11 @@ db_stack_trace_cmd(db_expr_t addr, db_ex
 		db_printsym(scp, DB_STGY_PROC);
 		db_printf("\n");
 #ifdef __PROG26
-		db_printf("scp=0x%08x rlv=0x%08x (", scp, frame[FR_RLV] & R15_PC);
+		db_printf("\tscp=0x%08x rlv=0x%08x (", scp, frame[FR_RLV] & R15_PC);
 		db_printsym(frame[FR_RLV] & R15_PC, DB_STGY_PROC);
 		db_printf(")\n");
 #else
-		db_printf("scp=0x%08x rlv=0x%08x (", scp, frame[FR_RLV]);
+		db_printf("\tscp=0x%08x rlv=0x%08x (", scp, frame[FR_RLV]);
 		db_printsym(frame[FR_RLV], DB_STGY_PROC);
 		db_printf(")\n");
 #endif

Modified: user/attilio/vmobj-readlock/sys/cam/scsi/scsi_ch.c
==============================================================================
--- user/attilio/vmobj-readlock/sys/cam/scsi/scsi_ch.c	Sat Jul 13 00:50:38 2013	(r253310)
+++ user/attilio/vmobj-readlock/sys/cam/scsi/scsi_ch.c	Sat Jul 13 00:52:12 2013	(r253311)
@@ -102,7 +102,7 @@ static const u_int32_t	CH_TIMEOUT_MODE_S
 static const u_int32_t	CH_TIMEOUT_MOVE_MEDIUM               = 100000;
 static const u_int32_t	CH_TIMEOUT_EXCHANGE_MEDIUM           = 100000;
 static const u_int32_t	CH_TIMEOUT_POSITION_TO_ELEMENT       = 100000;
-static const u_int32_t	CH_TIMEOUT_READ_ELEMENT_STATUS       = 10000;
+static const u_int32_t	CH_TIMEOUT_READ_ELEMENT_STATUS       = 60000;
 static const u_int32_t	CH_TIMEOUT_SEND_VOLTAG		     = 10000;
 static const u_int32_t	CH_TIMEOUT_INITIALIZE_ELEMENT_STATUS = 500000;
 
@@ -122,12 +122,14 @@ typedef enum {
 
 typedef enum {
 	CH_Q_NONE	= 0x00,
-	CH_Q_NO_DBD	= 0x01
+	CH_Q_NO_DBD	= 0x01,
+	CH_Q_NO_DVCID	= 0x02
 } ch_quirks;
 
 #define CH_Q_BIT_STRING	\
 	"\020"		\
-	"\001NO_DBD"
+	"\001NO_DBD"	\
+	"\002NO_DVCID"
 
 #define ccb_state	ppriv_field0
 #define ccb_bp		ppriv_ptr1
@@ -396,6 +398,14 @@ chregister(struct cam_periph *periph, vo
 	periph->softc = softc;
 	softc->quirks = CH_Q_NONE;
 
+	/*
+	 * The DVCID and CURDATA bits were not introduced until the SMC
+	 * spec.  If this device claims SCSI-2 or earlier support, then it
+	 * very likely does not support these bits.
+	 */
+	if (cgd->inq_data.version <= SCSI_REV_2)
+		softc->quirks |= CH_Q_NO_DVCID;
+
 	bzero(&cpi, sizeof(cpi));
 	xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 	cpi.ccb_h.func_code = XPT_PATH_INQ;
@@ -1208,6 +1218,8 @@ chgetelemstatus(struct cam_periph *perip
 	caddr_t data = NULL;
 	size_t size, desclen;
 	int avail, i, error = 0;
+	int curdata, dvcid, sense_flags;
+	int try_no_dvcid = 0;
 	struct changer_element_status *user_data = NULL;
 	struct ch_softc *softc;
 	union ccb *ccb;
@@ -1239,14 +1251,31 @@ chgetelemstatus(struct cam_periph *perip
 	cam_periph_lock(periph);
 	ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
 
+	sense_flags = SF_RETRY_UA;
+	if (softc->quirks & CH_Q_NO_DVCID) {
+		dvcid = 0;
+		curdata = 0;
+	} else {
+		dvcid = 1;
+		curdata = 1;
+		/*
+		 * Don't print anything for an Illegal Request, because
+		 * these flags can cause some changers to complain.  We'll
+		 * retry without them if we get an error.
+		 */
+		sense_flags |= SF_QUIET_IR;
+	}
+
+retry_einval:
+
 	scsi_read_element_status(&ccb->csio,
 				 /* retries */ 1,
 				 /* cbfcnp */ chdone,
 				 /* tag_action */ MSG_SIMPLE_Q_TAG,
 				 /* voltag */ want_voltags,
 				 /* sea */ softc->sc_firsts[chet],
-				 /* dvcid */ 1,
-				 /* curdata */ 1,
+				 /* dvcid */ dvcid,
+				 /* curdata */ curdata,
 				 /* count */ 1,
 				 /* data_ptr */ data,
 				 /* dxfer_len */ 1024,
@@ -1254,9 +1283,38 @@ chgetelemstatus(struct cam_periph *perip
 				 /* timeout */ CH_TIMEOUT_READ_ELEMENT_STATUS);
 
 	error = cam_periph_runccb(ccb, cherror, /*cam_flags*/ CAM_RETRY_SELTO,
-				  /*sense_flags*/ SF_RETRY_UA,
+				  /*sense_flags*/ sense_flags,
 				  softc->device_stats);
 
+	/*
+	 * An Illegal Request sense key (only used if there is no asc/ascq)
+	 * or 0x24,0x00 for an ASC/ASCQ both map to EINVAL.  If dvcid or
+	 * curdata are set (we set both or neither), try turning them off
+	 * and see if the command is successful.
+	 */
+	if ((error == EINVAL)
+	 && (dvcid || curdata))  {
+		dvcid = 0;
+		curdata = 0;
+		error = 0;
+		/* At this point we want to report any Illegal Request */
+		sense_flags &= ~SF_QUIET_IR;
+		try_no_dvcid = 1;
+		goto retry_einval;
+	}
+
+	/*
+	 * In this case, we tried a read element status with dvcid and
+	 * curdata set, and it failed.  We retried without those bits, and
+	 * it succeeded.  Suggest to the user that he set a quirk, so we
+	 * don't go through the retry process the first time in the future.
+	 * This should only happen on changers that claim SCSI-3 or higher,
+	 * but don't support these bits.
+	 */
+	if ((try_no_dvcid != 0)
+	 && (error == 0))
+		softc->quirks |= CH_Q_NO_DVCID;
+
 	if (error)
 		goto done;
 	cam_periph_unlock(periph);
@@ -1284,8 +1342,8 @@ chgetelemstatus(struct cam_periph *perip
 				 /* voltag */ want_voltags,
 				 /* sea */ softc->sc_firsts[chet]
 				 + cesr->cesr_element_base,
-				 /* dvcid */ 1,
-				 /* curdata */ 1,
+				 /* dvcid */ dvcid,
+				 /* curdata */ curdata,
 				 /* count */ cesr->cesr_element_count,
 				 /* data_ptr */ data,
 				 /* dxfer_len */ size,

Modified: user/attilio/vmobj-readlock/sys/cam/scsi/scsi_da.c
==============================================================================
--- user/attilio/vmobj-readlock/sys/cam/scsi/scsi_da.c	Sat Jul 13 00:50:38 2013	(r253310)
+++ user/attilio/vmobj-readlock/sys/cam/scsi/scsi_da.c	Sat Jul 13 00:52:12 2013	(r253311)
@@ -144,6 +144,22 @@ typedef enum {
 	DA_DELETE_MAX = DA_DELETE_ZERO
 } da_delete_methods;
 
+typedef void da_delete_func_t (struct cam_periph *periph, union ccb *ccb,
+			      struct bio *bp);
+static da_delete_func_t da_delete_trim;
+static da_delete_func_t da_delete_unmap;
+static da_delete_func_t da_delete_ws;
+
+static const void * da_delete_functions[] = {
+	NULL,
+	NULL,
+	da_delete_trim,
+	da_delete_unmap,
+	da_delete_ws,
+	da_delete_ws,
+	da_delete_ws
+};
+
 static const char *da_delete_method_names[] =
     { "NONE", "DISABLE", "ATA_TRIM", "UNMAP", "WS16", "WS10", "ZERO" };
 static const char *da_delete_method_desc[] =
@@ -198,6 +214,7 @@ struct da_softc {
 	uint32_t		unmap_max_lba;
 	uint64_t		ws_max_blks;
 	da_delete_methods	delete_method;
+	da_delete_func_t	*delete_func;
 	struct	 disk_params params;
 	struct	 disk *disk;
 	union	 ccb saved_ccb;
@@ -1801,6 +1818,7 @@ dadeletemethodset(struct da_softc *softc
 
 	softc->delete_method = delete_method;
 	softc->disk->d_delmaxsize = dadeletemaxsize(softc, delete_method);
+	softc->delete_func = da_delete_functions[delete_method];
 
 	if (softc->delete_method > DA_DELETE_DISABLE)
 		softc->disk->d_flags |= DISKFLAG_CANDELETE;
@@ -2160,7 +2178,7 @@ skipstate:
 	switch (softc->state) {
 	case DA_STATE_NORMAL:
 	{
-		struct bio *bp, *bp1;
+		struct bio *bp;
 		uint8_t tag_code;
 
 		/* Execute immediate CCB if waiting. */
@@ -2180,237 +2198,13 @@ skipstate:
 		/* Run BIO_DELETE if not running yet. */
 		if (!softc->delete_running &&
 		    (bp = bioq_first(&softc->delete_queue)) != NULL) {
-		    uint64_t lba;
-		    uint64_t count; /* forward compat with WS32 */
-
-		    /*
-		     * In each of the methods below, while its the caller's
-		     * responsibility to ensure the request will fit into a
-		     * single device request, we might have changed the delete
-		     * method due to the device incorrectly advertising either
-		     * its supported methods or limits.
-		     * 
-		     * To prevent this causing further issues we validate the
-		     * against the methods limits, and warn which would
-		     * otherwise be unnecessary.
-		     */
-
-		    if (softc->delete_method == DA_DELETE_UNMAP) {
-			uint8_t *buf = softc->unmap_buf;
-			uint64_t lastlba = (uint64_t)-1;
-			uint32_t lastcount = 0, c;
-			uint64_t totalcount = 0;
-			uint32_t off, ranges = 0;
-
-			/*
-			 * Currently this doesn't take the UNMAP
-			 * Granularity and Granularity Alignment
-			 * fields into account.
-			 *
-			 * This could result in both unoptimal unmap
-			 * requests as as well as UNMAP calls unmapping
-			 * fewer LBA's than requested.
-			 */
-
-			softc->delete_running = 1;
-			bzero(softc->unmap_buf, sizeof(softc->unmap_buf));
-			bp1 = bp;
-			do {
-				bioq_remove(&softc->delete_queue, bp1);
-				if (bp1 != bp)
-					bioq_insert_tail(&softc->delete_run_queue, bp1);
-				lba = bp1->bio_pblkno;
-				count = bp1->bio_bcount / softc->params.secsize;
-
-				/* Try to extend the previous range. */
-				if (lba == lastlba) {
-					c = min(count, softc->unmap_max_lba -
-						lastcount);
-					lastcount += c;
-					off = ((ranges - 1) * UNMAP_RANGE_SIZE) +
-					      UNMAP_HEAD_SIZE;
-					scsi_ulto4b(lastcount, &buf[off + 8]);
-					count -= c;
-					lba +=c;
-					totalcount += c;
-				}
-
-				while (count > 0) {
-					c = min(count, softc->unmap_max_lba);
-					if (totalcount + c > softc->unmap_max_lba ||
-					    ranges >= softc->unmap_max_ranges) {
-						xpt_print(periph->path,
-						  "%s issuing short delete %ld > %ld"
-						  "|| %d >= %d",
-						  da_delete_method_desc[softc->delete_method],
-						  totalcount + c, softc->unmap_max_lba,
-						  ranges, softc->unmap_max_ranges);
-						break;
-					}
-					off = (ranges * UNMAP_RANGE_SIZE) +
-					      UNMAP_HEAD_SIZE;
-					scsi_u64to8b(lba, &buf[off + 0]);
-					scsi_ulto4b(c, &buf[off + 8]);
-					lba += c;
-					totalcount += c;
-					ranges++;
-					count -= c;
-					lastcount = c;
-				}
-				lastlba = lba;
-				bp1 = bioq_first(&softc->delete_queue);
-				if (bp1 == NULL ||
-				    ranges >= softc->unmap_max_ranges ||
-				    totalcount + bp1->bio_bcount /
-				     softc->params.secsize > softc->unmap_max_lba)
-					break;
-			} while (1);
-			scsi_ulto2b(ranges * 16 + 6, &buf[0]);
-			scsi_ulto2b(ranges * 16, &buf[2]);
-
-			scsi_unmap(&start_ccb->csio,
-					/*retries*/da_retry_count,
-					/*cbfcnp*/dadone,
-					/*tag_action*/MSG_SIMPLE_Q_TAG,
-					/*byte2*/0,
-					/*data_ptr*/ buf,
-					/*dxfer_len*/ ranges * 16 + 8,
-					/*sense_len*/SSD_FULL_SIZE,
-					da_default_timeout * 1000);
-			start_ccb->ccb_h.ccb_state = DA_CCB_DELETE;
-			goto out;
-		    } else if (softc->delete_method == DA_DELETE_ATA_TRIM) {
-				uint8_t *buf = softc->unmap_buf;
-				uint64_t lastlba = (uint64_t)-1;
-				uint32_t lastcount = 0, c, requestcount;
-				int ranges = 0, off, block_count;
-
-				softc->delete_running = 1;
-				bzero(softc->unmap_buf, sizeof(softc->unmap_buf));
-				bp1 = bp;
-				do {
-					bioq_remove(&softc->delete_queue, bp1);
-					if (bp1 != bp)
-						bioq_insert_tail(&softc->delete_run_queue, bp1);
-					lba = bp1->bio_pblkno;
-					count = bp1->bio_bcount / softc->params.secsize;
-					requestcount = count;
-
-					/* Try to extend the previous range. */
-					if (lba == lastlba) {
-						c = min(count, ATA_DSM_RANGE_MAX - lastcount);
-						lastcount += c;
-						off = (ranges - 1) * 8;
-						buf[off + 6] = lastcount & 0xff;
-						buf[off + 7] = (lastcount >> 8) & 0xff;
-						count -= c;
-						lba += c;
-					}
-
-					while (count > 0) {
-						c = min(count, ATA_DSM_RANGE_MAX);
-						off = ranges * 8;
-
-						buf[off + 0] = lba & 0xff;
-						buf[off + 1] = (lba >> 8) & 0xff;
-						buf[off + 2] = (lba >> 16) & 0xff;
-						buf[off + 3] = (lba >> 24) & 0xff;
-						buf[off + 4] = (lba >> 32) & 0xff;
-						buf[off + 5] = (lba >> 40) & 0xff;
-						buf[off + 6] = c & 0xff;
-						buf[off + 7] = (c >> 8) & 0xff;
-						lba += c;
-						ranges++;
-						count -= c;
-						lastcount = c;
-						if (count != 0 && ranges == softc->trim_max_ranges) {
-							xpt_print(periph->path,
-							  "%s issuing short delete %ld > %ld",
-							  da_delete_method_desc[softc->delete_method],
-							  requestcount,
-							  (softc->trim_max_ranges - ranges) *
-							  ATA_DSM_RANGE_MAX);
-							break;
-						}
-					}
-					lastlba = lba;
-					bp1 = bioq_first(&softc->delete_queue);
-					if (bp1 == NULL ||
-					    bp1->bio_bcount / softc->params.secsize >
-					    (softc->trim_max_ranges - ranges) *
-						    ATA_DSM_RANGE_MAX)
-						break;
-				} while (1);
-
-				block_count = (ranges + ATA_DSM_BLK_RANGES - 1) /
-					      ATA_DSM_BLK_RANGES;
-				scsi_ata_trim(&start_ccb->csio,
-						/*retries*/da_retry_count,
-						/*cbfcnp*/dadone,
-						/*tag_action*/MSG_SIMPLE_Q_TAG,
-						block_count,
-						/*data_ptr*/buf,
-						/*dxfer_len*/block_count * ATA_DSM_BLK_SIZE,
-						/*sense_len*/SSD_FULL_SIZE,
-						da_default_timeout * 1000);
-				start_ccb->ccb_h.ccb_state = DA_CCB_DELETE;
+			if (softc->delete_func != NULL) {
+				softc->delete_func(periph, start_ccb, bp);
 				goto out;
-		    } else if (softc->delete_method == DA_DELETE_ZERO ||
-			       softc->delete_method == DA_DELETE_WS10 ||
-			       softc->delete_method == DA_DELETE_WS16) {
-			/*
-			 * We calculate ws_max_blks here based off d_delmaxsize instead
-			 * of using softc->ws_max_blks as it is absolute max for the
-			 * device not the protocol max which may well be lower
-			 */
-			uint64_t ws_max_blks;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-user mailing list