Functions | |
int | spdk_bdev_seek_data (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, uint64_t offset_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a data seek request to the bdev on the given channel. | |
int | spdk_bdev_seek_hole (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, uint64_t offset_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a hole seek request to the bdev on the given channel. | |
int | spdk_bdev_read (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, void *buf, uint64_t offset, uint64_t nbytes, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a read request to the bdev on the given channel. | |
int | spdk_bdev_read_blocks (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, void *buf, uint64_t offset_blocks, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a read request to the bdev on the given channel. | |
int | spdk_bdev_read_blocks_with_md (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, void *buf, void *md, uint64_t offset_blocks, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a read request to the bdev on the given channel. | |
int | spdk_bdev_readv (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, struct iovec *iov, int iovcnt, uint64_t offset, uint64_t nbytes, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a read request to the bdev on the given channel. | |
int | spdk_bdev_readv_blocks (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, struct iovec *iov, int iovcnt, uint64_t offset_blocks, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a read request to the bdev on the given channel. | |
int | spdk_bdev_readv_blocks_with_md (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, struct iovec *iov, int iovcnt, void *md, uint64_t offset_blocks, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a read request to the bdev on the given channel. | |
int | spdk_bdev_readv_blocks_ext (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, struct iovec *iov, int iovcnt, uint64_t offset_blocks, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg, struct spdk_bdev_ext_io_opts *opts) |
Submit a read request to the bdev on the given channel. | |
int | spdk_bdev_write (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, void *buf, uint64_t offset, uint64_t nbytes, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a write request to the bdev on the given channel. | |
int | spdk_bdev_write_blocks (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, void *buf, uint64_t offset_blocks, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a write request to the bdev on the given channel. | |
int | spdk_bdev_write_blocks_with_md (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, void *buf, void *md, uint64_t offset_blocks, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a write request to the bdev on the given channel. | |
int | spdk_bdev_writev (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, struct iovec *iov, int iovcnt, uint64_t offset, uint64_t len, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a write request to the bdev on the given channel. | |
int | spdk_bdev_writev_blocks (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, struct iovec *iov, int iovcnt, uint64_t offset_blocks, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a write request to the bdev on the given channel. | |
int | spdk_bdev_writev_blocks_with_md (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, struct iovec *iov, int iovcnt, void *md, uint64_t offset_blocks, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a write request to the bdev on the given channel. | |
int | spdk_bdev_writev_blocks_ext (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, struct iovec *iov, int iovcnt, uint64_t offset_blocks, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg, struct spdk_bdev_ext_io_opts *opts) |
Submit a write request to the bdev on the given channel. | |
int | spdk_bdev_compare_blocks (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, void *buf, uint64_t offset_blocks, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a compare request to the bdev on the given channel. | |
int | spdk_bdev_compare_blocks_with_md (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, void *buf, void *md, uint64_t offset_blocks, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a compare request to the bdev on the given channel. | |
int | spdk_bdev_comparev_blocks (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, struct iovec *iov, int iovcnt, uint64_t offset_blocks, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a compare request to the bdev on the given channel. | |
int | spdk_bdev_comparev_blocks_with_md (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, struct iovec *iov, int iovcnt, void *md, uint64_t offset_blocks, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a compare request to the bdev on the given channel. | |
int | spdk_bdev_comparev_and_writev_blocks (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, struct iovec *compare_iov, int compare_iovcnt, struct iovec *write_iov, int write_iovcnt, uint64_t offset_blocks, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit an atomic compare-and-write request to the bdev on the given channel. | |
int | spdk_bdev_write_zeroes (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, uint64_t offset, uint64_t len, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a write zeroes request to the bdev on the given channel. | |
int | spdk_bdev_write_zeroes_blocks (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, uint64_t offset_blocks, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a write zeroes request to the bdev on the given channel. | |
int | spdk_bdev_unmap (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, uint64_t offset, uint64_t nbytes, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit an unmap request to the block device. | |
int | spdk_bdev_unmap_blocks (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, uint64_t offset_blocks, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit an unmap request to the block device. | |
int | spdk_bdev_flush (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, uint64_t offset, uint64_t length, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a flush request to the bdev on the given channel. | |
int | spdk_bdev_flush_blocks (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, uint64_t offset_blocks, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a flush request to the bdev on the given channel. | |
int | spdk_bdev_reset (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a reset request to the bdev on the given channel. | |
int | spdk_bdev_abort (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, void *bio_cb_arg, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit abort requests to abort all I/Os which has bio_cb_arg as its callback context to the bdev on the given channel. | |
int | spdk_bdev_nvme_admin_passthru (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, const struct spdk_nvme_cmd *cmd, void *buf, size_t nbytes, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit an NVMe Admin command to the bdev. | |
int | spdk_bdev_nvme_io_passthru (struct spdk_bdev_desc *bdev_desc, struct spdk_io_channel *ch, const struct spdk_nvme_cmd *cmd, void *buf, size_t nbytes, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit an NVMe I/O command to the bdev. | |
int | spdk_bdev_nvme_io_passthru_md (struct spdk_bdev_desc *bdev_desc, struct spdk_io_channel *ch, const struct spdk_nvme_cmd *cmd, void *buf, size_t nbytes, void *md_buf, size_t md_len, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit an NVMe I/O command to the bdev. | |
int | spdk_bdev_nvme_iov_passthru_md (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, const struct spdk_nvme_cmd *cmd, struct iovec *iov, int iovcnt, size_t nbytes, void *md_buf, size_t md_len, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit an NVMe I/O command to the bdev. | |
int | spdk_bdev_copy_blocks (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, uint64_t dst_offset_blocks, uint64_t src_offset_blocks, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a copy request to the block device. | |
int | spdk_bdev_get_zone_info (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, uint64_t zone_id, size_t num_zones, struct spdk_bdev_zone_info *info, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a get_zone_info request to the bdev. | |
int | spdk_bdev_zone_management (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, uint64_t zone_id, enum spdk_bdev_zone_action action, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a zone_management request to the bdev. | |
int | spdk_bdev_zone_append (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, void *buf, uint64_t zone_id, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a zone_append request to the bdev. | |
int | spdk_bdev_zone_appendv (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, struct iovec *iov, int iovcnt, uint64_t zone_id, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a zone_append request to the bdev. | |
int | spdk_bdev_zone_append_with_md (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, void *buf, void *md, uint64_t zone_id, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a zone_append request with metadata to the bdev. | |
int | spdk_bdev_zone_appendv_with_md (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, struct iovec *iov, int iovcnt, void *md, uint64_t zone_id, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg) |
Submit a zone_append request with metadata to the bdev. | |
These functions submit a new I/O request to a bdev. The I/O request will be represented by an spdk_bdev_io structure allocated from a global pool. These functions will return -ENOMEM if the spdk_bdev_io pool is empty.
int spdk_bdev_abort | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
void * | bio_cb_arg, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit abort requests to abort all I/Os which has bio_cb_arg as its callback context to the bdev on the given channel.
This goes all the way down to the bdev driver module and attempts to abort all I/Os which have bio_cb_arg as their callback context if they exist. This is a best effort command. Upon completion of this, the status SPDK_BDEV_IO_STATUS_SUCCESS indicates all the I/Os were successfully aborted, or the status SPDK_BDEV_IO_STATUS_FAILED indicates any I/O was failed to abort for any reason or no I/O which has bio_cb_arg as its callback context was found.
desc | Block device descriptor. |
ch | The I/O channel which the I/Os to be aborted are associated with. |
bio_cb_arg | Callback argument for the outstanding requests which this function attempts to abort. |
cb | Called when the abort request is completed. |
cb_arg | Argument passed to cb. |
int spdk_bdev_compare_blocks | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
void * | buf, | ||
uint64_t | offset_blocks, | ||
uint64_t | num_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a compare request to the bdev on the given channel.
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
buf | Data buffer to compare to. |
offset_blocks | The offset, in blocks, from the start of the block device. |
num_blocks | The number of blocks to compare. buf must be greater than or equal to this size. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_compare_blocks_with_md | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
void * | buf, | ||
void * | md, | ||
uint64_t | offset_blocks, | ||
uint64_t | num_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a compare request to the bdev on the given channel.
This function uses separate buffer for metadata transfer (valid only if bdev supports this mode).
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
buf | Data buffer to compare to. |
md | Metadata buffer. |
offset_blocks | The offset, in blocks, from the start of the block device. |
num_blocks | The number of blocks to compare. buf must be greater than or equal to this size. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_comparev_and_writev_blocks | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
struct iovec * | compare_iov, | ||
int | compare_iovcnt, | ||
struct iovec * | write_iov, | ||
int | write_iovcnt, | ||
uint64_t | offset_blocks, | ||
uint64_t | num_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit an atomic compare-and-write request to the bdev on the given channel.
For bdevs that do not natively support atomic compare-and-write, the bdev layer will quiesce I/O to the specified LBA range, before performing the read, compare and write operations.
Currently this supports compare-and-write of only one block.
The data buffers for both the compare and write operations are described in a scatter gather list. Some physical devices place memory alignment requirements on data and may not be able to directly transfer out of the buffers provided. In this case, the request may fail.
spdk_bdev_io_get_nvme_fused_status() function should be called in callback function to get status for the individual operation.
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
compare_iov | A scatter gather list of buffers to be compared. |
compare_iovcnt | The number of elements in compare_iov. |
write_iov | A scatter gather list of buffers to be written if the compare is successful. |
write_iovcnt | The number of elements in write_iov. |
offset_blocks | The offset, in blocks, from the start of the block device. |
num_blocks | The number of blocks to compare-and-write. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_comparev_blocks | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
struct iovec * | iov, | ||
int | iovcnt, | ||
uint64_t | offset_blocks, | ||
uint64_t | num_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a compare request to the bdev on the given channel.
This differs from spdk_bdev_compare by allowing the data buffer to be described in a scatter gather list. Some physical devices place memory alignment requirements on data and may not be able to directly transfer out of the buffers provided. In this case, the request may fail.
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
iov | A scatter gather list of buffers to be compared to. |
iovcnt | The number of elements in iov. |
offset_blocks | The offset, in blocks, from the start of the block device. |
num_blocks | The number of blocks to compare. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_comparev_blocks_with_md | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
struct iovec * | iov, | ||
int | iovcnt, | ||
void * | md, | ||
uint64_t | offset_blocks, | ||
uint64_t | num_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a compare request to the bdev on the given channel.
This differs from spdk_bdev_compare by allowing the data buffer to be described in a scatter gather list. Some physical devices place memory alignment requirements on data or metadata and may not be able to directly transfer out of the buffers provided. In this case, the request may fail. This function uses separate buffer for metadata transfer (valid only if bdev supports this mode).
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
iov | A scatter gather list of buffers to be compared to. |
iovcnt | The number of elements in iov. |
md | Metadata buffer. |
offset_blocks | The offset, in blocks, from the start of the block device. |
num_blocks | The number of blocks to compare. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_copy_blocks | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | dst_offset_blocks, | ||
uint64_t | src_offset_blocks, | ||
uint64_t | num_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a copy request to the block device.
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
dst_offset_blocks | The destination offset, in blocks, from the start of the block device. |
src_offset_blocks | The source offset, in blocks, from the start of the block device. |
num_blocks | The number of blocks to copy. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_flush | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | offset, | ||
uint64_t | length, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a flush request to the bdev on the given channel.
For devices with volatile caches, data is not guaranteed to be persistent until the completion of a flush request. Call spdk_bdev_has_write_cache() to check if the bdev has a volatile cache.
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
offset | The offset, in bytes, from the start of the block device. |
length | The number of bytes. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_flush_blocks | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | offset_blocks, | ||
uint64_t | num_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a flush request to the bdev on the given channel.
For devices with volatile caches, data is not guaranteed to be persistent until the completion of a flush request. Call spdk_bdev_has_write_cache() to check if the bdev has a volatile cache.
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
offset_blocks | The offset, in blocks, from the start of the block device. |
num_blocks | The number of blocks. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_get_zone_info | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | zone_id, | ||
size_t | num_zones, | ||
struct spdk_bdev_zone_info * | info, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a get_zone_info request to the bdev.
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
zone_id | First logical block of a zone. |
num_zones | Number of consecutive zones info to retrieve. |
info | Pointer to array capable of storing num_zones elements. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_nvme_admin_passthru | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
const struct spdk_nvme_cmd * | cmd, | ||
void * | buf, | ||
size_t | nbytes, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit an NVMe Admin command to the bdev.
This passes directly through the block layer to the device. Support for NVMe passthru is optional, indicated by calling spdk_bdev_io_type_supported().
The SGL/PRP will be automated generated based on the given buffer, so that portion of the command may be left empty.
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
cmd | The raw NVMe command. Must be an admin command. |
buf | Data buffer to written from. |
nbytes | The number of bytes to transfer. buf must be greater than or equal to this size. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_nvme_io_passthru | ( | struct spdk_bdev_desc * | bdev_desc, |
struct spdk_io_channel * | ch, | ||
const struct spdk_nvme_cmd * | cmd, | ||
void * | buf, | ||
size_t | nbytes, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit an NVMe I/O command to the bdev.
This passes directly through the block layer to the device. Support for NVMe passthru is optional, indicated by calling spdk_bdev_io_type_supported().
The SGL/PRP will be automated generated based on the given buffer, so that portion of the command may be left empty. Also, the namespace id (nsid) will be populated automatically.
bdev_desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
cmd | The raw NVMe command. Must be in the NVM command set. |
buf | Data buffer to written from. |
nbytes | The number of bytes to transfer. buf must be greater than or equal to this size. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_nvme_io_passthru_md | ( | struct spdk_bdev_desc * | bdev_desc, |
struct spdk_io_channel * | ch, | ||
const struct spdk_nvme_cmd * | cmd, | ||
void * | buf, | ||
size_t | nbytes, | ||
void * | md_buf, | ||
size_t | md_len, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit an NVMe I/O command to the bdev.
This passes directly through the block layer to the device. Support for NVMe passthru is optional, indicated by calling spdk_bdev_io_type_supported().
The SGL/PRP will be automated generated based on the given buffer, so that portion of the command may be left empty. Also, the namespace id (nsid) will be populated automatically.
bdev_desc | Block device descriptor |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
cmd | The raw NVMe command. Must be in the NVM command set. |
buf | Data buffer to written from. |
nbytes | The number of bytes to transfer. buf must be greater than or equal to this size. |
md_buf | Meta data buffer to written from. |
md_len | md_buf size to transfer. md_buf must be greater than or equal to this size. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_nvme_iov_passthru_md | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
const struct spdk_nvme_cmd * | cmd, | ||
struct iovec * | iov, | ||
int | iovcnt, | ||
size_t | nbytes, | ||
void * | md_buf, | ||
size_t | md_len, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit an NVMe I/O command to the bdev.
This passes directly through the block layer to the device. Support for NVMe passthru is optional, indicated by calling spdk_bdev_io_type_supported().
The namespace id (nsid) will be populated automatically.
desc | Block device descriptor |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
cmd | The raw NVMe command. Must be in the NVM command set. |
iov | A scatter gather list of buffers for the command to use. |
iovcnt | The number of elements in iov. |
nbytes | The number of bytes to transfer. The total size of the buffers in iov must be greater than or equal to this size. |
md_buf | Meta data buffer to written from. |
md_len | md_buf size to transfer. md_buf must be greater than or equal to this size. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_read | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
void * | buf, | ||
uint64_t | offset, | ||
uint64_t | nbytes, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a read request to the bdev on the given channel.
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
buf | Data buffer to read into. |
offset | The offset, in bytes, from the start of the block device. |
nbytes | The number of bytes to read. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_read_blocks | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
void * | buf, | ||
uint64_t | offset_blocks, | ||
uint64_t | num_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a read request to the bdev on the given channel.
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
buf | Data buffer to read into. |
offset_blocks | The offset, in blocks, from the start of the block device. |
num_blocks | The number of blocks to read. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_read_blocks_with_md | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
void * | buf, | ||
void * | md, | ||
uint64_t | offset_blocks, | ||
uint64_t | num_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a read request to the bdev on the given channel.
This function uses separate buffer for metadata transfer (valid only if bdev supports this mode).
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
buf | Data buffer to read into. |
md | Metadata buffer. |
offset_blocks | The offset, in blocks, from the start of the block device. |
num_blocks | The number of blocks to read. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_readv | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
struct iovec * | iov, | ||
int | iovcnt, | ||
uint64_t | offset, | ||
uint64_t | nbytes, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a read request to the bdev on the given channel.
This differs from spdk_bdev_read by allowing the data buffer to be described in a scatter gather list. Some physical devices place memory alignment requirements on data and may not be able to directly transfer into the buffers provided. In this case, the request may fail.
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
iov | A scatter gather list of buffers to be read into. |
iovcnt | The number of elements in iov. |
offset | The offset, in bytes, from the start of the block device. |
nbytes | The number of bytes to read. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_readv_blocks | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
struct iovec * | iov, | ||
int | iovcnt, | ||
uint64_t | offset_blocks, | ||
uint64_t | num_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a read request to the bdev on the given channel.
This differs from spdk_bdev_read by allowing the data buffer to be described in a scatter gather list. Some physical devices place memory alignment requirements on data and may not be able to directly transfer into the buffers provided. In this case, the request may fail.
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
iov | A scatter gather list of buffers to be read into. |
iovcnt | The number of elements in iov. |
offset_blocks | The offset, in blocks, from the start of the block device. |
num_blocks | The number of blocks to read. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_readv_blocks_ext | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
struct iovec * | iov, | ||
int | iovcnt, | ||
uint64_t | offset_blocks, | ||
uint64_t | num_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg, | ||
struct spdk_bdev_ext_io_opts * | opts ) |
Submit a read request to the bdev on the given channel.
This differs from spdk_bdev_read by allowing the data buffer to be described in a scatter gather list. Some physical devices place memory alignment requirements on data or metadata and may not be able to directly transfer into the buffers provided. In this case, the request may fail. This function uses separate buffer for metadata transfer (valid only if bdev supports this mode).
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
iov | A scatter gather list of buffers to be read into. |
iovcnt | The number of elements in iov. |
offset_blocks | The offset, in blocks, from the start of the block device. |
num_blocks | The number of blocks to read. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
opts | Optional structure with extended IO request options. size member of this structure is used for ABI compatibility and must be set to sizeof(struct spdk_bdev_ext_io_opts). |
int spdk_bdev_readv_blocks_with_md | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
struct iovec * | iov, | ||
int | iovcnt, | ||
void * | md, | ||
uint64_t | offset_blocks, | ||
uint64_t | num_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a read request to the bdev on the given channel.
This differs from spdk_bdev_read by allowing the data buffer to be described in a scatter gather list. Some physical devices place memory alignment requirements on data or metadata and may not be able to directly transfer into the buffers provided. In this case, the request may fail. This function uses separate buffer for metadata transfer (valid only if bdev supports this mode).
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
iov | A scatter gather list of buffers to be read into. |
iovcnt | The number of elements in iov. |
md | Metadata buffer. |
offset_blocks | The offset, in blocks, from the start of the block device. |
num_blocks | The number of blocks to read. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_reset | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a reset request to the bdev on the given channel.
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_seek_data | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | offset_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a data seek request to the bdev on the given channel.
Starting from offset_blocks, search for next allocated data: seek result can be obtained with spdk_bdev_io_get_seek_offset
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
offset_blocks | The offset, in blocks, from the start of the block device. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_seek_hole | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | offset_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a hole seek request to the bdev on the given channel.
Starting from offset_blocks, search for next unallocated hole: seek result can be obtained with spdk_bdev_io_get_seek_offset
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
offset_blocks | The offset, in blocks, from the start of the block device. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_unmap | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | offset, | ||
uint64_t | nbytes, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit an unmap request to the block device.
Unmap is sometimes also called trim or deallocate. This notifies the device that the data in the blocks described is no longer valid. Reading blocks that have been unmapped results in indeterminate data.
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
offset | The offset, in bytes, from the start of the block device. |
nbytes | The number of bytes to unmap. Must be a multiple of the block size. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_unmap_blocks | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | offset_blocks, | ||
uint64_t | num_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit an unmap request to the block device.
Unmap is sometimes also called trim or deallocate. This notifies the device that the data in the blocks described is no longer valid. Reading blocks that have been unmapped results in indeterminate data.
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
offset_blocks | The offset, in blocks, from the start of the block device. |
num_blocks | The number of blocks to unmap. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_write | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
void * | buf, | ||
uint64_t | offset, | ||
uint64_t | nbytes, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a write request to the bdev on the given channel.
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
buf | Data buffer to written from. |
offset | The offset, in bytes, from the start of the block device. |
nbytes | The number of bytes to write. buf must be greater than or equal to this size. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_write_blocks | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
void * | buf, | ||
uint64_t | offset_blocks, | ||
uint64_t | num_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a write request to the bdev on the given channel.
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
buf | Data buffer to written from. |
offset_blocks | The offset, in blocks, from the start of the block device. |
num_blocks | The number of blocks to write. buf must be greater than or equal to this size. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_write_blocks_with_md | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
void * | buf, | ||
void * | md, | ||
uint64_t | offset_blocks, | ||
uint64_t | num_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a write request to the bdev on the given channel.
This function uses separate buffer for metadata transfer (valid only if bdev supports this mode).
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
buf | Data buffer to written from. |
md | Metadata buffer. |
offset_blocks | The offset, in blocks, from the start of the block device. |
num_blocks | The number of blocks to write. buf must be greater than or equal to this size. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_write_zeroes | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | offset, | ||
uint64_t | len, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a write zeroes request to the bdev on the given channel.
This command ensures that all bytes in the specified range are set to 00h
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
offset | The offset, in bytes, from the start of the block device. |
len | The size of data to zero. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_write_zeroes_blocks | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | offset_blocks, | ||
uint64_t | num_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a write zeroes request to the bdev on the given channel.
This command ensures that all bytes in the specified range are set to 00h
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
offset_blocks | The offset, in blocks, from the start of the block device. |
num_blocks | The number of blocks to zero. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_writev | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
struct iovec * | iov, | ||
int | iovcnt, | ||
uint64_t | offset, | ||
uint64_t | len, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a write request to the bdev on the given channel.
This differs from spdk_bdev_write by allowing the data buffer to be described in a scatter gather list. Some physical devices place memory alignment requirements on data and may not be able to directly transfer out of the buffers provided. In this case, the request may fail.
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
iov | A scatter gather list of buffers to be written from. |
iovcnt | The number of elements in iov. |
offset | The offset, in bytes, from the start of the block device. |
len | The size of data to write. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_writev_blocks | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
struct iovec * | iov, | ||
int | iovcnt, | ||
uint64_t | offset_blocks, | ||
uint64_t | num_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a write request to the bdev on the given channel.
This differs from spdk_bdev_write by allowing the data buffer to be described in a scatter gather list. Some physical devices place memory alignment requirements on data and may not be able to directly transfer out of the buffers provided. In this case, the request may fail.
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
iov | A scatter gather list of buffers to be written from. |
iovcnt | The number of elements in iov. |
offset_blocks | The offset, in blocks, from the start of the block device. |
num_blocks | The number of blocks to write. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_writev_blocks_ext | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
struct iovec * | iov, | ||
int | iovcnt, | ||
uint64_t | offset_blocks, | ||
uint64_t | num_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg, | ||
struct spdk_bdev_ext_io_opts * | opts ) |
Submit a write request to the bdev on the given channel.
This differs from spdk_bdev_write by allowing the data buffer to be described in a scatter gather list. Some physical devices place memory alignment requirements on data or metadata and may not be able to directly transfer out of the buffers provided. In this case, the request may fail. This function uses separate buffer for metadata transfer (valid only if bdev supports this mode).
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
iov | A scatter gather list of buffers to be written from. |
iovcnt | The number of elements in iov. |
offset_blocks | The offset, in blocks, from the start of the block device. |
num_blocks | The number of blocks to write. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
opts | Optional structure with extended IO request options. size member of this structure is used for ABI compatibility and must be set to sizeof(struct spdk_bdev_ext_io_opts). |
int spdk_bdev_writev_blocks_with_md | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
struct iovec * | iov, | ||
int | iovcnt, | ||
void * | md, | ||
uint64_t | offset_blocks, | ||
uint64_t | num_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a write request to the bdev on the given channel.
This differs from spdk_bdev_write by allowing the data buffer to be described in a scatter gather list. Some physical devices place memory alignment requirements on data or metadata and may not be able to directly transfer out of the buffers provided. In this case, the request may fail. This function uses separate buffer for metadata transfer (valid only if bdev supports this mode).
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
iov | A scatter gather list of buffers to be written from. |
iovcnt | The number of elements in iov. |
md | Metadata buffer. |
offset_blocks | The offset, in blocks, from the start of the block device. |
num_blocks | The number of blocks to write. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_zone_append | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
void * | buf, | ||
uint64_t | zone_id, | ||
uint64_t | num_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a zone_append request to the bdev.
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
buf | Data buffer to written from. |
zone_id | First logical block of a zone. |
num_blocks | The number of blocks to write. buf must be greater than or equal to this size. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_zone_append_with_md | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
void * | buf, | ||
void * | md, | ||
uint64_t | zone_id, | ||
uint64_t | num_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a zone_append request with metadata to the bdev.
This function uses separate buffer for metadata transfer (valid only if bdev supports this mode).
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
buf | Data buffer to written from. |
md | Metadata buffer. |
zone_id | First logical block of a zone. |
num_blocks | The number of blocks to write. buf must be greater than or equal to this size. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_zone_appendv | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
struct iovec * | iov, | ||
int | iovcnt, | ||
uint64_t | zone_id, | ||
uint64_t | num_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a zone_append request to the bdev.
This differs from spdk_bdev_zone_append by allowing the data buffer to be described in a scatter gather list.
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
iov | A scatter gather list of buffers to be written from. |
iovcnt | The number of elements in iov. |
zone_id | First logical block of a zone. |
num_blocks | The number of blocks to write. buf must be greater than or equal to this size. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_zone_appendv_with_md | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
struct iovec * | iov, | ||
int | iovcnt, | ||
void * | md, | ||
uint64_t | zone_id, | ||
uint64_t | num_blocks, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a zone_append request with metadata to the bdev.
This differs from spdk_bdev_zone_append by allowing the data buffer to be described in a scatter gather list.
This function uses separate buffer for metadata transfer (valid only if bdev supports this mode).
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
iov | A scatter gather list of buffers to be written from. |
iovcnt | The number of elements in iov. |
md | Metadata buffer. |
zone_id | First logical block of a zone. |
num_blocks | The number of blocks to write. buf must be greater than or equal to this size. |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |
int spdk_bdev_zone_management | ( | struct spdk_bdev_desc * | desc, |
struct spdk_io_channel * | ch, | ||
uint64_t | zone_id, | ||
enum spdk_bdev_zone_action | action, | ||
spdk_bdev_io_completion_cb | cb, | ||
void * | cb_arg ) |
Submit a zone_management request to the bdev.
desc | Block device descriptor. |
ch | I/O channel. Obtained by calling spdk_bdev_get_io_channel(). |
zone_id | First logical block of a zone. |
action | Action to perform on a zone (open, close, reset, finish, offline). |
cb | Called when the request is complete. |
cb_arg | Argument passed to cb. |