Function table for a block device backend. More...
#include <bdev_module.h>
Data Fields | |
int(* | destruct )(void *ctx) |
Destroy the backend block device object. | |
void(* | submit_request )(struct spdk_io_channel *ch, struct spdk_bdev_io *) |
Process the IO. | |
bool(* | io_type_supported )(void *ctx, enum spdk_bdev_io_type) |
Check if the block device supports a specific I/O type. | |
struct spdk_io_channel *(* | get_io_channel )(void *ctx) |
Get an I/O channel for the specific bdev for the calling thread. | |
int(* | dump_info_json )(void *ctx, struct spdk_json_write_ctx *w) |
Output driver-specific information to a JSON stream. | |
void(* | write_config_json )(struct spdk_bdev *bdev, struct spdk_json_write_ctx *w) |
Output bdev-specific RPC configuration to a JSON stream. | |
uint64_t(* | get_spin_time )(struct spdk_io_channel *ch) |
Get spin-time per I/O channel in microseconds. | |
void *(* | get_module_ctx )(void *ctx) |
Get bdev module context. | |
int(* | get_memory_domains )(void *ctx, struct spdk_memory_domain **domains, int array_size) |
Get memory domains used by bdev. | |
void(* | reset_device_stat )(void *ctx) |
Reset I/O statistics specific for this bdev context. | |
void(* | dump_device_stat_json )(void *ctx, struct spdk_json_write_ctx *w) |
Dump I/O statistics specific for this bdev context. | |
bool(* | accel_sequence_supported )(void *ctx, enum spdk_bdev_io_type type) |
Check if bdev can handle spdk_accel_sequence to handle I/O of specific type. | |
Function table for a block device backend.
The backend block device function table provides a set of APIs to allow communication with a backend. The main commands are read/write API calls for I/O via submit_request.
int(* spdk_bdev_fn_table::destruct) (void *ctx) |
Destroy the backend block device object.
If the destruct process for the bdev is asynchronous, return 1 from this function, and then call spdk_bdev_destruct_done() once the async work is complete. If the destruct process is synchronous, return 0 if successful, or <0 if unsuccessful.
int(* spdk_bdev_fn_table::dump_info_json) (void *ctx, struct spdk_json_write_ctx *w) |
Output driver-specific information to a JSON stream.
Optional - may be NULL.
The JSON write context will be initialized with an open object, so the bdev driver should write a name (based on the driver name) followed by a JSON value (most likely another nested object).
int(* spdk_bdev_fn_table::get_memory_domains) (void *ctx, struct spdk_memory_domain **domains, int array_size) |
Get memory domains used by bdev.
Optional - may be NULL. Vbdev module implementation should call spdk_bdev_get_memory_domains for underlying bdev. Vbdev module must inspect types of memory domains returned by base bdev and report only those memory domains that it can work with.
uint64_t(* spdk_bdev_fn_table::get_spin_time) (struct spdk_io_channel *ch) |
Get spin-time per I/O channel in microseconds.
Optional - may be NULL.
void(* spdk_bdev_fn_table::write_config_json) (struct spdk_bdev *bdev, struct spdk_json_write_ctx *w) |
Output bdev-specific RPC configuration to a JSON stream.
Optional - may be NULL.
This function should only be implemented for bdevs which can be configured independently of other bdevs. For example, RPCs to create a bdev for an NVMe namespace may not be generated by this function, since enumerating an NVMe namespace requires attaching to an NVMe controller, and that controller may contain multiple namespaces. The spdk_bdev_module's config_json function should be used instead for these cases.
The JSON write context will be initialized with an open object, so the bdev driver should write all data necessary to recreate this bdev by invoking constructor method. No other data should be written.