Commit 97048472 authored by Ben Walker's avatar Ben Walker Committed by Konrad Sztyber
Browse files

bdev: Make the spdk_bdev_io parameters structures separate



These are getting large and it's easier to analyze this data structure
if we break them out.

Change-Id: I6285a090f54b1bff4a3a7e28c181f7ddd143f536
Signed-off-by: default avatarBen Walker <ben@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/21940


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Community-CI: Mellanox Build Bot
parent dc996557
Loading
Loading
Loading
Loading
+131 −120
Original line number Diff line number Diff line
@@ -789,24 +789,7 @@ typedef void (*spdk_bdev_io_get_aux_buf_cb)(struct spdk_io_channel *ch,
/* Maximum number of IOVs used for I/O splitting */
#define SPDK_BDEV_IO_NUM_CHILD_IOV 32

struct spdk_bdev_io {
	/** The block device that this I/O belongs to. */
	struct spdk_bdev *bdev;

	/** Enumerated value representing the I/O type. */
	uint8_t type;

	/** Number of IO submission retries */
	uint16_t num_retries;

	/** A single iovec element for use by this bdev_io. */
	struct iovec iov;

	/** Array of iovecs used for I/O splitting. */
	struct iovec child_iov[SPDK_BDEV_IO_NUM_CHILD_IOV];

	union {
		struct {
struct spdk_bdev_io_block_params {
	/** For SG buffer cases, array of iovecs to transfer. */
	struct iovec *iovs;

@@ -885,8 +868,9 @@ struct spdk_bdev_io {
		/** Starting source offset (in blocks) of the bdev for copy I/O. */
		uint64_t src_offset_blocks;
	} copy;
		} bdev;
		struct {
};

struct spdk_bdev_io_reset_params {
	/** Channel reference held while messages for this reset are in progress. */
	struct spdk_io_channel *ch_ref;
	struct {
@@ -895,12 +879,14 @@ struct spdk_bdev_io {
		/* Store calculated time value, when a poller should stop its work. */
		uint64_t  stop_time_tsc;
	} wait_poller;
		} reset;
		struct {
};

struct spdk_bdev_io_abort_params {
	/** The outstanding request matching bio_cb_arg which this abort attempts to cancel. */
	struct spdk_bdev_io *bio_to_abort;
		} abort;
		struct {
};

struct spdk_bdev_io_nvme_passthru_params {
	/* The NVMe command to execute */
	struct spdk_nvme_cmd cmd;

@@ -921,8 +907,9 @@ struct spdk_bdev_io {

	/* meta data buffer size to transfer */
	size_t md_len;
		} nvme_passthru;
		struct {
};

struct spdk_bdev_io_zone_mgmt_params {
	/* First logical block of a zone */
	uint64_t zone_id;

@@ -934,7 +921,31 @@ struct spdk_bdev_io {

	/* The data buffer */
	void *buf;
		} zone_mgmt;
};

struct spdk_bdev_io {
	/** The block device that this I/O belongs to. */
	struct spdk_bdev *bdev;

	/** Enumerated value representing the I/O type. */
	uint8_t type;

	/** Number of IO submission retries */
	uint16_t num_retries;

	/** A single iovec element for use by this bdev_io. */
	struct iovec iov;

	/** Array of iovecs used for I/O splitting. */
	struct iovec child_iov[SPDK_BDEV_IO_NUM_CHILD_IOV];

	/** Parameters filled in by the user */
	union {
		struct spdk_bdev_io_block_params bdev;
		struct spdk_bdev_io_reset_params reset;
		struct spdk_bdev_io_abort_params abort;
		struct spdk_bdev_io_nvme_passthru_params nvme_passthru;
		struct spdk_bdev_io_zone_mgmt_params zone_mgmt;
	} u;

	/**