aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2019-11-21 13:59:06 +0000
committerAndriy Gapon <avg@FreeBSD.org>2019-11-21 13:59:06 +0000
commita15de8f95aabc1f35a16ab8db62c7ebe62f0c8fe (patch)
tree989cb5fc3c3043294b19ad80192a942071cc2ad9
parent5323c63399668c6f35e2b18d557520242b68e2f4 (diff)
downloadsrc-a15de8f95aabc1f35a16ab8db62c7ebe62f0c8fe.tar.gz
src-a15de8f95aabc1f35a16ab8db62c7ebe62f0c8fe.zip
10573 define TASKQID_INVALID as (taskq_id)0
illumos/illumos-gate@fc8ae2ec4282de7ec96f48e11078345f3dc0ac3d https://github.com/illumos/illumos-gate/commit/fc8ae2ec4282de7ec96f48e11078345f3dc0ac3d https://www.illumos.org/issues/10573 We do have taskqid_t taskq_dispatch() and the result of this function is compared with 0, NULL and combined with type casts. Define TASKQID_INVALID (taskq_id)0 and use TASKQID_INVALID everywhere. Author: Toomas Soome <tsoome@me.com>
Notes
Notes: svn path=/vendor-sys/illumos/dist/; revision=354953
-rw-r--r--uts/common/fs/vnode.c2
-rw-r--r--uts/common/fs/zfs/dmu_traverse.c4
-rw-r--r--uts/common/fs/zfs/metaslab.c2
-rw-r--r--uts/common/fs/zfs/vdev.c2
-rw-r--r--uts/common/fs/zfs/vdev_file.c2
-rw-r--r--uts/common/fs/zfs/zil.c3
-rw-r--r--uts/common/sys/taskq.h2
7 files changed, 10 insertions, 7 deletions
diff --git a/uts/common/fs/vnode.c b/uts/common/fs/vnode.c
index ae1a198605eb..f053c9c673d8 100644
--- a/uts/common/fs/vnode.c
+++ b/uts/common/fs/vnode.c
@@ -915,7 +915,7 @@ vn_rele_async(vnode_t *vp, taskq_t *taskq)
if (vp->v_count == 1) {
mutex_exit(&vp->v_lock);
VERIFY(taskq_dispatch(taskq, (task_func_t *)vn_rele_inactive,
- vp, TQ_SLEEP) != NULL);
+ vp, TQ_SLEEP) != TASKQID_INVALID);
return;
}
VN_RELE_LOCKED(vp);
diff --git a/uts/common/fs/zfs/dmu_traverse.c b/uts/common/fs/zfs/dmu_traverse.c
index a3015372f66b..f57e51053060 100644
--- a/uts/common/fs/zfs/dmu_traverse.c
+++ b/uts/common/fs/zfs/dmu_traverse.c
@@ -599,8 +599,8 @@ traverse_impl(spa_t *spa, dsl_dataset_t *ds, uint64_t objset, blkptr_t *rootbp,
}
if (!(flags & TRAVERSE_PREFETCH_DATA) ||
- 0 == taskq_dispatch(system_taskq, traverse_prefetch_thread,
- &td, TQ_NOQUEUE))
+ taskq_dispatch(system_taskq, traverse_prefetch_thread,
+ &td, TQ_NOQUEUE) == TASKQID_INVALID)
pd.pd_exited = B_TRUE;
SET_BOOKMARK(&czb, td.td_objset,
diff --git a/uts/common/fs/zfs/metaslab.c b/uts/common/fs/zfs/metaslab.c
index e6ab2b4f25ad..1c004f87f31a 100644
--- a/uts/common/fs/zfs/metaslab.c
+++ b/uts/common/fs/zfs/metaslab.c
@@ -2511,7 +2511,7 @@ metaslab_group_preload(metaslab_group_t *mg)
}
VERIFY(taskq_dispatch(mg->mg_taskq, metaslab_preload,
- msp, TQ_SLEEP) != NULL);
+ msp, TQ_SLEEP) != TASKQID_INVALID);
}
mutex_exit(&mg->mg_lock);
}
diff --git a/uts/common/fs/zfs/vdev.c b/uts/common/fs/zfs/vdev.c
index ee04a51c6ffe..38e366cc34a9 100644
--- a/uts/common/fs/zfs/vdev.c
+++ b/uts/common/fs/zfs/vdev.c
@@ -1489,7 +1489,7 @@ vdev_open_children(vdev_t *vd)
for (int c = 0; c < children; c++)
VERIFY(taskq_dispatch(tq, vdev_open_child, vd->vdev_child[c],
- TQ_SLEEP) != NULL);
+ TQ_SLEEP) != TASKQID_INVALID);
taskq_destroy(tq);
}
diff --git a/uts/common/fs/zfs/vdev_file.c b/uts/common/fs/zfs/vdev_file.c
index 08e3ae6fdd2e..3aaebe8505cd 100644
--- a/uts/common/fs/zfs/vdev_file.c
+++ b/uts/common/fs/zfs/vdev_file.c
@@ -245,7 +245,7 @@ vdev_file_io_start(zio_t *zio)
bp->b_iodone = vdev_file_io_intr;
VERIFY3U(taskq_dispatch(system_taskq, vdev_file_io_strategy, bp,
- TQ_SLEEP), !=, 0);
+ TQ_SLEEP), !=, TASKQID_INVALID);
}
/* ARGSUSED */
diff --git a/uts/common/fs/zfs/zil.c b/uts/common/fs/zfs/zil.c
index 44cd5bfb6e47..546e4f3d1e12 100644
--- a/uts/common/fs/zfs/zil.c
+++ b/uts/common/fs/zfs/zil.c
@@ -1891,7 +1891,8 @@ zil_clean(zilog_t *zilog, uint64_t synced_txg)
ASSERT3P(zilog->zl_dmu_pool, !=, NULL);
ASSERT3P(zilog->zl_dmu_pool->dp_zil_clean_taskq, !=, NULL);
if (taskq_dispatch(zilog->zl_dmu_pool->dp_zil_clean_taskq,
- (void (*)(void *))zil_itxg_clean, clean_me, TQ_NOSLEEP) == NULL)
+ (void (*)(void *))zil_itxg_clean, clean_me, TQ_NOSLEEP) ==
+ TASKQID_INVALID)
zil_itxg_clean(clean_me);
}
diff --git a/uts/common/sys/taskq.h b/uts/common/sys/taskq.h
index aa7ac6014b68..ab686309b90c 100644
--- a/uts/common/sys/taskq.h
+++ b/uts/common/sys/taskq.h
@@ -60,6 +60,8 @@ struct proc;
#define TQ_NOALLOC 0x04 /* cannot allocate memory; may fail */
#define TQ_FRONT 0x08 /* Put task at the front of the queue */
+#define TASKQID_INVALID ((taskqid_t)0)
+
#ifdef _KERNEL
extern taskq_t *system_taskq;