zfsonlinux/zfs — pull request #1658 by dweeezil (2013-08-16 13:22:39+00:00)
Title: Illumos 3464

Notes from the Illumos commit:
```
Description

The locking code around dsl_datasets and dsl_dir's is responsible for several deadlocks
and race conditions, most prominently:

a concurrent "zfs list" while running "zfs destroy" can cause the destroy to fail
with EBUSY. bug #3041 deadlock between dp->dp_config_rwlock and
ds->ds_opening_lock

To fix this, we must restructure the locking, and change the interface to synctasks.

The wad that will fix this also addresses the following:

improve performance of "zfs recv" by reducing the number of calls to txg_wait_synced()
fix zfs refquota can be violated by "zfs rollback" and "zfs receive" operations
fix ztest fails in ztest_dmu_snapshot_hold due to bad printf string
remove unused zc_top_ds from zfs_cmd_t
fix zdb crashes on pools < SPA_VERSION_DEADLISTS
remove undocumented "zfs hold -t" flag (for temporary hold)
use ASSERT0 / VERIFY0 in more places
new libzfs_core routines: lzc_hold(), lzc_release(), lzc_get_holds() (for user holds)
move some routines from dsl_dataset.c to dsl_destroy.c, dsl_userhold.c
make rrwlock.c work in userland (libzpool.so)
change all synctask consumers to new model
remove ds_recvlock; all receives use "%recv" child to prevent concurrent receives
"zfs destroy" destroys multiple snapshots at once, so it is much faster
```
This patch is based on the pull request #1496 which is based on master as of a day ago or so.