]> git.proxmox.com Git - mirror_spl.git/blobdiff - module/splat/splat-taskq.c
Add TASKQID_INVALID and TASKQID_INITIAL macros
[mirror_spl.git] / module / splat / splat-taskq.c
index f26f828d960a878a3c9fcc7b27e7a8669a68fb98..665126bddc392b2202afd5a6595fa4430df679b6 100644 (file)
@@ -160,7 +160,7 @@ splat_taskq_test1_impl(struct file *file, void *arg, boolean_t prealloc)
                                    &tq_arg, TQ_SLEEP);
        }
 
-       if (id == 0) {
+       if (id == TASKQID_INVALID) {
                splat_vprint(file, SPLAT_TASKQ_TEST1_NAME,
                             "Taskq '%s' function '%s' dispatch failed\n",
                             tq_arg.name, sym2str(splat_taskq_test13_func));
@@ -296,7 +296,7 @@ splat_taskq_test2_impl(struct file *file, void *arg, boolean_t prealloc) {
                            tq_args[i], TQ_SLEEP);
                }
 
-               if (id == 0) {
+               if (id == TASKQID_INVALID) {
                        splat_vprint(file, SPLAT_TASKQ_TEST2_NAME,
                                   "Taskq '%s/%d' function '%s' dispatch "
                                   "failed\n", tq_args[i]->name, tq_args[i]->id,
@@ -318,7 +318,7 @@ splat_taskq_test2_impl(struct file *file, void *arg, boolean_t prealloc) {
                            tq_args[i], TQ_SLEEP);
                }
 
-               if (id == 0) {
+               if (id == TASKQID_INVALID) {
                        splat_vprint(file, SPLAT_TASKQ_TEST2_NAME, "Taskq "
                                     "'%s/%d' function '%s' dispatch failed\n",
                                     tq_args[i]->name, tq_args[i]->id,
@@ -420,7 +420,7 @@ splat_taskq_test3_impl(struct file *file, void *arg, boolean_t prealloc)
                                    tq_arg, TQ_SLEEP);
        }
 
-       if (id == 0) {
+       if (id == TASKQID_INVALID) {
                splat_vprint(file, SPLAT_TASKQ_TEST3_NAME,
                           "Taskq '%s' function '%s' dispatch failed\n",
                           tq_arg->name, sym2str(splat_taskq_test13_func));
@@ -525,7 +525,7 @@ splat_taskq_test4_common(struct file *file, void *arg, int minalloc,
                                                    &tq_arg, TQ_SLEEP);
                        }
 
-                       if (id == 0) {
+                       if (id == TASKQID_INVALID) {
                                splat_vprint(file, SPLAT_TASKQ_TEST4_NAME,
                                        "Taskq '%s' function '%s' dispatch "
                                        "%d failed\n", tq_arg.name,
@@ -741,7 +741,7 @@ splat_taskq_test5_impl(struct file *file, void *arg, boolean_t prealloc)
                                            &tq_id[i], TQ_SLEEP);
                }
 
-               if (id == 0) {
+               if (id == TASKQID_INVALID) {
                        splat_vprint(file, SPLAT_TASKQ_TEST5_NAME,
                                "Taskq '%s' function '%s' dispatch failed\n",
                                tq_arg.name, sym2str(splat_taskq_test5_func));
@@ -905,7 +905,7 @@ splat_taskq_test6_impl(struct file *file, void *arg, boolean_t prealloc)
                                            &tq_id[i], tflags);
                }
 
-               if (id == 0) {
+               if (id == TASKQID_INVALID) {
                        splat_vprint(file, SPLAT_TASKQ_TEST6_NAME,
                                "Taskq '%s' function '%s' dispatch failed\n",
                                tq_arg.name, sym2str(splat_taskq_test6_func));
@@ -983,7 +983,7 @@ splat_taskq_test7_func(void *arg)
                                    tq_arg, TQ_SLEEP);
        }
 
-       if (id == 0) {
+       if (id == TASKQID_INVALID) {
                splat_vprint(tq_arg->file, SPLAT_TASKQ_TEST7_NAME,
                             "Taskq '%s' function '%s' dispatch failed "
                             "(depth = %u)\n", tq_arg->name,
@@ -1121,7 +1121,7 @@ splat_taskq_throughput(struct file *file, void *arg, const char *name,
                    &tq_arg, TQ_SLEEP, tqes[i]);
                id = tqes[i]->tqent_id;
 
-               if (id == 0) {
+               if (id == TASKQID_INVALID) {
                        splat_vprint(file, name, "Taskq '%s' function '%s' "
                            "dispatch %d failed\n", tq_arg.name,
                            sym2str(splat_taskq_throughput_func), i);
@@ -1235,7 +1235,7 @@ splat_taskq_test9(struct file *file, void *arg)
                id = taskq_dispatch_delay(tq, splat_taskq_test9_func,
                    tq_arg, TQ_SLEEP, ddi_get_lbolt() + rnd);
 
-               if (id == 0) {
+               if (id == TASKQID_INVALID) {
                        splat_vprint(file, SPLAT_TASKQ_TEST9_NAME,
                           "Taskq '%s' delay dispatch failed\n",
                           SPLAT_TASKQ_TEST9_NAME);
@@ -1344,7 +1344,7 @@ splat_taskq_test10(struct file *file, void *arg)
                            tq_arg, TQ_SLEEP, ddi_get_lbolt() + rnd);
                }
 
-               if (tq_arg->id == 0) {
+               if (tq_arg->id == TASKQID_INVALID) {
                        splat_vprint(file, SPLAT_TASKQ_TEST10_NAME,
                           "Taskq '%s' dispatch failed\n",
                           SPLAT_TASKQ_TEST10_NAME);
@@ -1473,8 +1473,8 @@ splat_taskq_test11(struct file *file, void *arg)
            dynamic.tv_sec, dynamic.tv_nsec);
 
        /* A 10x increase in runtime is used to indicate a core problem. */
-       if ((dynamic.tv_sec * NANOSEC + dynamic.tv_nsec) >
-           ((normal.tv_sec * NANOSEC + normal.tv_nsec) * 10))
+       if (((int64_t)dynamic.tv_sec * NANOSEC + (int64_t)dynamic.tv_nsec) >
+           (((int64_t)normal.tv_sec * NANOSEC + (int64_t)normal.tv_nsec) * 10))
                error = -ETIME;
 
        return (error);