include/bdev.h: add comments for callback functions

Change-Id: Ie7234178306cb83f1c9c2838d483fdc8eb8dbb47
Signed-off-by: Yanbo Zhou <yanbo.zhou@intel.com>
Reviewed-on: https://review.gerrithub.io/407682
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
Yanbo Zhou 2018-04-16 11:25:28 +08:00 committed by Ben Walker
parent f8387acaa5
commit cfbae9c23b

View File

@ -52,6 +52,11 @@ extern "C" {
#define SPDK_BDEV_SMALL_BUF_MAX_SIZE 8192 #define SPDK_BDEV_SMALL_BUF_MAX_SIZE 8192
#define SPDK_BDEV_LARGE_BUF_MAX_SIZE (64 * 1024) #define SPDK_BDEV_LARGE_BUF_MAX_SIZE (64 * 1024)
/**
* Block device remove callback.
*
* \param remove_ctx Context for the removed block device.
*/
typedef void (*spdk_bdev_remove_cb_t)(void *remove_ctx); typedef void (*spdk_bdev_remove_cb_t)(void *remove_ctx);
/** /**
@ -104,8 +109,8 @@ enum spdk_bdev_io_type {
* Block device completion callback. * Block device completion callback.
* *
* \param bdev_io Block device I/O that has completed. * \param bdev_io Block device I/O that has completed.
* \param success true if I/O completed successfully or false if it failed; additional error * \param success True if I/O completed successfully or false if it failed;
* information may be retrieved from bdev_io by calling * additional error information may be retrieved from bdev_io by calling
* spdk_bdev_io_get_nvme_status() or spdk_bdev_io_get_scsi_status(). * spdk_bdev_io_get_nvme_status() or spdk_bdev_io_get_scsi_status().
* \param cb_arg Callback argument specified when bdev_io was submitted. * \param cb_arg Callback argument specified when bdev_io was submitted.
*/ */
@ -123,7 +128,19 @@ struct spdk_bdev_io_stat {
uint64_t ticks_rate; uint64_t ticks_rate;
}; };
/**
* Block device initialization callback.
*
* \param cb_arg Callback argument.
* \param rc 0 if block device initialized successfully or negative errno if it failed.
*/
typedef void (*spdk_bdev_init_cb)(void *cb_arg, int rc); typedef void (*spdk_bdev_init_cb)(void *cb_arg, int rc);
/**
* Block device finish callback.
*
* \param cb_arg Callback argument.
*/
typedef void (*spdk_bdev_fini_cb)(void *cb_arg); typedef void (*spdk_bdev_fini_cb)(void *cb_arg);
typedef void (*spdk_bdev_get_device_stat_cb)(struct spdk_bdev *bdev, typedef void (*spdk_bdev_get_device_stat_cb)(struct spdk_bdev *bdev,
struct spdk_bdev_io_stat *stat, void *cb_arg, int rc); struct spdk_bdev_io_stat *stat, void *cb_arg, int rc);