spdk_bdev_fn_table Struct Reference

Function table for a block device backend. More...

Collaboration diagram for spdk_bdev_fn_table:

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. More...
 
bool(* io_type_supported )(void *ctx, enum spdk_bdev_io_type)
 Check if the block device supports a specific I/O type. More...
 
struct spdk_io_channel *(* get_io_channel )(void *ctx)
 Get an I/O channel for the specific bdev for the calling thread. More...
 
int(* dump_info_json )(void *ctx, struct spdk_json_write_ctx *w)
 Output driver-specific information to a JSON stream. More...
 
void(* write_config_json )(struct spdk_bdev *bdev, struct spdk_json_write_ctx *w)
 Output bdev-specific RPC configuration to a JSON stream. More...
 
uint64_t(* get_spin_time )(struct spdk_io_channel *ch)
 Get spin-time per I/O channel in microseconds. More...
 

Detailed Description

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.

Field Documentation

◆ dump_info_json

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).

◆ get_io_channel

struct spdk_io_channel*(* spdk_bdev_fn_table::get_io_channel) (void *ctx)

Get an I/O channel for the specific bdev for the calling thread.

◆ get_spin_time

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.

◆ io_type_supported

bool(* spdk_bdev_fn_table::io_type_supported) (void *ctx, enum spdk_bdev_io_type)

Check if the block device supports a specific I/O type.

◆ submit_request

void(* spdk_bdev_fn_table::submit_request) (struct spdk_io_channel *ch, struct spdk_bdev_io *)

Process the IO.

◆ write_config_json

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.


The documentation for this struct was generated from the following file: