}
/*
- * Drain the iput_taskq to ensure all active references to the
- * zfs_sb_t have been handled only then can it be safely destroyed.
- */
- taskq_wait(dsl_pool_iput_taskq(dmu_objset_pool(zsb->z_os)));
-
- /*
* Close the zil. NB: Can't close the zil while zfs_inactive
* threads are blocked as zil_close can call zfs_inactive.
*/
/*
* Evict cached data
*/
- if (dmu_objset_is_dirty_anywhere(zsb->z_os))
- if (!zfs_is_readonly(zsb))
- txg_wait_synced(dmu_objset_pool(zsb->z_os), 0);
+ if (dsl_dataset_is_dirty(dmu_objset_ds(zsb->z_os)) &&
+ !zfs_is_readonly(zsb))
+ txg_wait_synced(dmu_objset_pool(zsb->z_os), 0);
(void) dmu_objset_evict_dbufs(zsb->z_os);
return (0);