spdk_bdev_module Struct Reference

Block device module. More...

Collaboration diagram for spdk_bdev_module:

Data Structures

struct  __bdev_module_internal_fields
 Fields that are used by the internal bdev subsystem. More...
 

Data Fields

int(* module_init )(void)
 Initialization function for the module. More...
 
void(* init_complete )(void)
 Optional callback for modules that require notification of when the bdev subsystem has completed initialization. More...
 
void(* fini_start )(void)
 Optional callback for modules that require notification of when the bdev subsystem is starting the fini process. More...
 
void(* module_fini )(void)
 Finish function for the module. More...
 
void(* config_text )(FILE *fp)
 Function called to return a text string representing the module's configuration options for inclusion in a configuration file.
 
int(* config_json )(struct spdk_json_write_ctx *w)
 Function called to return a text string representing the module-level JSON RPCs required to regenerate the current configuration. More...
 
const char * name
 Name for the modules being defined. More...
 
int(* get_ctx_size )(void)
 Returns the allocation size required for the backend for uses such as local command structs, local SGL, iovecs, or other user context.
 
void(* examine_config )(struct spdk_bdev *bdev)
 First notification that a bdev should be examined by a virtual bdev module. More...
 
void(* examine_disk )(struct spdk_bdev *bdev)
 Second notification that a bdev should be examined by a virtual bdev module. More...
 
bool async_init
 Denotes if the module_init function may complete asynchronously. More...
 
bool async_fini
 Denotes if the module_fini function may complete asynchronously. More...
 
struct spdk_bdev_module::__bdev_module_internal_fields internal
 

Detailed Description

Block device module.

Field Documentation

◆ async_fini

bool spdk_bdev_module::async_fini

Denotes if the module_fini function may complete asynchronously.

If set to true finishing has to be explicitly completed by calling spdk_bdev_module_fini_done().

◆ async_init

bool spdk_bdev_module::async_init

Denotes if the module_init function may complete asynchronously.

If set to true, the module initialization has to be explicitly completed by calling spdk_bdev_module_init_done().

◆ config_json

int(* spdk_bdev_module::config_json) (struct spdk_json_write_ctx *w)

Function called to return a text string representing the module-level JSON RPCs required to regenerate the current configuration.

This will include module-level configuration options, or methods to construct bdevs when one RPC may generate multiple bdevs (for example, an NVMe controller with multiple namespaces).

Per-bdev JSON RPCs (where one "construct" RPC always creates one bdev) may be implemented here, or by the bdev's write_config_json function - but not both. Bdev module implementers may choose which mechanism to use based on the module's design.

Returns
0 on success or Bdev specific negative error code.

◆ examine_config

void(* spdk_bdev_module::examine_config) (struct spdk_bdev *bdev)

First notification that a bdev should be examined by a virtual bdev module.

Virtual bdev modules may use this to examine newly-added bdevs and automatically create their own vbdevs, but no I/O to device can be send to bdev at this point. Only vbdevs based on config files can be created here. This callback must make its decision to claim the module synchronously. It must also call spdk_bdev_module_examine_done() before returning. If the module needs to perform asynchronous operations such as I/O after claiming the bdev, it may define an examine_disk callback. The examine_disk callback will then be called immediately after the examine_config callback returns.

◆ examine_disk

void(* spdk_bdev_module::examine_disk) (struct spdk_bdev *bdev)

Second notification that a bdev should be examined by a virtual bdev module.

Virtual bdev modules may use this to examine newly-added bdevs and automatically create their own vbdevs. This callback may use I/O operations end finish asynchronously.

◆ fini_start

void(* spdk_bdev_module::fini_start) (void)

Optional callback for modules that require notification of when the bdev subsystem is starting the fini process.

Modules are not required to define this function.

◆ init_complete

void(* spdk_bdev_module::init_complete) (void)

Optional callback for modules that require notification of when the bdev subsystem has completed initialization.

Modules are not required to define this function.

◆ module_fini

void(* spdk_bdev_module::module_fini) (void)

Finish function for the module.

Called by the spdk application after all bdevs for all modules have been unregistered. This allows the module to do any final cleanup before the SPDK application exits.

Modules are not required to define this function.

◆ module_init

int(* spdk_bdev_module::module_init) (void)

Initialization function for the module.

Called by the spdk application during startup.

Modules are required to define this function.

◆ name

const char* spdk_bdev_module::name

Name for the modules being defined.


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