/* automatically generated by rust-bindgen 0.72.1 */
#[repr(C)]
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct __BindgenBitfieldUnit<Storage> {
storage: Storage,
}
impl<Storage> __BindgenBitfieldUnit<Storage> {
#[inline]
pub const fn new(storage: Storage) -> Self {
Self { storage }
}
}
impl<Storage> __BindgenBitfieldUnit<Storage>
where
Storage: AsRef<[u8]> + AsMut<[u8]>,
{
#[inline]
fn extract_bit(byte: u8, index: usize) -> bool {
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
index % 8
};
let mask = 1 << bit_index;
byte & mask == mask
}
#[inline]
pub fn get_bit(&self, index: usize) -> bool {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = self.storage.as_ref()[byte_index];
Self::extract_bit(byte, index)
}
#[inline]
pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
let byte_index = index / 8;
let byte = unsafe {
*(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize)
};
Self::extract_bit(byte, index)
}
#[inline]
fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
index % 8
};
let mask = 1 << bit_index;
if val { byte | mask } else { byte & !mask }
}
#[inline]
pub fn set_bit(&mut self, index: usize, val: bool) {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = &mut self.storage.as_mut()[byte_index];
*byte = Self::change_bit(*byte, index, val);
}
#[inline]
pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
let byte_index = index / 8;
let byte = unsafe {
(core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize)
};
unsafe { *byte = Self::change_bit(*byte, index, val) };
}
#[inline]
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
let mut val = 0;
for i in 0..(bit_width as usize) {
if self.get_bit(i + bit_offset) {
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
val |= 1 << index;
}
}
val
}
#[inline]
pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
let mut val = 0;
for i in 0..(bit_width as usize) {
if unsafe { Self::raw_get_bit(this, i + bit_offset) } {
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
val |= 1 << index;
}
}
val
}
#[inline]
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
for i in 0..(bit_width as usize) {
let mask = 1 << i;
let val_bit_is_set = val & mask == mask;
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
self.set_bit(index + bit_offset, val_bit_is_set);
}
}
#[inline]
pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
for i in 0..(bit_width as usize) {
let mask = 1 << i;
let val_bit_is_set = val & mask == mask;
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) };
}
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct iovec {
pub iov_base: *mut ::std::os::raw::c_void,
pub iov_len: usize,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of iovec"][::std::mem::size_of::<iovec>() - 16usize];
["Alignment of iovec"][::std::mem::align_of::<iovec>() - 8usize];
["Offset of field: iovec::iov_base"][::std::mem::offset_of!(iovec, iov_base) - 0usize];
["Offset of field: iovec::iov_len"][::std::mem::offset_of!(iovec, iov_len) - 8usize];
};
unsafe extern "C" {
#[doc = " Allocate a pinned memory buffer with the given size and alignment.\n\n \\param size Size in bytes.\n \\param align If non-zero, the allocated buffer is aligned to a multiple of\n align. In this case, it must be a power of two. The returned buffer is always\n aligned to at least cache line size.\n \\param unused **Invalid**. If not a NULL, the function will fail and return NULL.\n\n \\return a pointer to the allocated memory buffer."]
pub fn spdk_dma_malloc(
size: usize,
align: usize,
unused: *mut u64,
) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
#[doc = " Allocate a pinned memory buffer with the given size and alignment. The buffer\n will be zeroed.\n\n \\param size Size in bytes.\n \\param align If non-zero, the allocated buffer is aligned to a multiple of\n align. In this case, it must be a power of two. The returned buffer is always\n aligned to at least cache line size.\n \\param unused **Invalid**. If not a NULL, the function will fail and return NULL.\n\n \\return a pointer to the allocated memory buffer."]
pub fn spdk_dma_zmalloc(
size: usize,
align: usize,
unused: *mut u64,
) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
#[doc = " Free a memory buffer previously allocated, for example from spdk_dma_zmalloc().\n This call is never made from the performance path.\n\n \\param buf Buffer to free."]
pub fn spdk_dma_free(buf: *mut ::std::os::raw::c_void);
}
unsafe extern "C" {
#[doc = " Get the number of dedicated CPU cores utilized by this env abstraction.\n\n \\return the number of dedicated CPU cores."]
pub fn spdk_env_get_core_count() -> u32;
}
#[doc = " List of CPUs."]
#[repr(C)]
#[repr(align(1))]
pub struct spdk_cpuset {
pub _bindgen_opaque_blob: [u8; 385usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_cpuset"][::std::mem::size_of::<spdk_cpuset>() - 385usize];
["Alignment of spdk_cpuset"][::std::mem::align_of::<spdk_cpuset>() - 1usize];
};
unsafe extern "C" {
#[doc = " Clear all CPUs in CPU set.\n\n \\param set CPU set to be cleared."]
pub fn spdk_cpuset_zero(set: *mut spdk_cpuset);
}
unsafe extern "C" {
#[doc = " Set or clear CPU state in CPU set.\n\n \\param set CPU set object.\n \\param cpu CPU index to be set or cleared.\n \\param state *true* to set cpu, *false* to clear."]
pub fn spdk_cpuset_set_cpu(set: *mut spdk_cpuset, cpu: u32, state: bool);
}
#[doc = " A stackless, lightweight thread."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_thread {
_unused: [u8; 0],
}
#[doc = " A function repeatedly called on the same spdk_thread."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_poller {
_unused: [u8; 0],
}
#[doc = " A function that will be called on the target thread.\n\n \\param ctx Context passed as arg to spdk_thread_pass_msg()."]
pub type spdk_msg_fn =
::std::option::Option<unsafe extern "C" fn(ctx: *mut ::std::os::raw::c_void)>;
#[doc = " Callback function for a poller.\n\n \\param ctx Context passed as arg to spdk_poller_register().\n \\return value of type `enum spdk_thread_poller_rc` (ex: SPDK_POLLER_IDLE\n if no work was done or SPDK_POLLER_BUSY if work was done.)"]
pub type spdk_poller_fn = ::std::option::Option<
unsafe extern "C" fn(ctx: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int,
>;
unsafe extern "C" {
#[doc = " Creates a new SPDK thread object.\n\n Note that the first thread created via spdk_thread_create() will be designated as\n the app thread. Other SPDK libraries may place restrictions on certain APIs to\n only be called in the context of this app thread.\n\n \\param name Human-readable name for the thread; can be retrieved with spdk_thread_get_name().\n The string is copied, so the pointed-to data only needs to be valid during the\n spdk_thread_create() call. May be NULL to specify no name.\n \\param cpumask Optional mask of CPU cores on which to schedule this thread. This is only\n a suggestion to the scheduler. The value is copied, so cpumask may be released when\n this function returns. May be NULL if no mask is required.\n\n \\return a pointer to the allocated thread on success or NULL on failure.."]
pub fn spdk_thread_create(
name: *const ::std::os::raw::c_char,
cpumask: *const spdk_cpuset,
) -> *mut spdk_thread;
}
unsafe extern "C" {
#[doc = " Mark the thread as exited, failing all future spdk_thread_send_msg(),\n spdk_poller_register(), and spdk_get_io_channel() calls. May only be called\n within an spdk poller or message.\n\n All I/O channel references associated with the thread must be released\n using spdk_put_io_channel(), and all active pollers associated with the thread\n should be unregistered using spdk_poller_unregister(), prior to calling\n this function. This function will complete these processing. The completion can\n be queried by spdk_thread_is_exited().\n\n Note that this function must not be called on the app thread until after it\n has been called for all other threads.\n\n \\param thread The thread to exit.\n\n \\return always 0. (return value was deprecated but keep it for ABI compatibility.)"]
pub fn spdk_thread_exit(thread: *mut spdk_thread) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Returns whether the thread is marked as exited.\n\n A thread is exited only after it has spdk_thread_exit() called on it, and\n it has been polled until any outstanding operations targeting this\n thread have completed. This may include poller unregistrations, io channel\n unregistrations, or outstanding spdk_thread_send_msg calls.\n\n \\param thread The thread to query.\n\n \\return true if marked as exited, false otherwise."]
pub fn spdk_thread_is_exited(thread: *mut spdk_thread) -> bool;
}
unsafe extern "C" {
#[doc = " Returns whether the thread is still running.\n\n A thread is considered running until it has * spdk_thread_exit() called on it.\n\n \\param thread The thread to query.\n\n \\return true if still running, false otherwise."]
pub fn spdk_thread_is_running(thread: *mut spdk_thread) -> bool;
}
unsafe extern "C" {
#[doc = " Get a handle to the current thread.\n\n This handle may be passed to other threads and used as the target of\n spdk_thread_send_msg().\n\n \\sa spdk_io_channel_get_thread()\n\n \\return a pointer to the current thread on success or NULL on failure."]
pub fn spdk_get_thread() -> *mut spdk_thread;
}
unsafe extern "C" {
#[doc = " Get a thread's ID.\n\n \\param thread Thread to query.\n\n \\return the ID of the thread.."]
pub fn spdk_thread_get_id(thread: *const spdk_thread) -> u64;
}
unsafe extern "C" {
#[doc = " Send a message to the given thread.\n\n The message will be sent asynchronously - i.e. spdk_thread_send_msg will always return\n prior to `fn` being called.\n\n Errors are handled internally and are fatal. Calling code can skip checking the return\n value as it has been left only for compatibility.\n\n \\param thread The target thread.\n \\param fn This function will be called on the given thread.\n \\param ctx This context will be passed to fn when called.\n\n \\return 0 left for API compatibility"]
pub fn spdk_thread_send_msg(
thread: *const spdk_thread,
fn_: spdk_msg_fn,
ctx: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Register a poller on the current thread.\n\n The poller can be unregistered by calling spdk_poller_unregister().\n\n \\param fn This function will be called every `period_microseconds`.\n \\param arg Argument passed to fn.\n \\param period_microseconds How often to call `fn`. If 0, call `fn` as often\n as possible.\n\n \\return a pointer to the poller registered on the current thread on success\n or NULL on failure."]
pub fn spdk_poller_register(
fn_: spdk_poller_fn,
arg: *mut ::std::os::raw::c_void,
period_microseconds: u64,
) -> *mut spdk_poller;
}
unsafe extern "C" {
#[doc = " Unregister a poller on the current thread.\n\n This function will also write NULL to the spdk_poller pointer pointed\n to by ppoller, to help encourage a poller pointer not getting reused\n after it has been unregistered.\n\n It is OK to pass a ppoller parameter that points to NULL, in this case\n the function is a nop.\n\n \\param ppoller The poller to unregister."]
pub fn spdk_poller_unregister(ppoller: *mut *mut spdk_poller);
}
unsafe extern "C" {
#[doc = " Pause a poller on the current thread.\n\n The poller is not run until it is resumed with spdk_poller_resume(). It is\n perfectly fine to pause an already paused poller.\n\n \\param poller The poller to pause."]
pub fn spdk_poller_pause(poller: *mut spdk_poller);
}
unsafe extern "C" {
#[doc = " Resume a poller on the current thread.\n\n Resumes a poller paused with spdk_poller_pause(). It is perfectly fine to\n resume an unpaused poller.\n\n \\param poller The poller to resume."]
pub fn spdk_poller_resume(poller: *mut spdk_poller);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_io_channel {
_unused: [u8; 0],
}
unsafe extern "C" {
#[doc = " Get an I/O channel for the specified io_device to be used by the calling thread.\n\n The io_device context pointer specified must have previously been registered\n using spdk_io_device_register(). If an existing I/O channel does not exist\n yet for the given io_device on the calling thread, it will allocate an I/O\n channel and invoke the create_cb function pointer specified in spdk_io_device_register().\n If an I/O channel already exists for the given io_device on the calling thread,\n its reference is returned rather than creating a new I/O channel.\n\n \\param io_device The pointer to io_device context.\n\n \\return a pointer to the I/O channel for this device on success or NULL on failure."]
pub fn spdk_get_io_channel(io_device: *mut ::std::os::raw::c_void) -> *mut spdk_io_channel;
}
unsafe extern "C" {
#[doc = " Release a reference to an I/O channel. This happens asynchronously.\n\n This must be called on the same thread that called spdk_get_io_channel()\n for the specified I/O channel. If this releases the last reference to the\n I/O channel, The destroy_cb function specified in spdk_io_device_register()\n will be invoked to release any associated resources.\n\n \\param ch I/O channel to release a reference."]
pub fn spdk_put_io_channel(ch: *mut spdk_io_channel);
}
unsafe extern "C" {
#[doc = " Take a reference to an existing I/O channel.\n\n This can be called on an existing io_channel that was previously returned from\n spdk_get_io_channel(). This must be called on the same thread that called\n spdk_get_io_channel() for the specified I/O channel. spdk_put_io_channel() must\n be called to release the reference when it is no longer needed.\n\n \\param ch The existing I/O channel to reference.\n\n \\return The same I/O channel pointer that was passed in."]
pub fn spdk_io_channel_ref(ch: *mut spdk_io_channel) -> *mut spdk_io_channel;
}
#[doc = " A spinlock augmented with safety checks for use with SPDK.\n\n SPDK code that uses spdk_spinlock runs from an SPDK thread, which itself is associated with a\n pthread. There are typically many SPDK threads associated with each pthread. The SPDK application\n may migrate SPDK threads between pthreads from time to time to balance the load on those threads.\n Migration of SPDK threads only happens when the thread is off CPU, and as such it is only safe to\n hold a lock so long as an SPDK thread stays on CPU.\n\n It is not safe to lock a spinlock, return from the event or poller, then unlock it at some later\n time because:\n\n - Even though the SPDK thread may be the same, the SPDK thread may be running on different\n pthreads during lock and unlock. A pthread spinlock may consider this to be an unlock by a\n non-owner, which results in undefined behavior.\n - A lock that is acquired by a poller or event may be needed by another poller or event that\n runs on the same pthread. This can lead to deadlock or detection of deadlock.\n - A lock that is acquired by a poller or event that is needed by another poller or event that\n runs on a second pthread will block the second pthread from doing any useful work until the\n lock is released. Because the lock holder and the lock acquirer are on the same pthread, this\n would lead to deadlock.\n\n If an SPDK spinlock is used erroneously, the program will abort."]
#[repr(C)]
#[repr(align(8))]
#[derive(Debug, Copy, Clone)]
pub struct spdk_spinlock {
pub _bindgen_opaque_blob: [u64; 4usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_spinlock"][::std::mem::size_of::<spdk_spinlock>() - 32usize];
["Alignment of spdk_spinlock"][::std::mem::align_of::<spdk_spinlock>() - 8usize];
};
#[doc = " Callback function for customized shutdown handling of application."]
pub type spdk_app_shutdown_cb = ::std::option::Option<unsafe extern "C" fn()>;
#[doc = " \\brief Event framework initialization options"]
#[repr(C)]
#[repr(align(1))]
pub struct spdk_app_opts {
pub _bindgen_opaque_blob: [u8; 253usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_app_opts"][::std::mem::size_of::<spdk_app_opts>() - 253usize];
["Alignment of spdk_app_opts"][::std::mem::align_of::<spdk_app_opts>() - 1usize];
};
unsafe extern "C" {
pub fn spdk_io_channel_get_ref_count(ch: *mut spdk_io_channel) -> ::std::os::raw::c_int;
}
pub const SPDK_DIF_DISABLE: spdk_dif_type = 0;
pub const SPDK_DIF_TYPE1: spdk_dif_type = 1;
pub const SPDK_DIF_TYPE2: spdk_dif_type = 2;
pub const SPDK_DIF_TYPE3: spdk_dif_type = 3;
pub type spdk_dif_type = ::std::os::raw::c_uint;
#[repr(C)]
#[repr(align(8))]
#[derive(Debug, Copy, Clone)]
pub struct spdk_json_val {
pub _bindgen_opaque_blob: [u64; 2usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_json_val"][::std::mem::size_of::<spdk_json_val>() - 16usize];
["Alignment of spdk_json_val"][::std::mem::align_of::<spdk_json_val>() - 8usize];
};
pub const SPDK_BDEV_STATUS_INVALID: spdk_bdev_status = 0;
pub const SPDK_BDEV_STATUS_READY: spdk_bdev_status = 1;
pub const SPDK_BDEV_STATUS_UNREGISTERING: spdk_bdev_status = 2;
pub const SPDK_BDEV_STATUS_REMOVING: spdk_bdev_status = 3;
#[doc = " bdev status"]
pub type spdk_bdev_status = ::std::os::raw::c_uint;
#[doc = " \\brief Handle to an opened SPDK block device."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_desc {
_unused: [u8; 0],
}
pub const SPDK_BDEV_IO_TYPE_INVALID: spdk_bdev_io_type = 0;
pub const SPDK_BDEV_IO_TYPE_READ: spdk_bdev_io_type = 1;
pub const SPDK_BDEV_IO_TYPE_WRITE: spdk_bdev_io_type = 2;
pub const SPDK_BDEV_IO_TYPE_UNMAP: spdk_bdev_io_type = 3;
pub const SPDK_BDEV_IO_TYPE_FLUSH: spdk_bdev_io_type = 4;
pub const SPDK_BDEV_IO_TYPE_RESET: spdk_bdev_io_type = 5;
pub const SPDK_BDEV_IO_TYPE_NVME_ADMIN: spdk_bdev_io_type = 6;
pub const SPDK_BDEV_IO_TYPE_NVME_IO: spdk_bdev_io_type = 7;
pub const SPDK_BDEV_IO_TYPE_NVME_IO_MD: spdk_bdev_io_type = 8;
pub const SPDK_BDEV_IO_TYPE_WRITE_ZEROES: spdk_bdev_io_type = 9;
pub const SPDK_BDEV_IO_TYPE_ZCOPY: spdk_bdev_io_type = 10;
pub const SPDK_BDEV_IO_TYPE_GET_ZONE_INFO: spdk_bdev_io_type = 11;
pub const SPDK_BDEV_IO_TYPE_ZONE_MANAGEMENT: spdk_bdev_io_type = 12;
pub const SPDK_BDEV_IO_TYPE_ZONE_APPEND: spdk_bdev_io_type = 13;
pub const SPDK_BDEV_IO_TYPE_COMPARE: spdk_bdev_io_type = 14;
pub const SPDK_BDEV_IO_TYPE_COMPARE_AND_WRITE: spdk_bdev_io_type = 15;
pub const SPDK_BDEV_IO_TYPE_ABORT: spdk_bdev_io_type = 16;
pub const SPDK_BDEV_IO_TYPE_SEEK_HOLE: spdk_bdev_io_type = 17;
pub const SPDK_BDEV_IO_TYPE_SEEK_DATA: spdk_bdev_io_type = 18;
pub const SPDK_BDEV_IO_TYPE_COPY: spdk_bdev_io_type = 19;
pub const SPDK_BDEV_IO_TYPE_NVME_IOV_MD: spdk_bdev_io_type = 20;
pub const SPDK_BDEV_IO_TYPE_NVME_NSSR: spdk_bdev_io_type = 21;
pub const SPDK_BDEV_IO_TYPE_WRITE_UNCORRECTABLE: spdk_bdev_io_type = 22;
pub const SPDK_BDEV_NUM_IO_TYPES: spdk_bdev_io_type = 23;
#[doc = " bdev I/O type"]
pub type spdk_bdev_io_type = ::std::os::raw::c_uint;
#[doc = " Block device completion callback.\n\n \\param bdev_io Block device I/O that has completed.\n \\param success True if I/O completed successfully or false if it failed;\n additional error information may be retrieved from bdev_io by calling\n spdk_bdev_io_get_nvme_status() or spdk_bdev_io_get_scsi_status().\n \\param cb_arg Callback argument specified when bdev_io was submitted."]
pub type spdk_bdev_io_completion_cb = ::std::option::Option<
unsafe extern "C" fn(
bdev_io: *mut spdk_bdev_io,
success: bool,
cb_arg: *mut ::std::os::raw::c_void,
),
>;
#[repr(C)]
#[repr(align(8))]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_io_stat {
pub _bindgen_opaque_blob: [u64; 22usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_io_stat"][::std::mem::size_of::<spdk_bdev_io_stat>() - 176usize];
["Alignment of spdk_bdev_io_stat"][::std::mem::align_of::<spdk_bdev_io_stat>() - 8usize];
};
unsafe extern "C" {
#[doc = " Close a previously opened block device.\n\n Must be called on the same thread that the spdk_bdev_open_ext()\n was performed on.\n\n \\param desc Block device descriptor to close."]
pub fn spdk_bdev_close(desc: *mut spdk_bdev_desc);
}
unsafe extern "C" {
#[doc = " Get the bdev associated with a bdev descriptor.\n\n \\param desc Open block device descriptor\n \\return bdev associated with the descriptor"]
pub fn spdk_bdev_desc_get_bdev(desc: *mut spdk_bdev_desc) -> *mut spdk_bdev;
}
unsafe extern "C" {
#[doc = " Check whether the block device supports the I/O type.\n\n \\param bdev Block device to check.\n \\param io_type The specific I/O type like read, write, flush, unmap.\n \\return true if support, false otherwise."]
pub fn spdk_bdev_io_type_supported(bdev: *mut spdk_bdev, io_type: spdk_bdev_io_type) -> bool;
}
unsafe extern "C" {
#[doc = " Get block device logical block size.\n\n \\param bdev Block device to query.\n \\return Size of logical block for this bdev in bytes."]
pub fn spdk_bdev_get_block_size(bdev: *const spdk_bdev) -> u32;
}
unsafe extern "C" {
#[doc = " Get block device metadata size.\n\n \\param bdev Block device to query.\n \\return Size of metadata for this bdev in bytes."]
pub fn spdk_bdev_get_md_size(bdev: *const spdk_bdev) -> u32;
}
unsafe extern "C" {
#[doc = " Query whether metadata is interleaved with block data or separated\n from block data.\n\n Note this function is valid only if there is metadata.\n\n \\param bdev Block device to query.\n \\return true if metadata is separated from block data, false\n otherwise."]
pub fn spdk_bdev_is_md_separate(bdev: *const spdk_bdev) -> bool;
}
unsafe extern "C" {
#[doc = " Get DIF type of the block device.\n\n \\param bdev Block device to query.\n \\return DIF type of the block device."]
pub fn spdk_bdev_get_dif_type(bdev: *const spdk_bdev) -> spdk_dif_type;
}
unsafe extern "C" {
#[doc = " Obtain an I/O channel for the block device opened by the specified\n descriptor. I/O channels are bound to threads, so the resulting I/O\n channel may only be used from the thread it was originally obtained\n from.\n\n \\param desc Block device descriptor.\n\n \\return A handle to the I/O channel or NULL on failure."]
pub fn spdk_bdev_get_io_channel(desc: *mut spdk_bdev_desc) -> *mut spdk_io_channel;
}
unsafe extern "C" {
#[doc = " Submit a read request to the bdev on the given channel. This differs from\n spdk_bdev_read by allowing the data buffer to be described in a scatter\n gather list. Some physical devices place memory alignment requirements on\n data and may not be able to directly transfer into the buffers provided. In\n this case, the request may fail.\n\n \\ingroup bdev_io_submit_functions\n\n \\param desc Block device descriptor.\n \\param ch I/O channel. Obtained by calling spdk_bdev_get_io_channel().\n \\param iov A scatter gather list of buffers to be read into.\n \\param iovcnt The number of elements in iov.\n \\param offset_blocks The offset, in blocks, from the start of the block device.\n \\param num_blocks The number of blocks to read.\n \\param cb Called when the request is complete.\n \\param cb_arg Argument passed to cb.\n\n \\return 0 on success. On success, the callback will always\n be called (even if the request ultimately failed). Return\n negated errno on failure, in which case the callback will not be called.\n * -EINVAL - offset_blocks and/or num_blocks are out of range\n * -ENOMEM - spdk_bdev_io buffer cannot be allocated"]
pub fn spdk_bdev_readv_blocks(
desc: *mut spdk_bdev_desc,
ch: *mut spdk_io_channel,
iov: *mut iovec,
iovcnt: ::std::os::raw::c_int,
offset_blocks: u64,
num_blocks: u64,
cb: spdk_bdev_io_completion_cb,
cb_arg: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Submit a write request to the bdev on the given channel. This differs from\n spdk_bdev_write by allowing the data buffer to be described in a scatter\n gather list. Some physical devices place memory alignment requirements on\n data and may not be able to directly transfer out of the buffers provided. In\n this case, the request may fail.\n\n \\ingroup bdev_io_submit_functions\n\n \\param desc Block device descriptor.\n \\param ch I/O channel. Obtained by calling spdk_bdev_get_io_channel().\n \\param iov A scatter gather list of buffers to be written from.\n \\param iovcnt The number of elements in iov.\n \\param offset_blocks The offset, in blocks, from the start of the block device.\n \\param num_blocks The number of blocks to write.\n \\param cb Called when the request is complete.\n \\param cb_arg Argument passed to cb.\n\n \\return 0 on success. On success, the callback will always\n be called (even if the request ultimately failed). Return\n negated errno on failure, in which case the callback will not be called.\n * -EINVAL - offset_blocks and/or num_blocks are out of range\n * -ENOMEM - spdk_bdev_io buffer cannot be allocated\n * -EBADF - desc not open for writing"]
pub fn spdk_bdev_writev_blocks(
desc: *mut spdk_bdev_desc,
ch: *mut spdk_io_channel,
iov: *mut iovec,
iovcnt: ::std::os::raw::c_int,
offset_blocks: u64,
num_blocks: u64,
cb: spdk_bdev_io_completion_cb,
cb_arg: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Free an I/O request. This should only be called after the completion callback\n for the I/O has been called and notifies the bdev layer that memory may now\n be released.\n\n \\param bdev_io I/O request."]
pub fn spdk_bdev_free_io(bdev_io: *mut spdk_bdev_io);
}
unsafe extern "C" {
#[doc = " Get metadata buffer. Only makes sense if the IO uses separate buffer for\n metadata transfer.\n\n \\param bdev_io I/O to retrieve the buffer from.\n \\return Pointer to metadata buffer, NULL if the IO doesn't use separate\n buffer for metadata transfer."]
pub fn spdk_bdev_io_get_md_buf(bdev_io: *mut spdk_bdev_io) -> *mut ::std::os::raw::c_void;
}
#[doc = " Block device module"]
#[repr(C)]
#[repr(align(8))]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_module {
pub _bindgen_opaque_blob: [u64; 19usize],
}
#[doc = " Fields that are used by the internal bdev subsystem. Bdev modules\n must not read or write to these fields."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_module___bdev_module_internal_fields {
#[doc = " Protects action_in_progress and quiesced_ranges.\n Take no locks while holding this one."]
pub spinlock: spdk_spinlock,
#[doc = " Count of bdev inits/examinations in progress. Used by generic bdev\n layer and must not be modified by bdev modules.\n\n \\note Used internally by bdev subsystem, don't change this value in bdev module."]
pub action_in_progress: u32,
#[doc = " List of quiesced lba ranges in all bdevs of this module."]
pub quiesced_ranges: spdk_bdev_module___bdev_module_internal_fields__bindgen_ty_1,
pub tailq: spdk_bdev_module___bdev_module_internal_fields__bindgen_ty_2,
}
#[doc = " List of quiesced lba ranges in all bdevs of this module."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_module___bdev_module_internal_fields__bindgen_ty_1 {
pub tqh_first: *mut lba_range,
pub tqh_last: *mut *mut lba_range,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_module___bdev_module_internal_fields__bindgen_ty_1"][::std::mem::size_of::<
spdk_bdev_module___bdev_module_internal_fields__bindgen_ty_1,
>() - 16usize];
["Alignment of spdk_bdev_module___bdev_module_internal_fields__bindgen_ty_1"]
[::std::mem::align_of::<spdk_bdev_module___bdev_module_internal_fields__bindgen_ty_1>()
- 8usize];
["Offset of field: spdk_bdev_module___bdev_module_internal_fields__bindgen_ty_1::tqh_first"][::std::mem::offset_of!(
spdk_bdev_module___bdev_module_internal_fields__bindgen_ty_1,
tqh_first
)
- 0usize];
["Offset of field: spdk_bdev_module___bdev_module_internal_fields__bindgen_ty_1::tqh_last"][::std::mem::offset_of!(
spdk_bdev_module___bdev_module_internal_fields__bindgen_ty_1,
tqh_last
)
- 8usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_module___bdev_module_internal_fields__bindgen_ty_2 {
pub tqe_next: *mut spdk_bdev_module,
pub tqe_prev: *mut *mut spdk_bdev_module,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_module___bdev_module_internal_fields__bindgen_ty_2"][::std::mem::size_of::<
spdk_bdev_module___bdev_module_internal_fields__bindgen_ty_2,
>() - 16usize];
["Alignment of spdk_bdev_module___bdev_module_internal_fields__bindgen_ty_2"]
[::std::mem::align_of::<spdk_bdev_module___bdev_module_internal_fields__bindgen_ty_2>()
- 8usize];
["Offset of field: spdk_bdev_module___bdev_module_internal_fields__bindgen_ty_2::tqe_next"][::std::mem::offset_of!(
spdk_bdev_module___bdev_module_internal_fields__bindgen_ty_2,
tqe_next
)
- 0usize];
["Offset of field: spdk_bdev_module___bdev_module_internal_fields__bindgen_ty_2::tqe_prev"][::std::mem::offset_of!(
spdk_bdev_module___bdev_module_internal_fields__bindgen_ty_2,
tqe_prev
)
- 8usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_module___bdev_module_internal_fields"]
[::std::mem::size_of::<spdk_bdev_module___bdev_module_internal_fields>() - 72usize];
["Alignment of spdk_bdev_module___bdev_module_internal_fields"]
[::std::mem::align_of::<spdk_bdev_module___bdev_module_internal_fields>() - 8usize];
["Offset of field: spdk_bdev_module___bdev_module_internal_fields::spinlock"]
[::std::mem::offset_of!(spdk_bdev_module___bdev_module_internal_fields, spinlock) - 0usize];
["Offset of field: spdk_bdev_module___bdev_module_internal_fields::action_in_progress"][::std::mem::offset_of!(
spdk_bdev_module___bdev_module_internal_fields,
action_in_progress
)
- 32usize];
["Offset of field: spdk_bdev_module___bdev_module_internal_fields::quiesced_ranges"][::std::mem::offset_of!(
spdk_bdev_module___bdev_module_internal_fields,
quiesced_ranges
)
- 40usize];
["Offset of field: spdk_bdev_module___bdev_module_internal_fields::tailq"]
[::std::mem::offset_of!(spdk_bdev_module___bdev_module_internal_fields, tailq) - 56usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_module"][::std::mem::size_of::<spdk_bdev_module>() - 152usize];
["Alignment of spdk_bdev_module"][::std::mem::align_of::<spdk_bdev_module>() - 8usize];
};
pub const SPDK_BDEV_CLAIM_NONE: spdk_bdev_claim_type = 0;
#[doc = " Exclusive writer, with allowances for legacy behavior. This matches the behavior of\n `spdk_bdev_module_claim_bdev()` as of SPDK 22.09. New consumer should use\n SPDK_BDEV_CLAIM_READ_MANY_WRITE_ONE instead."]
pub const SPDK_BDEV_CLAIM_EXCL_WRITE: spdk_bdev_claim_type = 1;
#[doc = " The descriptor passed with this claim request is the only writer. Other claimless readers\n are allowed."]
pub const SPDK_BDEV_CLAIM_READ_MANY_WRITE_ONE: spdk_bdev_claim_type = 2;
#[doc = " Any number of readers, no writers. Readers without a claim are allowed."]
pub const SPDK_BDEV_CLAIM_READ_MANY_WRITE_NONE: spdk_bdev_claim_type = 3;
#[doc = " Any number of writers with matching shared_claim_key. After the first writer establishes\n a claim, future aspiring writers should open read-only and pass the read-only descriptor.\n If the shared claim is granted to the aspiring writer, the descriptor will be upgraded to\n read-write."]
pub const SPDK_BDEV_CLAIM_READ_MANY_WRITE_SHARED: spdk_bdev_claim_type = 4;
#[doc = " Claim types"]
pub type spdk_bdev_claim_type = ::std::os::raw::c_uint;
pub type spdk_bdev_unregister_cb = ::std::option::Option<
unsafe extern "C" fn(cb_arg: *mut ::std::os::raw::c_void, rc: ::std::os::raw::c_int),
>;
pub const SPDK_BDEV_IO_STATUS_AIO_ERROR: spdk_bdev_io_status = -8;
pub const SPDK_BDEV_IO_STATUS_ABORTED: spdk_bdev_io_status = -7;
pub const SPDK_BDEV_IO_STATUS_FIRST_FUSED_FAILED: spdk_bdev_io_status = -6;
pub const SPDK_BDEV_IO_STATUS_MISCOMPARE: spdk_bdev_io_status = -5;
pub const SPDK_BDEV_IO_STATUS_NOMEM: spdk_bdev_io_status = -4;
pub const SPDK_BDEV_IO_STATUS_SCSI_ERROR: spdk_bdev_io_status = -3;
pub const SPDK_BDEV_IO_STATUS_NVME_ERROR: spdk_bdev_io_status = -2;
pub const SPDK_BDEV_IO_STATUS_FAILED: spdk_bdev_io_status = -1;
pub const SPDK_BDEV_IO_STATUS_PENDING: spdk_bdev_io_status = 0;
pub const SPDK_BDEV_IO_STATUS_SUCCESS: spdk_bdev_io_status = 1;
pub const SPDK_MIN_BDEV_IO_STATUS: spdk_bdev_io_status = -8;
#[doc = " bdev I/O completion status"]
pub type spdk_bdev_io_status = ::std::os::raw::c_int;
#[repr(C)]
#[repr(align(8))]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_name {
pub _bindgen_opaque_blob: [u64; 5usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_name__bindgen_ty_1 {
pub rbe_left: *mut spdk_bdev_name,
pub rbe_right: *mut spdk_bdev_name,
pub rbe_parent: *mut spdk_bdev_name,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_name__bindgen_ty_1"]
[::std::mem::size_of::<spdk_bdev_name__bindgen_ty_1>() - 24usize];
["Alignment of spdk_bdev_name__bindgen_ty_1"]
[::std::mem::align_of::<spdk_bdev_name__bindgen_ty_1>() - 8usize];
["Offset of field: spdk_bdev_name__bindgen_ty_1::rbe_left"]
[::std::mem::offset_of!(spdk_bdev_name__bindgen_ty_1, rbe_left) - 0usize];
["Offset of field: spdk_bdev_name__bindgen_ty_1::rbe_right"]
[::std::mem::offset_of!(spdk_bdev_name__bindgen_ty_1, rbe_right) - 8usize];
["Offset of field: spdk_bdev_name__bindgen_ty_1::rbe_parent"]
[::std::mem::offset_of!(spdk_bdev_name__bindgen_ty_1, rbe_parent) - 16usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_name"][::std::mem::size_of::<spdk_bdev_name>() - 40usize];
["Alignment of spdk_bdev_name"][::std::mem::align_of::<spdk_bdev_name>() - 8usize];
};
#[repr(C)]
#[repr(align(8))]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_alias {
pub _bindgen_opaque_blob: [u64; 7usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_alias__bindgen_ty_1 {
pub tqe_next: *mut spdk_bdev_alias,
pub tqe_prev: *mut *mut spdk_bdev_alias,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_alias__bindgen_ty_1"]
[::std::mem::size_of::<spdk_bdev_alias__bindgen_ty_1>() - 16usize];
["Alignment of spdk_bdev_alias__bindgen_ty_1"]
[::std::mem::align_of::<spdk_bdev_alias__bindgen_ty_1>() - 8usize];
["Offset of field: spdk_bdev_alias__bindgen_ty_1::tqe_next"]
[::std::mem::offset_of!(spdk_bdev_alias__bindgen_ty_1, tqe_next) - 0usize];
["Offset of field: spdk_bdev_alias__bindgen_ty_1::tqe_prev"]
[::std::mem::offset_of!(spdk_bdev_alias__bindgen_ty_1, tqe_prev) - 8usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_alias"][::std::mem::size_of::<spdk_bdev_alias>() - 56usize];
["Alignment of spdk_bdev_alias"][::std::mem::align_of::<spdk_bdev_alias>() - 8usize];
};
#[repr(C)]
#[repr(align(8))]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_module_claim {
pub _bindgen_opaque_blob: [u64; 8usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_module_claim__bindgen_ty_1 {
pub tqe_next: *mut spdk_bdev_module_claim,
pub tqe_prev: *mut *mut spdk_bdev_module_claim,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_module_claim__bindgen_ty_1"]
[::std::mem::size_of::<spdk_bdev_module_claim__bindgen_ty_1>() - 16usize];
["Alignment of spdk_bdev_module_claim__bindgen_ty_1"]
[::std::mem::align_of::<spdk_bdev_module_claim__bindgen_ty_1>() - 8usize];
["Offset of field: spdk_bdev_module_claim__bindgen_ty_1::tqe_next"]
[::std::mem::offset_of!(spdk_bdev_module_claim__bindgen_ty_1, tqe_next) - 0usize];
["Offset of field: spdk_bdev_module_claim__bindgen_ty_1::tqe_prev"]
[::std::mem::offset_of!(spdk_bdev_module_claim__bindgen_ty_1, tqe_prev) - 8usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_module_claim"][::std::mem::size_of::<spdk_bdev_module_claim>() - 64usize];
["Alignment of spdk_bdev_module_claim"]
[::std::mem::align_of::<spdk_bdev_module_claim>() - 8usize];
};
#[repr(C)]
#[repr(align(8))]
#[derive(Debug, Copy, Clone)]
pub struct bdev_io_tailq_t {
pub _bindgen_opaque_blob: [u64; 2usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of bdev_io_tailq_t"][::std::mem::size_of::<bdev_io_tailq_t>() - 16usize];
["Alignment of bdev_io_tailq_t"][::std::mem::align_of::<bdev_io_tailq_t>() - 8usize];
};
#[repr(C)]
#[repr(align(8))]
#[derive(Debug, Copy, Clone)]
pub struct lba_range_tailq_t {
pub _bindgen_opaque_blob: [u64; 2usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of lba_range_tailq_t"][::std::mem::size_of::<lba_range_tailq_t>() - 16usize];
["Alignment of lba_range_tailq_t"][::std::mem::align_of::<lba_range_tailq_t>() - 8usize];
};
#[doc = " \\brief SPDK block device.\n\n This is a virtual representation of a block device that is exported by the backend."]
#[repr(C)]
#[repr(align(8))]
pub struct spdk_bdev {
pub _bindgen_opaque_blob: [u64; 72usize],
}
#[doc = " Unique aliases for this block device."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_spdk_bdev_aliases_list {
pub tqh_first: *mut spdk_bdev_alias,
pub tqh_last: *mut *mut spdk_bdev_alias,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_spdk_bdev_aliases_list"]
[::std::mem::size_of::<spdk_bdev_spdk_bdev_aliases_list>() - 16usize];
["Alignment of spdk_bdev_spdk_bdev_aliases_list"]
[::std::mem::align_of::<spdk_bdev_spdk_bdev_aliases_list>() - 8usize];
["Offset of field: spdk_bdev_spdk_bdev_aliases_list::tqh_first"]
[::std::mem::offset_of!(spdk_bdev_spdk_bdev_aliases_list, tqh_first) - 0usize];
["Offset of field: spdk_bdev_spdk_bdev_aliases_list::tqh_last"]
[::std::mem::offset_of!(spdk_bdev_spdk_bdev_aliases_list, tqh_last) - 8usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev__bindgen_ty_1 {
pub _bitfield_align_1: [u32; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev__bindgen_ty_1"][::std::mem::size_of::<spdk_bdev__bindgen_ty_1>() - 4usize];
["Alignment of spdk_bdev__bindgen_ty_1"]
[::std::mem::align_of::<spdk_bdev__bindgen_ty_1>() - 4usize];
};
impl spdk_bdev__bindgen_ty_1 {
#[inline]
pub fn split_on_write_unit(&self) -> u32 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) }
}
#[inline]
pub fn set_split_on_write_unit(&mut self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
self._bitfield_1.set(0usize, 1u8, val as u64)
}
}
#[inline]
pub unsafe fn split_on_write_unit_raw(this: *const Self) -> u32 {
unsafe {
::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
::std::ptr::addr_of!((*this)._bitfield_1),
0usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_split_on_write_unit_raw(this: *mut Self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
::std::ptr::addr_of_mut!((*this)._bitfield_1),
0usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn split_on_optimal_io_boundary(&self) -> u32 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) }
}
#[inline]
pub fn set_split_on_optimal_io_boundary(&mut self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
self._bitfield_1.set(1usize, 1u8, val as u64)
}
}
#[inline]
pub unsafe fn split_on_optimal_io_boundary_raw(this: *const Self) -> u32 {
unsafe {
::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
::std::ptr::addr_of!((*this)._bitfield_1),
1usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_split_on_optimal_io_boundary_raw(this: *mut Self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
::std::ptr::addr_of_mut!((*this)._bitfield_1),
1usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn md_interleave(&self) -> u32 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) }
}
#[inline]
pub fn set_md_interleave(&mut self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
self._bitfield_1.set(2usize, 1u8, val as u64)
}
}
#[inline]
pub unsafe fn md_interleave_raw(this: *const Self) -> u32 {
unsafe {
::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
::std::ptr::addr_of!((*this)._bitfield_1),
2usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_md_interleave_raw(this: *mut Self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
::std::ptr::addr_of_mut!((*this)._bitfield_1),
2usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn dif_is_head_of_md(&self) -> u32 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) }
}
#[inline]
pub fn set_dif_is_head_of_md(&mut self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
self._bitfield_1.set(3usize, 1u8, val as u64)
}
}
#[inline]
pub unsafe fn dif_is_head_of_md_raw(this: *const Self) -> u32 {
unsafe {
::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
::std::ptr::addr_of!((*this)._bitfield_1),
3usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_dif_is_head_of_md_raw(this: *mut Self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
::std::ptr::addr_of_mut!((*this)._bitfield_1),
3usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn zoned(&self) -> u32 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) }
}
#[inline]
pub fn set_zoned(&mut self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
self._bitfield_1.set(4usize, 1u8, val as u64)
}
}
#[inline]
pub unsafe fn zoned_raw(this: *const Self) -> u32 {
unsafe {
::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
::std::ptr::addr_of!((*this)._bitfield_1),
4usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_zoned_raw(this: *mut Self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
::std::ptr::addr_of_mut!((*this)._bitfield_1),
4usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn media_events(&self) -> u32 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) }
}
#[inline]
pub fn set_media_events(&mut self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
self._bitfield_1.set(5usize, 1u8, val as u64)
}
}
#[inline]
pub unsafe fn media_events_raw(this: *const Self) -> u32 {
unsafe {
::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
::std::ptr::addr_of!((*this)._bitfield_1),
5usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_media_events_raw(this: *mut Self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
::std::ptr::addr_of_mut!((*this)._bitfield_1),
5usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn memory_domains_supported(&self) -> u32 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) }
}
#[inline]
pub fn set_memory_domains_supported(&mut self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
self._bitfield_1.set(6usize, 1u8, val as u64)
}
}
#[inline]
pub unsafe fn memory_domains_supported_raw(this: *const Self) -> u32 {
unsafe {
::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
::std::ptr::addr_of!((*this)._bitfield_1),
6usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_memory_domains_supported_raw(this: *mut Self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
::std::ptr::addr_of_mut!((*this)._bitfield_1),
6usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn reserved(&self) -> u32 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 25u8) as u32) }
}
#[inline]
pub fn set_reserved(&mut self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
self._bitfield_1.set(7usize, 25u8, val as u64)
}
}
#[inline]
pub unsafe fn reserved_raw(this: *const Self) -> u32 {
unsafe {
::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
::std::ptr::addr_of!((*this)._bitfield_1),
7usize,
25u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_reserved_raw(this: *mut Self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
::std::ptr::addr_of_mut!((*this)._bitfield_1),
7usize,
25u8,
val as u64,
)
}
}
#[inline]
pub fn new_bitfield_1(
split_on_write_unit: u32,
split_on_optimal_io_boundary: u32,
md_interleave: u32,
dif_is_head_of_md: u32,
zoned: u32,
media_events: u32,
memory_domains_supported: u32,
reserved: u32,
) -> __BindgenBitfieldUnit<[u8; 4usize]> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
__bindgen_bitfield_unit.set(0usize, 1u8, {
let split_on_write_unit: u32 = unsafe { ::std::mem::transmute(split_on_write_unit) };
split_on_write_unit as u64
});
__bindgen_bitfield_unit.set(1usize, 1u8, {
let split_on_optimal_io_boundary: u32 =
unsafe { ::std::mem::transmute(split_on_optimal_io_boundary) };
split_on_optimal_io_boundary as u64
});
__bindgen_bitfield_unit.set(2usize, 1u8, {
let md_interleave: u32 = unsafe { ::std::mem::transmute(md_interleave) };
md_interleave as u64
});
__bindgen_bitfield_unit.set(3usize, 1u8, {
let dif_is_head_of_md: u32 = unsafe { ::std::mem::transmute(dif_is_head_of_md) };
dif_is_head_of_md as u64
});
__bindgen_bitfield_unit.set(4usize, 1u8, {
let zoned: u32 = unsafe { ::std::mem::transmute(zoned) };
zoned as u64
});
__bindgen_bitfield_unit.set(5usize, 1u8, {
let media_events: u32 = unsafe { ::std::mem::transmute(media_events) };
media_events as u64
});
__bindgen_bitfield_unit.set(6usize, 1u8, {
let memory_domains_supported: u32 =
unsafe { ::std::mem::transmute(memory_domains_supported) };
memory_domains_supported as u64
});
__bindgen_bitfield_unit.set(7usize, 25u8, {
let reserved: u32 = unsafe { ::std::mem::transmute(reserved) };
reserved as u64
});
__bindgen_bitfield_unit
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev__bindgen_ty_2 {
pub _bitfield_align_1: [u32; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev__bindgen_ty_2"][::std::mem::size_of::<spdk_bdev__bindgen_ty_2>() - 4usize];
["Alignment of spdk_bdev__bindgen_ty_2"]
[::std::mem::align_of::<spdk_bdev__bindgen_ty_2>() - 4usize];
};
impl spdk_bdev__bindgen_ty_2 {
#[inline]
pub fn id_valid(&self) -> u32 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) }
}
#[inline]
pub fn set_id_valid(&mut self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
self._bitfield_1.set(0usize, 1u8, val as u64)
}
}
#[inline]
pub unsafe fn id_valid_raw(this: *const Self) -> u32 {
unsafe {
::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
::std::ptr::addr_of!((*this)._bitfield_1),
0usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_id_valid_raw(this: *mut Self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
::std::ptr::addr_of_mut!((*this)._bitfield_1),
0usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn id(&self) -> i32 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) }
}
#[inline]
pub fn set_id(&mut self, val: i32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
self._bitfield_1.set(1usize, 31u8, val as u64)
}
}
#[inline]
pub unsafe fn id_raw(this: *const Self) -> i32 {
unsafe {
::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
::std::ptr::addr_of!((*this)._bitfield_1),
1usize,
31u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_id_raw(this: *mut Self, val: i32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
::std::ptr::addr_of_mut!((*this)._bitfield_1),
1usize,
31u8,
val as u64,
)
}
}
#[inline]
pub fn new_bitfield_1(id_valid: u32, id: i32) -> __BindgenBitfieldUnit<[u8; 4usize]> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
__bindgen_bitfield_unit.set(0usize, 1u8, {
let id_valid: u32 = unsafe { ::std::mem::transmute(id_valid) };
id_valid as u64
});
__bindgen_bitfield_unit.set(1usize, 31u8, {
let id: u32 = unsafe { ::std::mem::transmute(id) };
id as u64
});
__bindgen_bitfield_unit
}
}
#[doc = " Fields that are used internally by the bdev subsystem. Bdev modules\n must not read or write to these fields."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct spdk_bdev___bdev_internal_fields {
#[doc = " Quality of service parameters"]
pub qos: *mut spdk_bdev_qos,
#[doc = " True if the state of the QoS is being modified"]
pub qos_mod_in_progress: bool,
#[doc = " Trace ID for this bdev."]
pub trace_id: u16,
#[doc = " SPDK spinlock protecting many of the internal fields of this structure. If\n multiple locks need to be held, the following order must be used:\n g_bdev_mgr.spinlock\n bdev->internal.spinlock\n bdev_desc->spinlock\n bdev_module->internal.spinlock"]
pub spinlock: spdk_spinlock,
#[doc = " The bdev status"]
pub status: spdk_bdev_status,
#[doc = " How many bdev_examine() calls are iterating claim.v2.claims. When non-zero claims\n that are released will be cleared but remain on the claims list until\n bdev_examine() finishes. Must hold spinlock on all updates."]
pub examine_in_progress: u32,
#[doc = " The claim type: used in conjunction with claim. Must hold spinlock on all\n updates."]
pub claim_type: spdk_bdev_claim_type,
pub claim: spdk_bdev___bdev_internal_fields___bdev_internal_claim,
#[doc = " Callback function that will be called after bdev destruct is completed."]
pub unregister_cb: spdk_bdev_unregister_cb,
#[doc = " Unregister call context"]
pub unregister_ctx: *mut ::std::os::raw::c_void,
#[doc = " Thread that issued the unregister. The cb must be called on this thread."]
pub unregister_td: *mut spdk_thread,
#[doc = " List of open descriptors for this block device."]
pub open_descs: spdk_bdev___bdev_internal_fields__bindgen_ty_1,
pub link: spdk_bdev___bdev_internal_fields__bindgen_ty_2,
#[doc = " points to a reset bdev_io if one is in progress."]
pub reset_in_progress: *mut spdk_bdev_io,
#[doc = " List of reset bdev_ios that are not submitted to the underlying device."]
pub queued_resets: bdev_io_tailq_t,
#[doc = " poller for tracking the queue_depth of a device, NULL if not tracking"]
pub qd_poller: *mut spdk_poller,
#[doc = " open descriptor to use qd_poller safely"]
pub qd_desc: *mut spdk_bdev_desc,
#[doc = " period at which we poll for queue depth information"]
pub period: u64,
#[doc = " new period to be used to poll for queue depth information"]
pub new_period: u64,
#[doc = " used to aggregate queue depth while iterating across the bdev's open channels"]
pub temporary_queue_depth: u64,
#[doc = " queue depth as calculated the last time the telemetry poller checked."]
pub measured_queue_depth: u64,
#[doc = " most recent value of ticks spent performing I/O. Used to calculate the weighted time doing I/O"]
pub io_time: u64,
#[doc = " weighted time performing I/O. Equal to measured_queue_depth * period"]
pub weighted_io_time: u64,
#[doc = " accumulated I/O statistics for previously deleted channels of this bdev"]
pub stat: *mut spdk_bdev_io_stat,
#[doc = " true if tracking the queue_depth of a device is in progress"]
pub qd_poll_in_progress: bool,
#[doc = " histogram enabled on this bdev"]
pub histogram_enabled: bool,
pub histogram_in_progress: bool,
pub histogram_io_type: u8,
pub histogram_granularity: u8,
pub histogram_min_val: u64,
pub histogram_max_val: u64,
#[doc = " Currently locked ranges for this bdev. Used to populate new channels."]
pub locked_ranges: lba_range_tailq_t,
#[doc = " Pending locked ranges for this bdev. These ranges are not currently\n locked due to overlapping with another locked range."]
pub pending_locked_ranges: lba_range_tailq_t,
#[doc = " Bdev name used for quick lookup"]
pub bdev_name: spdk_bdev_name,
}
#[doc = " Which module has claimed this bdev. Must hold spinlock on all updates."]
#[repr(C)]
#[derive(Copy, Clone)]
pub union spdk_bdev___bdev_internal_fields___bdev_internal_claim {
pub v1: spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v1,
pub v2: spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v2,
}
#[doc = " Claims acquired with spdk_bdev_module_claim_bdev()"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v1 {
#[doc = " Pointer to the module that has claimed this bdev for purposes of\n creating virtual bdevs on top of it. Set to NULL and set\n claim_type to SPDK_BDEV_CLAIM_NONE if the bdev has not been\n claimed."]
pub module: *mut spdk_bdev_module,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v1"]
[::std::mem::size_of::<
spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v1,
>() - 8usize];
[
"Alignment of spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v1",
][::std::mem::align_of::<
spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v1,
>() - 8usize];
[
"Offset of field: spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v1::module",
][::std::mem::offset_of!(
spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v1,
module
) - 0usize];
};
#[doc = " Claims acquired with spdk_bdev_module_claim_bdev_desc()"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v2 {
#[doc = " The claims on this bdev"]
pub claims:
spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v2_v2_claims,
#[doc = " See spdk_bdev_claim_opts.shared_claim_key"]
pub key: u64,
}
#[doc = " The claims on this bdev"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v2_v2_claims
{
pub tqh_first: *mut spdk_bdev_module_claim,
pub tqh_last: *mut *mut spdk_bdev_module_claim,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
[
"Size of spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v2_v2_claims",
][::std::mem::size_of::<
spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v2_v2_claims,
>() - 16usize];
[
"Alignment of spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v2_v2_claims",
][::std::mem::align_of::<
spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v2_v2_claims,
>() - 8usize];
[
"Offset of field: spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v2_v2_claims::tqh_first",
][::std::mem::offset_of!(
spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v2_v2_claims,
tqh_first
) - 0usize];
[
"Offset of field: spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v2_v2_claims::tqh_last",
][::std::mem::offset_of!(
spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v2_v2_claims,
tqh_last
) - 8usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v2"]
[::std::mem::size_of::<
spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v2,
>() - 24usize];
[
"Alignment of spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v2",
][::std::mem::align_of::<
spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v2,
>() - 8usize];
[
"Offset of field: spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v2::claims",
][::std::mem::offset_of!(
spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v2,
claims
) - 0usize];
[
"Offset of field: spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v2::key",
][::std::mem::offset_of!(
spdk_bdev___bdev_internal_fields___bdev_internal_claim___bdev_internal_claim_v2,
key
) - 16usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev___bdev_internal_fields___bdev_internal_claim"]
[::std::mem::size_of::<spdk_bdev___bdev_internal_fields___bdev_internal_claim>() - 24usize];
["Alignment of spdk_bdev___bdev_internal_fields___bdev_internal_claim"]
[::std::mem::align_of::<spdk_bdev___bdev_internal_fields___bdev_internal_claim>() - 8usize];
["Offset of field: spdk_bdev___bdev_internal_fields___bdev_internal_claim::v1"][::std::mem::offset_of!(
spdk_bdev___bdev_internal_fields___bdev_internal_claim,
v1
) - 0usize];
["Offset of field: spdk_bdev___bdev_internal_fields___bdev_internal_claim::v2"][::std::mem::offset_of!(
spdk_bdev___bdev_internal_fields___bdev_internal_claim,
v2
) - 0usize];
};
#[doc = " List of open descriptors for this block device."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev___bdev_internal_fields__bindgen_ty_1 {
pub tqh_first: *mut spdk_bdev_desc,
pub tqh_last: *mut *mut spdk_bdev_desc,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev___bdev_internal_fields__bindgen_ty_1"]
[::std::mem::size_of::<spdk_bdev___bdev_internal_fields__bindgen_ty_1>() - 16usize];
["Alignment of spdk_bdev___bdev_internal_fields__bindgen_ty_1"]
[::std::mem::align_of::<spdk_bdev___bdev_internal_fields__bindgen_ty_1>() - 8usize];
["Offset of field: spdk_bdev___bdev_internal_fields__bindgen_ty_1::tqh_first"][::std::mem::offset_of!(
spdk_bdev___bdev_internal_fields__bindgen_ty_1,
tqh_first
) - 0usize];
["Offset of field: spdk_bdev___bdev_internal_fields__bindgen_ty_1::tqh_last"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields__bindgen_ty_1, tqh_last) - 8usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev___bdev_internal_fields__bindgen_ty_2 {
pub tqe_next: *mut spdk_bdev,
pub tqe_prev: *mut *mut spdk_bdev,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev___bdev_internal_fields__bindgen_ty_2"]
[::std::mem::size_of::<spdk_bdev___bdev_internal_fields__bindgen_ty_2>() - 16usize];
["Alignment of spdk_bdev___bdev_internal_fields__bindgen_ty_2"]
[::std::mem::align_of::<spdk_bdev___bdev_internal_fields__bindgen_ty_2>() - 8usize];
["Offset of field: spdk_bdev___bdev_internal_fields__bindgen_ty_2::tqe_next"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields__bindgen_ty_2, tqe_next) - 0usize];
["Offset of field: spdk_bdev___bdev_internal_fields__bindgen_ty_2::tqe_prev"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields__bindgen_ty_2, tqe_prev) - 8usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev___bdev_internal_fields"]
[::std::mem::size_of::<spdk_bdev___bdev_internal_fields>() - 336usize];
["Alignment of spdk_bdev___bdev_internal_fields"]
[::std::mem::align_of::<spdk_bdev___bdev_internal_fields>() - 8usize];
["Offset of field: spdk_bdev___bdev_internal_fields::qos"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, qos) - 0usize];
["Offset of field: spdk_bdev___bdev_internal_fields::qos_mod_in_progress"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, qos_mod_in_progress) - 8usize];
["Offset of field: spdk_bdev___bdev_internal_fields::trace_id"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, trace_id) - 10usize];
["Offset of field: spdk_bdev___bdev_internal_fields::spinlock"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, spinlock) - 16usize];
["Offset of field: spdk_bdev___bdev_internal_fields::status"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, status) - 48usize];
["Offset of field: spdk_bdev___bdev_internal_fields::examine_in_progress"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, examine_in_progress) - 52usize];
["Offset of field: spdk_bdev___bdev_internal_fields::claim_type"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, claim_type) - 56usize];
["Offset of field: spdk_bdev___bdev_internal_fields::claim"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, claim) - 64usize];
["Offset of field: spdk_bdev___bdev_internal_fields::unregister_cb"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, unregister_cb) - 88usize];
["Offset of field: spdk_bdev___bdev_internal_fields::unregister_ctx"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, unregister_ctx) - 96usize];
["Offset of field: spdk_bdev___bdev_internal_fields::unregister_td"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, unregister_td) - 104usize];
["Offset of field: spdk_bdev___bdev_internal_fields::open_descs"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, open_descs) - 112usize];
["Offset of field: spdk_bdev___bdev_internal_fields::link"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, link) - 128usize];
["Offset of field: spdk_bdev___bdev_internal_fields::reset_in_progress"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, reset_in_progress) - 144usize];
["Offset of field: spdk_bdev___bdev_internal_fields::queued_resets"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, queued_resets) - 152usize];
["Offset of field: spdk_bdev___bdev_internal_fields::qd_poller"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, qd_poller) - 168usize];
["Offset of field: spdk_bdev___bdev_internal_fields::qd_desc"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, qd_desc) - 176usize];
["Offset of field: spdk_bdev___bdev_internal_fields::period"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, period) - 184usize];
["Offset of field: spdk_bdev___bdev_internal_fields::new_period"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, new_period) - 192usize];
["Offset of field: spdk_bdev___bdev_internal_fields::temporary_queue_depth"][::std::mem::offset_of!(
spdk_bdev___bdev_internal_fields,
temporary_queue_depth
) - 200usize];
["Offset of field: spdk_bdev___bdev_internal_fields::measured_queue_depth"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, measured_queue_depth) - 208usize];
["Offset of field: spdk_bdev___bdev_internal_fields::io_time"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, io_time) - 216usize];
["Offset of field: spdk_bdev___bdev_internal_fields::weighted_io_time"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, weighted_io_time) - 224usize];
["Offset of field: spdk_bdev___bdev_internal_fields::stat"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, stat) - 232usize];
["Offset of field: spdk_bdev___bdev_internal_fields::qd_poll_in_progress"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, qd_poll_in_progress) - 240usize];
["Offset of field: spdk_bdev___bdev_internal_fields::histogram_enabled"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, histogram_enabled) - 241usize];
["Offset of field: spdk_bdev___bdev_internal_fields::histogram_in_progress"][::std::mem::offset_of!(
spdk_bdev___bdev_internal_fields,
histogram_in_progress
) - 242usize];
["Offset of field: spdk_bdev___bdev_internal_fields::histogram_io_type"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, histogram_io_type) - 243usize];
["Offset of field: spdk_bdev___bdev_internal_fields::histogram_granularity"][::std::mem::offset_of!(
spdk_bdev___bdev_internal_fields,
histogram_granularity
) - 244usize];
["Offset of field: spdk_bdev___bdev_internal_fields::histogram_min_val"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, histogram_min_val) - 248usize];
["Offset of field: spdk_bdev___bdev_internal_fields::histogram_max_val"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, histogram_max_val) - 256usize];
["Offset of field: spdk_bdev___bdev_internal_fields::locked_ranges"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, locked_ranges) - 264usize];
["Offset of field: spdk_bdev___bdev_internal_fields::pending_locked_ranges"][::std::mem::offset_of!(
spdk_bdev___bdev_internal_fields,
pending_locked_ranges
) - 280usize];
["Offset of field: spdk_bdev___bdev_internal_fields::bdev_name"]
[::std::mem::offset_of!(spdk_bdev___bdev_internal_fields, bdev_name) - 296usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev"][::std::mem::size_of::<spdk_bdev>() - 576usize];
["Alignment of spdk_bdev"][::std::mem::align_of::<spdk_bdev>() - 8usize];
};
#[repr(C)]
#[repr(align(8))]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_io_block_params {
pub _bindgen_opaque_blob: [u64; 27usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_io_block_params__bindgen_ty_1 {
pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_io_block_params__bindgen_ty_1"]
[::std::mem::size_of::<spdk_bdev_io_block_params__bindgen_ty_1>() - 1usize];
["Alignment of spdk_bdev_io_block_params__bindgen_ty_1"]
[::std::mem::align_of::<spdk_bdev_io_block_params__bindgen_ty_1>() - 1usize];
};
impl spdk_bdev_io_block_params__bindgen_ty_1 {
#[inline]
pub fn populate(&self) -> u8 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
}
#[inline]
pub fn set_populate(&mut self, val: u8) {
unsafe {
let val: u8 = ::std::mem::transmute(val);
self._bitfield_1.set(0usize, 1u8, val as u64)
}
}
#[inline]
pub unsafe fn populate_raw(this: *const Self) -> u8 {
unsafe {
::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
::std::ptr::addr_of!((*this)._bitfield_1),
0usize,
1u8,
) as u8)
}
}
#[inline]
pub unsafe fn set_populate_raw(this: *mut Self, val: u8) {
unsafe {
let val: u8 = ::std::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
::std::ptr::addr_of_mut!((*this)._bitfield_1),
0usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn commit(&self) -> u8 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
}
#[inline]
pub fn set_commit(&mut self, val: u8) {
unsafe {
let val: u8 = ::std::mem::transmute(val);
self._bitfield_1.set(1usize, 1u8, val as u64)
}
}
#[inline]
pub unsafe fn commit_raw(this: *const Self) -> u8 {
unsafe {
::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
::std::ptr::addr_of!((*this)._bitfield_1),
1usize,
1u8,
) as u8)
}
}
#[inline]
pub unsafe fn set_commit_raw(this: *mut Self, val: u8) {
unsafe {
let val: u8 = ::std::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
::std::ptr::addr_of_mut!((*this)._bitfield_1),
1usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn start(&self) -> u8 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
}
#[inline]
pub fn set_start(&mut self, val: u8) {
unsafe {
let val: u8 = ::std::mem::transmute(val);
self._bitfield_1.set(2usize, 1u8, val as u64)
}
}
#[inline]
pub unsafe fn start_raw(this: *const Self) -> u8 {
unsafe {
::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
::std::ptr::addr_of!((*this)._bitfield_1),
2usize,
1u8,
) as u8)
}
}
#[inline]
pub unsafe fn set_start_raw(this: *mut Self, val: u8) {
unsafe {
let val: u8 = ::std::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
::std::ptr::addr_of_mut!((*this)._bitfield_1),
2usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn new_bitfield_1(
populate: u8,
commit: u8,
start: u8,
) -> __BindgenBitfieldUnit<[u8; 1usize]> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
__bindgen_bitfield_unit.set(0usize, 1u8, {
let populate: u8 = unsafe { ::std::mem::transmute(populate) };
populate as u64
});
__bindgen_bitfield_unit.set(1usize, 1u8, {
let commit: u8 = unsafe { ::std::mem::transmute(commit) };
commit as u64
});
__bindgen_bitfield_unit.set(2usize, 1u8, {
let start: u8 = unsafe { ::std::mem::transmute(start) };
start as u64
});
__bindgen_bitfield_unit
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_io_block_params__bindgen_ty_2 {
#[doc = " The callback argument for the outstanding request which this abort\n attempts to cancel."]
pub bio_cb_arg: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_io_block_params__bindgen_ty_2"]
[::std::mem::size_of::<spdk_bdev_io_block_params__bindgen_ty_2>() - 8usize];
["Alignment of spdk_bdev_io_block_params__bindgen_ty_2"]
[::std::mem::align_of::<spdk_bdev_io_block_params__bindgen_ty_2>() - 8usize];
["Offset of field: spdk_bdev_io_block_params__bindgen_ty_2::bio_cb_arg"]
[::std::mem::offset_of!(spdk_bdev_io_block_params__bindgen_ty_2, bio_cb_arg) - 0usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_io_block_params__bindgen_ty_3 {
#[doc = " The offset of next data/hole."]
pub offset: u64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_io_block_params__bindgen_ty_3"]
[::std::mem::size_of::<spdk_bdev_io_block_params__bindgen_ty_3>() - 8usize];
["Alignment of spdk_bdev_io_block_params__bindgen_ty_3"]
[::std::mem::align_of::<spdk_bdev_io_block_params__bindgen_ty_3>() - 8usize];
["Offset of field: spdk_bdev_io_block_params__bindgen_ty_3::offset"]
[::std::mem::offset_of!(spdk_bdev_io_block_params__bindgen_ty_3, offset) - 0usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_io_block_params__bindgen_ty_4 {
#[doc = " Starting source offset (in blocks) of the bdev for copy I/O."]
pub src_offset_blocks: u64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_io_block_params__bindgen_ty_4"]
[::std::mem::size_of::<spdk_bdev_io_block_params__bindgen_ty_4>() - 8usize];
["Alignment of spdk_bdev_io_block_params__bindgen_ty_4"]
[::std::mem::align_of::<spdk_bdev_io_block_params__bindgen_ty_4>() - 8usize];
["Offset of field: spdk_bdev_io_block_params__bindgen_ty_4::src_offset_blocks"][::std::mem::offset_of!(
spdk_bdev_io_block_params__bindgen_ty_4,
src_offset_blocks
) - 0usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_io_block_params"]
[::std::mem::size_of::<spdk_bdev_io_block_params>() - 216usize];
["Alignment of spdk_bdev_io_block_params"]
[::std::mem::align_of::<spdk_bdev_io_block_params>() - 8usize];
};
#[repr(C)]
#[repr(align(8))]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_io_reset_params {
pub _bindgen_opaque_blob: [u64; 3usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_io_reset_params__bindgen_ty_1 {
pub poller: *mut spdk_poller,
pub stop_time_tsc: u64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_io_reset_params__bindgen_ty_1"]
[::std::mem::size_of::<spdk_bdev_io_reset_params__bindgen_ty_1>() - 16usize];
["Alignment of spdk_bdev_io_reset_params__bindgen_ty_1"]
[::std::mem::align_of::<spdk_bdev_io_reset_params__bindgen_ty_1>() - 8usize];
["Offset of field: spdk_bdev_io_reset_params__bindgen_ty_1::poller"]
[::std::mem::offset_of!(spdk_bdev_io_reset_params__bindgen_ty_1, poller) - 0usize];
["Offset of field: spdk_bdev_io_reset_params__bindgen_ty_1::stop_time_tsc"]
[::std::mem::offset_of!(spdk_bdev_io_reset_params__bindgen_ty_1, stop_time_tsc) - 8usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_io_reset_params"]
[::std::mem::size_of::<spdk_bdev_io_reset_params>() - 24usize];
["Alignment of spdk_bdev_io_reset_params"]
[::std::mem::align_of::<spdk_bdev_io_reset_params>() - 8usize];
};
#[repr(C)]
#[repr(align(8))]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_io_abort_params {
pub _bindgen_opaque_blob: u64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_io_abort_params"]
[::std::mem::size_of::<spdk_bdev_io_abort_params>() - 8usize];
["Alignment of spdk_bdev_io_abort_params"]
[::std::mem::align_of::<spdk_bdev_io_abort_params>() - 8usize];
};
#[repr(C)]
#[repr(align(8))]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_io_nvme_passthru_params {
pub _bindgen_opaque_blob: [u64; 14usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_io_nvme_passthru_params"]
[::std::mem::size_of::<spdk_bdev_io_nvme_passthru_params>() - 112usize];
["Alignment of spdk_bdev_io_nvme_passthru_params"]
[::std::mem::align_of::<spdk_bdev_io_nvme_passthru_params>() - 8usize];
};
#[repr(C)]
#[repr(align(8))]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_io_zone_mgmt_params {
pub _bindgen_opaque_blob: [u64; 3usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_io_zone_mgmt_params"]
[::std::mem::size_of::<spdk_bdev_io_zone_mgmt_params>() - 24usize];
["Alignment of spdk_bdev_io_zone_mgmt_params"]
[::std::mem::align_of::<spdk_bdev_io_zone_mgmt_params>() - 8usize];
};
#[doc = " Block device I/O\n\n This is an I/O that is passed to an spdk_bdev."]
#[repr(C)]
#[repr(align(8))]
pub struct spdk_bdev_io {
pub _bindgen_opaque_blob: [u64; 152usize],
}
#[doc = " Parameters filled in by the user"]
#[repr(C)]
#[derive(Copy, Clone)]
pub union spdk_bdev_io__bindgen_ty_1 {
pub bdev: spdk_bdev_io_block_params,
pub reset: spdk_bdev_io_reset_params,
pub abort: spdk_bdev_io_abort_params,
pub nvme_passthru: spdk_bdev_io_nvme_passthru_params,
pub zone_mgmt: spdk_bdev_io_zone_mgmt_params,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_io__bindgen_ty_1"]
[::std::mem::size_of::<spdk_bdev_io__bindgen_ty_1>() - 216usize];
["Alignment of spdk_bdev_io__bindgen_ty_1"]
[::std::mem::align_of::<spdk_bdev_io__bindgen_ty_1>() - 8usize];
["Offset of field: spdk_bdev_io__bindgen_ty_1::bdev"]
[::std::mem::offset_of!(spdk_bdev_io__bindgen_ty_1, bdev) - 0usize];
["Offset of field: spdk_bdev_io__bindgen_ty_1::reset"]
[::std::mem::offset_of!(spdk_bdev_io__bindgen_ty_1, reset) - 0usize];
["Offset of field: spdk_bdev_io__bindgen_ty_1::abort"]
[::std::mem::offset_of!(spdk_bdev_io__bindgen_ty_1, abort) - 0usize];
["Offset of field: spdk_bdev_io__bindgen_ty_1::nvme_passthru"]
[::std::mem::offset_of!(spdk_bdev_io__bindgen_ty_1, nvme_passthru) - 0usize];
["Offset of field: spdk_bdev_io__bindgen_ty_1::zone_mgmt"]
[::std::mem::offset_of!(spdk_bdev_io__bindgen_ty_1, zone_mgmt) - 0usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of spdk_bdev_io"][::std::mem::size_of::<spdk_bdev_io>() - 1216usize];
["Alignment of spdk_bdev_io"][::std::mem::align_of::<spdk_bdev_io>() - 8usize];
};
unsafe extern "C" {
#[doc = " Complete a bdev_io\n\n \\param bdev_io I/O to complete.\n \\param status The I/O completion status."]
pub fn spdk_bdev_io_complete(bdev_io: *mut spdk_bdev_io, status: spdk_bdev_io_status);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct SpdkBdevOptsC {
pub blocklen: u32,
pub blockcnt: u64,
pub write_cache: bool,
pub phys_blocklen: u32,
pub split_on_write_unit: u32,
pub split_on_optimal_io_boundary: u32,
pub md_interleave: u32,
pub dif_is_head_of_md: u32,
pub write_unit_size: u32,
pub optimal_io_boundary: u32,
pub preferred_write_alignment: u32,
pub preferred_write_granularity: u32,
pub optimal_write_size: u32,
pub preferred_unmap_alignment: u32,
pub preferred_unmap_granularity: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of SpdkBdevOptsC"][::std::mem::size_of::<SpdkBdevOptsC>() - 72usize];
["Alignment of SpdkBdevOptsC"][::std::mem::align_of::<SpdkBdevOptsC>() - 8usize];
["Offset of field: SpdkBdevOptsC::blocklen"]
[::std::mem::offset_of!(SpdkBdevOptsC, blocklen) - 0usize];
["Offset of field: SpdkBdevOptsC::blockcnt"]
[::std::mem::offset_of!(SpdkBdevOptsC, blockcnt) - 8usize];
["Offset of field: SpdkBdevOptsC::write_cache"]
[::std::mem::offset_of!(SpdkBdevOptsC, write_cache) - 16usize];
["Offset of field: SpdkBdevOptsC::phys_blocklen"]
[::std::mem::offset_of!(SpdkBdevOptsC, phys_blocklen) - 20usize];
["Offset of field: SpdkBdevOptsC::split_on_write_unit"]
[::std::mem::offset_of!(SpdkBdevOptsC, split_on_write_unit) - 24usize];
["Offset of field: SpdkBdevOptsC::split_on_optimal_io_boundary"]
[::std::mem::offset_of!(SpdkBdevOptsC, split_on_optimal_io_boundary) - 28usize];
["Offset of field: SpdkBdevOptsC::md_interleave"]
[::std::mem::offset_of!(SpdkBdevOptsC, md_interleave) - 32usize];
["Offset of field: SpdkBdevOptsC::dif_is_head_of_md"]
[::std::mem::offset_of!(SpdkBdevOptsC, dif_is_head_of_md) - 36usize];
["Offset of field: SpdkBdevOptsC::write_unit_size"]
[::std::mem::offset_of!(SpdkBdevOptsC, write_unit_size) - 40usize];
["Offset of field: SpdkBdevOptsC::optimal_io_boundary"]
[::std::mem::offset_of!(SpdkBdevOptsC, optimal_io_boundary) - 44usize];
["Offset of field: SpdkBdevOptsC::preferred_write_alignment"]
[::std::mem::offset_of!(SpdkBdevOptsC, preferred_write_alignment) - 48usize];
["Offset of field: SpdkBdevOptsC::preferred_write_granularity"]
[::std::mem::offset_of!(SpdkBdevOptsC, preferred_write_granularity) - 52usize];
["Offset of field: SpdkBdevOptsC::optimal_write_size"]
[::std::mem::offset_of!(SpdkBdevOptsC, optimal_write_size) - 56usize];
["Offset of field: SpdkBdevOptsC::preferred_unmap_alignment"]
[::std::mem::offset_of!(SpdkBdevOptsC, preferred_unmap_alignment) - 60usize];
["Offset of field: SpdkBdevOptsC::preferred_unmap_granularity"]
[::std::mem::offset_of!(SpdkBdevOptsC, preferred_unmap_granularity) - 64usize];
};
unsafe extern "C" {
pub fn u_bdev_open(
bdev_name: *const ::std::os::raw::c_char,
write: bool,
desc: *mut *mut spdk_bdev_desc,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn u_bdev_destruct(ctx: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn u_bdev_submit_request(ch: *mut spdk_io_channel, bdev_io: *mut spdk_bdev_io);
}
unsafe extern "C" {
pub fn u_bdev_io_type_supported(
ctx: *mut ::std::os::raw::c_void,
io_type: spdk_bdev_io_type,
) -> bool;
}
unsafe extern "C" {
pub fn u_bdev_get_io_channel(ctx: *mut ::std::os::raw::c_void) -> *mut spdk_io_channel;
}
unsafe extern "C" {
pub fn u_bdev_alloc(
name: *const ::std::os::raw::c_char,
opts: *const SpdkBdevOptsC,
bdevctx: *mut ::std::os::raw::c_void,
) -> *mut spdk_bdev;
}
unsafe extern "C" {
pub fn u_bdev_register(
name: *const ::std::os::raw::c_char,
bdev: *mut spdk_bdev,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn u_spdk_bdev_delete_by_name(name: *const ::std::os::raw::c_char)
-> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn u_io_channel_get_rust_ctx(
io_ch_ctx: *mut ::std::os::raw::c_void,
) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
pub fn u_json_object_len(obj: *const spdk_json_val) -> usize;
}
unsafe extern "C" {
pub fn u_json_val_name(obj: *const spdk_json_val, i: usize) -> *const spdk_json_val;
}
unsafe extern "C" {
pub fn u_json_val_val(obj: *const spdk_json_val, i: usize) -> *const spdk_json_val;
}
unsafe extern "C" {
pub fn u_json_val_len(val: *const spdk_json_val) -> usize;
}
unsafe extern "C" {
pub fn u_json_val_str_ptr(val: *const spdk_json_val) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
pub fn u_json_val_str_len(val: *const spdk_json_val) -> usize;
}
unsafe extern "C" {
pub fn u_spdk_app_opts_init(opts: *mut spdk_app_opts, name: *const ::std::os::raw::c_char);
}
unsafe extern "C" {
pub fn u_spdk_app_opts_size() -> usize;
}
unsafe extern "C" {
pub fn u_spdk_app_parse_args(
argc: ::std::os::raw::c_int,
argv: *mut *mut ::std::os::raw::c_char,
opts: *mut spdk_app_opts,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn u_spdk_app_set_shutdown_cb(opts: *mut spdk_app_opts, cb: spdk_app_shutdown_cb);
}
unsafe extern "C" {
pub fn u_spdk_app_start(
opts: *mut spdk_app_opts,
start_fn: spdk_msg_fn,
arg: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn u_spdk_app_stop(rc: ::std::os::raw::c_int);
}
unsafe extern "C" {
pub fn u_spdk_cpuset_alloc() -> *mut spdk_cpuset;
}
unsafe extern "C" {
pub fn u_spdk_cpuset_free(set: *mut spdk_cpuset);
}
unsafe extern "C" {
pub fn u_spdk_io_channel_get_ctx(ch: *mut spdk_io_channel) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
pub fn u_bdev_io_get_type(io: *mut spdk_bdev_io) -> ::std::os::raw::c_uint;
}
unsafe extern "C" {
pub fn u_bdev_io_get_offset_blocks(io: *mut spdk_bdev_io) -> u64;
}
unsafe extern "C" {
pub fn u_bdev_io_get_num_blocks(io: *mut spdk_bdev_io) -> u64;
}
unsafe extern "C" {
pub fn u_bdev_io_get_iovec(
bdev_io: *mut spdk_bdev_io,
iovp: *mut *mut iovec,
iovcntp: *mut ::std::os::raw::c_int,
);
}
unsafe extern "C" {
pub fn u_bdev_io_get_bdev(io: *const spdk_bdev_io) -> *mut spdk_bdev;
}
unsafe extern "C" {
pub fn u_bdev_get_blocklen(bdev: *mut spdk_bdev) -> u32;
}
unsafe extern "C" {
pub fn u_bdev_get_blockcnt(bdev: *mut spdk_bdev) -> u64;
}
unsafe extern "C" {
pub fn rsu_io_channel_create(
bdev_ctxt: *mut ::std::os::raw::c_void,
) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
pub fn rsu_io_channel_destroy(io_ch_ctxt: *mut ::std::os::raw::c_void);
}
unsafe extern "C" {
pub fn rsu_bdev_ctx_set_spdk_bdev(ctx: *mut ::std::os::raw::c_void, bdev: *mut spdk_bdev);
}
unsafe extern "C" {
pub fn rsu_bdev_ctx_get_spdk_bdev(ctx: *mut ::std::os::raw::c_void) -> *mut spdk_bdev;
}
unsafe extern "C" {
pub fn rsu_bdev_ctx_drop(ctx: *mut ::std::os::raw::c_void);
}
unsafe extern "C" {
pub fn rsu_bdev_io_type_supported(
ctxt: *mut ::std::os::raw::c_void,
io_type: spdk_bdev_io_type,
) -> bool;
}
unsafe extern "C" {
pub fn rsu_bdev_init(bdev_ctxt: *mut ::std::os::raw::c_void);
}
unsafe extern "C" {
pub fn rsu_bdev_submit_request(
bdev_ctxt: *mut ::std::os::raw::c_void,
ch: *mut spdk_io_channel,
io: *mut spdk_bdev_io,
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct lba_range {
pub _address: u8,
}
#[doc = " Quality of service parameters"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spdk_bdev_qos {
pub _address: u8,
}