Loading include/spdk/bdev.h +1 −21 Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ #define SPDK_BDEV_MAX_PRODUCT_NAME_LENGTH 50 struct spdk_bdev_io; struct spdk_bdev_fn_table; /** * \brief SPDK block device. Loading Loading @@ -114,27 +115,6 @@ enum spdk_bdev_io_type { SPDK_BDEV_IO_TYPE_RESET, }; /** * 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. */ struct spdk_bdev_fn_table { /** Destroy the backend block device object */ int (*destruct)(struct spdk_bdev *bdev); /** Process the IO. */ void (*submit_request)(struct spdk_bdev_io *); /** Check if the block device supports a specific I/O type. */ bool (*io_type_supported)(struct spdk_bdev *bdev, enum spdk_bdev_io_type); /** Get an I/O channel for the specific bdev for the calling thread. */ struct spdk_io_channel *(*get_io_channel)(struct spdk_bdev *bdev, uint32_t priority); }; /** Blockdev I/O completion status */ enum spdk_bdev_io_status { SPDK_BDEV_IO_STATUS_SCSI_ERROR = -3, Loading lib/bdev/bdev_module.h +20 −0 Original line number Diff line number Diff line Loading @@ -120,6 +120,26 @@ struct spdk_bdev_module_if { TAILQ_ENTRY(spdk_bdev_module_if) tailq; }; /** * 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. */ struct spdk_bdev_fn_table { /** Destroy the backend block device object */ int (*destruct)(struct spdk_bdev *bdev); /** Process the IO. */ void (*submit_request)(struct spdk_bdev_io *); /** Check if the block device supports a specific I/O type. */ bool (*io_type_supported)(struct spdk_bdev *bdev, enum spdk_bdev_io_type); /** Get an I/O channel for the specific bdev for the calling thread. */ struct spdk_io_channel *(*get_io_channel)(struct spdk_bdev *bdev, uint32_t priority); }; void spdk_bdev_register(struct spdk_bdev *bdev); void spdk_bdev_io_get_rbuf(struct spdk_bdev_io *bdev_io, spdk_bdev_io_get_rbuf_cb cb); Loading test/lib/scsi/scsi_bdev/scsi_bdev_ut.c +0 −6 Original line number Diff line number Diff line Loading @@ -381,15 +381,12 @@ inquiry_standard_test(void) struct spdk_scsi_task task; struct spdk_scsi_lun lun; struct spdk_scsi_dev dev; struct spdk_bdev_fn_table fn_table; char cdb[6]; /* expects a 4K internal data buffer */ char data[4096]; struct spdk_scsi_cdb_inquiry_data *inq_data; int rc; bdev.fn_table = &fn_table; cdb[0] = 0x12; cdb[1] = 0x00; // EVPD = 0 cdb[2] = 0x00; // PageCode zero - requesting standard inquiry Loading Loading @@ -420,14 +417,11 @@ _inquiry_overflow_test(uint8_t alloc_len) struct spdk_scsi_task task; struct spdk_scsi_lun lun; struct spdk_scsi_dev dev; struct spdk_bdev_fn_table fn_table; uint8_t cdb[6]; /* expects a 4K internal data buffer */ char data[256], data_compare[256]; int rc; bdev.fn_table = &fn_table; cdb[0] = 0x12; cdb[1] = 0x00; // EVPD = 0 cdb[2] = 0x00; // PageCode zero - requesting standard inquiry Loading Loading
include/spdk/bdev.h +1 −21 Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ #define SPDK_BDEV_MAX_PRODUCT_NAME_LENGTH 50 struct spdk_bdev_io; struct spdk_bdev_fn_table; /** * \brief SPDK block device. Loading Loading @@ -114,27 +115,6 @@ enum spdk_bdev_io_type { SPDK_BDEV_IO_TYPE_RESET, }; /** * 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. */ struct spdk_bdev_fn_table { /** Destroy the backend block device object */ int (*destruct)(struct spdk_bdev *bdev); /** Process the IO. */ void (*submit_request)(struct spdk_bdev_io *); /** Check if the block device supports a specific I/O type. */ bool (*io_type_supported)(struct spdk_bdev *bdev, enum spdk_bdev_io_type); /** Get an I/O channel for the specific bdev for the calling thread. */ struct spdk_io_channel *(*get_io_channel)(struct spdk_bdev *bdev, uint32_t priority); }; /** Blockdev I/O completion status */ enum spdk_bdev_io_status { SPDK_BDEV_IO_STATUS_SCSI_ERROR = -3, Loading
lib/bdev/bdev_module.h +20 −0 Original line number Diff line number Diff line Loading @@ -120,6 +120,26 @@ struct spdk_bdev_module_if { TAILQ_ENTRY(spdk_bdev_module_if) tailq; }; /** * 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. */ struct spdk_bdev_fn_table { /** Destroy the backend block device object */ int (*destruct)(struct spdk_bdev *bdev); /** Process the IO. */ void (*submit_request)(struct spdk_bdev_io *); /** Check if the block device supports a specific I/O type. */ bool (*io_type_supported)(struct spdk_bdev *bdev, enum spdk_bdev_io_type); /** Get an I/O channel for the specific bdev for the calling thread. */ struct spdk_io_channel *(*get_io_channel)(struct spdk_bdev *bdev, uint32_t priority); }; void spdk_bdev_register(struct spdk_bdev *bdev); void spdk_bdev_io_get_rbuf(struct spdk_bdev_io *bdev_io, spdk_bdev_io_get_rbuf_cb cb); Loading
test/lib/scsi/scsi_bdev/scsi_bdev_ut.c +0 −6 Original line number Diff line number Diff line Loading @@ -381,15 +381,12 @@ inquiry_standard_test(void) struct spdk_scsi_task task; struct spdk_scsi_lun lun; struct spdk_scsi_dev dev; struct spdk_bdev_fn_table fn_table; char cdb[6]; /* expects a 4K internal data buffer */ char data[4096]; struct spdk_scsi_cdb_inquiry_data *inq_data; int rc; bdev.fn_table = &fn_table; cdb[0] = 0x12; cdb[1] = 0x00; // EVPD = 0 cdb[2] = 0x00; // PageCode zero - requesting standard inquiry Loading Loading @@ -420,14 +417,11 @@ _inquiry_overflow_test(uint8_t alloc_len) struct spdk_scsi_task task; struct spdk_scsi_lun lun; struct spdk_scsi_dev dev; struct spdk_bdev_fn_table fn_table; uint8_t cdb[6]; /* expects a 4K internal data buffer */ char data[256], data_compare[256]; int rc; bdev.fn_table = &fn_table; cdb[0] = 0x12; cdb[1] = 0x00; // EVPD = 0 cdb[2] = 0x00; // PageCode zero - requesting standard inquiry Loading