diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c index 66a2ab590a5f..66c2713e6312 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c @@ -402,6 +402,10 @@ zfs_purgedir(znode_t *dzp) return (skipped); } +#if defined(__FreeBSD__) +extern taskq_t *zfsvfs_taskq; +#endif + void zfs_rmnode(znode_t *zp) { @@ -520,15 +524,17 @@ zfs_rmnode(znode_t *zp) dmu_tx_commit(tx); +#if defined(__FreeBSD__) if (xattr_obj) { /* * We're using the FreeBSD taskqueue API here instead of * the Solaris taskq API since the FreeBSD API allows for a * task to be enqueued multiple times but executed once. */ - taskqueue_enqueue(system_taskq->tq_queue, + taskqueue_enqueue(zfsvfs_taskq->tq_queue, &zfsvfs->z_unlinked_drain_task); } +#endif } static uint64_t diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c index 66d858081485..92f51420e321 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c @@ -1130,6 +1130,8 @@ zfsvfs_init(zfsvfs_t *zfsvfs, objset_t *os) } #if defined(__FreeBSD__) +taskq_t *zfsvfs_taskq; + static void zfsvfs_task_unlinked_drain(void *context, int pending __unused) { @@ -2185,9 +2187,9 @@ zfs_umount(vfs_t *vfsp, int fflag) } #endif - while (taskqueue_cancel(system_taskq->tq_queue, + while (taskqueue_cancel(zfsvfs_taskq->tq_queue, &zfsvfs->z_unlinked_drain_task, NULL) != 0) - taskqueue_drain(system_taskq->tq_queue, + taskqueue_drain(zfsvfs_taskq->tq_queue, &zfsvfs->z_unlinked_drain_task); VERIFY(zfsvfs_teardown(zfsvfs, B_TRUE) == 0); @@ -2554,11 +2556,17 @@ zfs_init(void) zfs_vnodes_adjust(); dmu_objset_register_type(DMU_OST_ZFS, zfs_space_delta_cb); +#if defined(__FreeBSD__) + zfsvfs_taskq = taskq_create("zfsvfs", 1, minclsyspri, 0, 0, 0); +#endif } void zfs_fini(void) { +#if defined(__FreeBSD__) + taskq_destroy(zfsvfs_taskq); +#endif zfsctl_fini(); zfs_znode_fini(); zfs_vnodes_adjust_back();