1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright (c) Intel Corporation. All rights reserved. 3 */ 4 5 #ifndef SPDK_THREAD_INTERNAL_H_ 6 #define SPDK_THREAD_INTERNAL_H_ 7 8 #include "spdk/assert.h" 9 #include "spdk/thread.h" 10 #include "spdk/tree.h" 11 12 /** 13 * \brief Represents a per-thread channel for accessing an I/O device. 14 * 15 * An I/O device may be a physical entity (i.e. NVMe controller) or a software 16 * entity (i.e. a blobstore). 17 * 18 * This structure is not part of the API - all accesses should be done through 19 * spdk_io_channel function calls. 20 */ 21 struct spdk_io_channel { 22 struct spdk_thread *thread; 23 struct io_device *dev; 24 uint32_t ref; 25 uint32_t destroy_ref; 26 RB_ENTRY(spdk_io_channel) node; 27 spdk_io_channel_destroy_cb destroy_cb; 28 29 uint8_t _padding[40]; 30 /* 31 * Modules will allocate extra memory off the end of this structure 32 * to store references to hardware-specific references (i.e. NVMe queue 33 * pairs, or references to child device spdk_io_channels (i.e. 34 * virtual bdevs). 35 */ 36 }; 37 38 SPDK_STATIC_ASSERT(sizeof(struct spdk_io_channel) == SPDK_IO_CHANNEL_STRUCT_SIZE, "incorrect size"); 39 40 #endif /* SPDK_THREAD_INTERNAL_H_ */ 41