Network block device layer. More...
Typedefs | |
| typedef void(* | spdk_nbd_fini_cb) (void *arg) |
| typedef void(* | spdk_nbd_start_cb) (void *cb_arg, struct spdk_nbd_disk *nbd, int rc) |
| Called when an NBD device has been started. | |
Functions | |
| int | spdk_nbd_init (void) |
| Initialize the network block device layer. | |
| void | spdk_nbd_fini (spdk_nbd_fini_cb cb_fn, void *cb_arg) |
| Stop and close all the running network block devices. | |
| void | spdk_nbd_start (const char *bdev_name, const char *nbd_path, spdk_nbd_start_cb cb_fn, void *cb_arg) |
| Start a network block device backed by the bdev. | |
| int | spdk_nbd_stop (struct spdk_nbd_disk *nbd) |
| Stop the running network block device safely. | |
| const char * | spdk_nbd_get_path (struct spdk_nbd_disk *nbd) |
| Get the local filesystem path used for the network block device. | |
| void | spdk_nbd_write_config_json (struct spdk_json_write_ctx *w) |
| Write NBD subsystem configuration into provided JSON context. | |
Network block device layer.
| typedef void(* spdk_nbd_start_cb) (void *cb_arg, struct spdk_nbd_disk *nbd, int rc) |
Called when an NBD device has been started.
On success, rc is assigned 0; On failure, rc is assigned negated errno.
| void spdk_nbd_fini | ( | spdk_nbd_fini_cb | cb_fn, |
| void * | cb_arg ) |
Stop and close all the running network block devices.
| cb_fn | Callback to be always called. |
| cb_arg | Passed to cb_fn. |
| int spdk_nbd_init | ( | void | ) |
Initialize the network block device layer.
| void spdk_nbd_start | ( | const char * | bdev_name, |
| const char * | nbd_path, | ||
| spdk_nbd_start_cb | cb_fn, | ||
| void * | cb_arg ) |
Start a network block device backed by the bdev.
| bdev_name | Name of bdev exposed as a network block device. |
| nbd_path | Path to the registered network block device. |
| cb_fn | Callback to be always called. |
| cb_arg | Passed to cb_fn. |
| int spdk_nbd_stop | ( | struct spdk_nbd_disk * | nbd | ) |
Stop the running network block device safely.
| nbd | A pointer to the network block device to stop. |
| void spdk_nbd_write_config_json | ( | struct spdk_json_write_ctx * | w | ) |
Write NBD subsystem configuration into provided JSON context.
| w | JSON write context |