static void quick_test_complete(spdk_event_t event) { struct bdevio_request *req = spdk_event_get_arg1(event); struct spdk_bdev_io *bdev_io = spdk_event_get_arg2(event); spdk_put_io_channel(req->target->ch); g_completion_status = bdev_io->status; spdk_bdev_free_io(bdev_io); wake_ut_thread(); }
static void __blockdev_read(spdk_event_t event) { struct bdevio_request *req = spdk_event_get_arg1(event); struct io_target *target = req->target; struct spdk_bdev_io *bdev_io; target->ch = spdk_bdev_get_io_channel(target->bdev, SPDK_IO_PRIORITY_DEFAULT); bdev_io = spdk_bdev_read(target->bdev, target->ch, req->buf, req->offset, req->data_len, quick_test_complete, req); if (!bdev_io) { spdk_put_io_channel(target->ch); g_completion_status = SPDK_BDEV_IO_STATUS_FAILED; wake_ut_thread(); } }
static void _conn_destruct(spdk_event_t event) { struct spdk_nvmf_conn *conn = spdk_event_get_arg1(event); /* * Notify NVMf library of the fabric connection * going away. If this is the AQ connection then * set state for other connections to abort. */ nvmf_disconnect((void *)conn, conn->sess); if (conn->type == CONN_TYPE_AQ) { SPDK_TRACELOG(SPDK_TRACE_DEBUG, "AQ connection destruct, trigger session closure\n"); /* Trigger all I/O connections to shutdown */ conn->state = CONN_STATE_FABRIC_DISCONNECT; } nvmf_rdma_conn_cleanup(conn); pthread_mutex_lock(&g_conns_mutex); free_conn(conn); pthread_mutex_unlock(&g_conns_mutex); }