zfsonlinux/zfs — pull request #1496 by dweeezil (2013-06-03 14:54:29+00:00)
Title: Merge Illumos 4445fff (Illumos feature #2882, issue #2883, feature #2900)

Notes from the Illumos commit:

2882 implement libzfs_core
2883 changing "canmount" property to "on" should not always remount dataset
2900 "zfs snapshot" should be able to create multiple, arbitrary snapshots at once
Reviewed by: George Wilson
Reviewed by: Chris Siden
Reviewed by: Garrett D'Amore
Reviewed by: Bill Pijewski
Reviewed by: Dan Kruchinin
Approved by: Eric Schrock

From feature #2882:

We should implement libzfs_core, under the principles proposed here:
http://blog.delphix.com/matt/2012/01/17/the-future-of-libzfs/

This feature request will cover the first phase of this project,
specifically the following tasks:

- create libzfs_core library with functions for snapshot, create,
clone, destroy snapshots, send & receive (simple cases), send space
estimation
- revamp the way zfs ioctls are handled: ioctl-specific arguments
are passed in nvlist, not random zfs_cmd_t fields
- new-style ioctls are logged to the zpool history
- new method of history logging (separate ioctl)
- "zfs snapshot" can create multiple arbitrary snapshots at once
- revamp the way internal history events are handled (stored on disk
as names rather than event ID)

From issue #2883:

If a dataset has the "canmount" property set to "noauto" it may be mounted.
Changing this property to "on" on a mounted dataset should not result
in a umount+mount of this dataset.

From feature #2900:

The "zfs snapshot" command can create a single snapshot, or with
the -r flag, a snapshot for every filesystem under a certain
point. But it may be desired to create only some snapshots, and
to specify a different name for each of them. The "zfs snapshot"
command should allow you to specify multiple snapshots, e.g. "zfs
snapshot pool/fs@a pool/fs2@b".

ZoL-specific changes:

Add "nosleep" versions of the fnvlist_dup, fnvlist_merge,
fnvlist_alloc and fnvlist_pack functions with a suffix of "_nosleep".
They simply perform their allocations with the KM_NOSLEEP flag.

Add zvol minor device creation to the new zfs_snapshot_nvl function.

Misc generic fixes:

Remove the logging of the "release" operation in
dsl_dataset_user_release_sync(). The logging caused a null dereference
because ds->ds_dir is zeroed in dsl_dataset_destroy_sync() and the
logging functions try to get the ds name via the dsl_dataset_name()
function. I've got no idea why this particular code would have worked
in Illumos. This code has subsequently been completely reworked in
Illumos commit 3b2aab1 (3464 zfs synctask code needs restructuring).

Squash some "may be used uninitialized" warning/erorrs.

Fix some printf format warnings for %lld and %llu.