Lines Matching defs:tth
177 struct nvme_io_test_thread *tth = arg;
180 tth->io_completed++;
184 wakeup_one(tth);
189 timevalsub(&t, &tth->start);
191 if (t.tv_sec >= tth->time) {
192 wakeup_one(tth);
196 switch (tth->opc) {
198 nvme_ns_cmd_write(tth->ns, tth->buf, tth->idx * 2048,
199 tth->size/nvme_ns_get_sector_size(tth->ns),
200 nvme_ns_io_test_cb, tth);
203 nvme_ns_cmd_read(tth->ns, tth->buf, tth->idx * 2048,
204 tth->size/nvme_ns_get_sector_size(tth->ns),
205 nvme_ns_io_test_cb, tth);
216 struct nvme_io_test_thread *tth;
220 tth = malloc(sizeof(*tth), M_NVME, M_WAITOK | M_ZERO);
221 tth->ns = io_test->ns;
222 tth->opc = io_test->opc;
223 memcpy(&tth->start, &io_test->start, sizeof(tth->start));
224 tth->buf = malloc(io_test->size, M_NVME, M_WAITOK);
225 tth->size = io_test->size;
226 tth->time = io_test->time;
227 tth->idx = atomic_fetchadd_int(&io_test->td_idx, 1);
231 nvme_ns_io_test_cb(tth, &cpl);
233 error = tsleep(tth, 0, "test_wait", tth->time*hz*2);
238 io_test->io_completed[tth->idx] = tth->io_completed;
241 free(tth->buf, M_NVME);
242 free(tth, M_NVME);