bdev: Add SPDK_MIN_BDEV_IO_STATUS to allocate array for error status

We can allocate an array for error status dynamically via negating
SPDK_MIN_BDEV_IO_STATUS.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Id36a92bfaa906b445715c03b69a0fd9a154a49e0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15898
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Shuhei Matsumoto 2022-12-13 21:45:42 +09:00 committed by Tomasz Zawadzki
parent c134d11ca7
commit 99de60a36f

View File

@ -267,6 +267,11 @@ enum spdk_bdev_io_status {
SPDK_BDEV_IO_STATUS_FAILED = -1, SPDK_BDEV_IO_STATUS_FAILED = -1,
SPDK_BDEV_IO_STATUS_PENDING = 0, SPDK_BDEV_IO_STATUS_PENDING = 0,
SPDK_BDEV_IO_STATUS_SUCCESS = 1, SPDK_BDEV_IO_STATUS_SUCCESS = 1,
/* This may be used as the size of an error status array by negation.
* Hence, this should be updated when adding new error statuses.
*/
SPDK_MIN_BDEV_IO_STATUS = SPDK_BDEV_IO_STATUS_AIO_ERROR,
}; };
struct spdk_bdev_name { struct spdk_bdev_name {