5017 use 64bit DMA in mpt_sas
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Approved by: Robert Mustacchi <rm@joyent.com>
5373 connect(3SOCKET) could talk about non-blocking mode
Reviewed by: Keith Wesolowski <keith.wesolowski@joyent.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
5368 ARC should cache more metadata
Reviewed by: Alex Reece <alex.reece@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Richard Elling <richard.elling@richardelling.com>
Approved by: Dan McDonald <danmcd@omniti.com>
5347 idle pool may run itself out of space
Reviewed by: Alex Reece <alex.reece@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Steven Hartland <killing@multiplay.co.uk>
Reviewed by: Richard Elling <richard.elling@richardelling.com>
Approved by: Dan McDonald <danmcd@omniti.com>
5364 grp.h has incorrect prototype for getgrnam_r and getgrgid_r
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: Marcel Telka <marcel@telka.sk>
Approved by: Dan McDonald <danmcd@omniti.com>
5378 CVE-2014-3158 ppp: integer overflow in option parsing
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
5366 strcoll_l may destroy its arguments, then crash
Reviewed by: Garrett D'Amore <garrett@damore.org>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Dan McDonald <danmcd@omniti.com>
5340 add kstats to track reason for fork failures
Reviewed by: Richard Elling <richard.elling@richardelling.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Approved by: Dan McDonald <danmcd@omniti.com>
5314 Remove "dbuf phys" db->db_data pointer aliases in ZFS
Reviewed by: Andriy Gapon <avg@freebsd.org>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Will Andrews <willa@spectralogic.com>
Approved by: Dan McDonald <danmcd@omniti.com>
5377 bootadm update-archive misidentifies BEs as ramdisks
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Dan McDonald <danmcd@omniti.com>
2057 Document dladm show-phys' -m option
Reviewed by: Keith Wesolowski <keith.wesolowski@joyent.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Gordon Ross <gwr@nexenta.com>
5385 socket I/O related manuals don't document ECONNRESET
Reviewed by: Keith Wesolowski <keith.wesolowski@joyent.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Gordon Ross <gwr@nexenta.com>
5297 mptsas refhash replacement on reset can cause hang
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Andy Giles <illumos@ang.homedns.org>
Approved by: Richard Lowe <richlowe@richlowe.net>
5342 prstat -n option should accept 0
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Gordon Ross <gwr@nexenta.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Approved by: Dan McDonald <danmcd@omniti.com>
5330 zone brands could control init restart behavior
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: Gordon Ross <gwr@nexenta.com>
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Approved by: Dan McDonald <danmcd@omniti.com>
5369 arc flags should be an enum
5370 consistent arc_buf_hdr_t naming scheme
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Alex Reece <alex.reece@delphix.com>
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed by: Richard Elling <richard.elling@richardelling.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
5421 devzvol_readdir() needs to be more careful with strchr
Reviewed by: Keith Wesolowski <keith.wesolowski@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Various improvements the dmu buf user API.

Submitted by:	Justin Gibbs <justing@spectralogic.com>
Submitted by:	Will Andrews <willa@spectralogic.com>
Sponsored by:	Spectra Logic Corporation

Collect dmu buf user API support data into a new structure,
dmu_buf_user_t.  Consumers of this interface must include a
dmu_buf_user_t as a member of the user data structure that will be
attached to a dmu buffer.  This reduces the size of dmu_buf_impl_t
by two pointers.

Queue dmu buf user eviction processing to a taskq.  This prevents
FreeBSD witness(4) lock-order reversal warnings, potential deadlocks,
and reduces stack depth.

Convert objset eviction from a synchronous to an asynchronous process
to accommodate the asynchronous invocation, via dmu buf user eviction,
of dnode_buf_pageout().

Modify existing users of the dmu buf user API to never access the dbuf to
which their data was attached after user eviction has occurred.  Accessing
the dbuf from the callback is no longer safe now that callbacks occur
without the locks that used to protect them.  Enforce this in ZFS_DEBUG
kernel builds by clearing the user's pointer to the dbuf, if any, at
the time of eviction.  Callbacks have also been modified to clear their
dbuf pointer so most errors are caught even on non ZFS_DEBUG kernels.
However, this will not catch accesses from other contexts that occur
between the time of eviction and the processing of the callback.

Clarify programmer intent and improve readability by providing
specialized functions for the common user data update actions "remove"
and "replace".

Provide code-comment documentation for each API call.

Perform runtime validation of proper API usage on ZFS_DEBUG kernels.

uts/common/fs/zfs/sys/dbuf.h:
uts/common/fs/zfs/dbuf.c:
	Add dbuf_verify_user() and call it from the dbuf user API and
	during dbuf eviction processing to verify dbuf user API state.

	Replace calls to dbuf_set_data(db, NULL) with more explicit
	db_clear_data().  dbuf_set_data() now asserts that its buffer
	argument is never NULL.

	Implement new dmu buf API functions.

	Add the dmu_evict_taskq for processing dmu buf user evictions.
	Add dmu_buf_user_evict_wait() which allows spa, dsl pool, and
	dmu close/fini functions to drain pending user evictions.

	In dbuf_rele_and_unlock(), immediately evict dbufs with a zero
	refcount for an objset that is being evicted.  This allows
	the indirect dbufs in a dnode to be evicted asynchronously
	after the zero refcount dbufs that reference them are cleared
	via dmu_objset_evict()->dnode_evict_dbufs().

uts/common/fs/zfs/dmu.c:
	Drain any active user evictions prior to tearing down DMU
	subsystems.

uts/common/fs/zfs/sys/dmu_objset.h:
uts/common/fs/zfs/dmu_objset.c:
	End the practice of including special dnodes in os->os_dnodes.
	This allows os->os_dnodes to be managed completely by one
	eviction path: dnode_buf_pageout()->dnode_destroy().

	Split objset eviction processing into two pieces.  The first
	marks the objset as evicting, evicts any dbufs that have a
	refcount of zero, and then queues up the objset for the second
	phase of eviction.  Once os->os_dnodes has been cleared by
	dnode_buf_pageout()->dnode_destroy(), the second phase is executed.
	The second phase closes the special dnodes, dequeues the objset
	from the list of those undergoing eviction, and finally frees
	the objset.

	NOTE: Due to asynchronous eviction processing (invocation of
	      dnode_buf_pageout()), it is possible for the meta dnode for the
	      objset to have no holds even though os->os_dnodes is not empty.

uts/common/fs/zfs/sys/dnode.h:
uts/common/fs/zfs/dnode.c:
	Collapse the initialization of a dnode from dnode_hold_impl()
	into dnode_create().  Since we already grab os_lock, use it to
	provide mutual exclusion for dnh->dnh_dnode and to arbitrate
	the winner of the initial open race.  The only way to unset the
	handle is to page out an entire set of dnodes, which uses the
	user eviction mechanism to arbitrate.

	In dnode_destroy(), invoke final stage of objset eviction if
	the destroyed dnode is the last regular dnode in the objset.

	Modify dnode_buf_pageout() so that it doesn't reference the
	evicted dbuf.

uts/common/fs/zfs/dnode_sync.c:
	In dnode_evict_dbufs(), remove multiple passes over dn->dn_dbufs.
	This is possible now that objset eviction is asynchronously
	completed in a different context once dbuf eviction completes.

	In the case of objset eviction, any dbufs held by children will
	be evicted via dbuf_rele_and_unlock() once their refcounts go
	to zero.  Even when objset eviction is not active, the ordering
	of the avl tree guarantees that children will be released before
	parents, allowing the parent's refcounts to naturally drop to
	zero before they are inspected in this single loop.

uts/common/fs/zfs/sys/spa.h:
uts/common/fs/zfs/sys/spa_impl.h:
uts/common/fs/zfs/spa.c:
uts/common/fs/zfs/spa_misc.c:
	Track evicting objsets in the spa.

	When recording or validating the min spa reference count, wait
	for objset eviction processing to complete so that the reference
	count is stable.

	Remove ASSERT() in spa_close().  Eviction processing is
	asynchronous so we can no longer use the namespace_lock as an
	indication that the spa is being exported and that reference
	counts can safely drop below spa_minref.

uts/common/fs/zfs/dsl_deadlist.c:
uts/common/fs/zfs/dsl_dataset.c:
	Modify dsl_dataset_evict() so that it doesn't reference the
	evicted dbuf to determine if the deadlist needs to be closed.
	This is achieved by checking ds->ds_deadlist.dl_os instead
	which is now properly cleared when a deadlist is closed prior
	to eviction.

uts/common/fs/zfs/dmu_objset.c:
	Modify dmu_objset_evict() so that it doesn't reference the
	evicted dbuf via dsl_dataset_is_snapshot().

uts/common/fs/zfs/dsl_pool.c:
	In dsl_pool_close(), flush the user evictions for any just released
	dsl dirs with a call to dmu_buf_user_evict_wait().

uts/common/fs/zfs/dsl_dir.c:
uts/common/fs/zfs/sys/dsl_dir.h:
uts/common/fs/zfs/dsl_dataset.c:
uts/common/fs/zfs/sys/dsl_dataset.h:
uts/common/fs/zfs/dsl_dir.c:
uts/common/fs/zfs/dsl_prop.c:
uts/common/fs/zfs/sa.c:
uts/common/fs/zfs/sys/sa_impl.h:
uts/common/fs/zfs/zap.c:
uts/common/fs/zfs/sys/zap_impl.h:
uts/common/fs/zfs/sys/zap_leaf.h:
uts/common/fs/zfs/zap_micro.c:
	Conform to new dbuf user API.

uts/common/fs/zfs/sys/dmu.h:
	Add prototypes, data structures, and code comment documentation
	for the dmu buf user api.

	Pull in ASSERT() via zfs_context.h.

uts/common/fs/zfs/zfs_sa.c:
	Use zfs_context.h instead of manual includes of sys/types.h
	and sys/params.h so this file is compatible with the use of
	zfs_context.h in sys/dmu.h.

cmd/truss/Makefile.com:
cmd/zhack/Makefile.com:
cmd/zinject/Makefile.com:
lib/brand/solaris10/s10_brand/Makefile.com:
lib/libzfs/Makefile.com:
	Disable E_STATIC_UNUSED since lint complains about unused inline
	functions in header files, even though they are "inline", not
	"static inline".