MCPcopy Create free account
hub / github.com/F-Stack/f-stack / spa_taskq_dispatch_sync

Function spa_taskq_dispatch_sync

freebsd/contrib/openzfs/module/zfs/spa.c:1078–1098  ·  view source on GitHub ↗

* Same as spa_taskq_dispatch_ent() but block on the task until completion. */

Source from the content-addressed store, hash-verified

1076 * Same as spa_taskq_dispatch_ent() but block on the task until completion.
1077 */
1078void
1079spa_taskq_dispatch_sync(spa_t *spa, zio_type_t t, zio_taskq_type_t q,
1080 task_func_t *func, void *arg, uint_t flags)
1081{
1082 spa_taskqs_t *tqs = &spa->spa_zio_taskq[t][q];
1083 taskq_t *tq;
1084 taskqid_t id;
1085
1086 ASSERT3P(tqs->stqs_taskq, !=, NULL);
1087 ASSERT3U(tqs->stqs_count, !=, 0);
1088
1089 if (tqs->stqs_count == 1) {
1090 tq = tqs->stqs_taskq[0];
1091 } else {
1092 tq = tqs->stqs_taskq[((uint64_t)gethrtime()) % tqs->stqs_count];
1093 }
1094
1095 id = taskq_dispatch(tq, func, arg, flags);
1096 if (id)
1097 taskq_wait_id(tq, id);
1098}
1099
1100static void
1101spa_create_zio_taskqs(spa_t *spa)

Callers 1

dump_bytesFunction · 0.85

Calls 3

gethrtimeFunction · 0.50
taskq_dispatchFunction · 0.50
taskq_wait_idFunction · 0.50

Tested by

no test coverage detected