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

bdev: Pull spdk_bdev_io::internal into a separate struct



This will make it easier to analyze and see upcoming diffs.

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


Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Community-CI: Mellanox Build Bot
parent 299394f7
Loading
Loading
Loading
Loading
+130 −124
Original line number Diff line number Diff line
@@ -911,36 +911,11 @@ struct spdk_bdev_io_zone_mgmt_params {
	void *buf;
};

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;

/**
 *  Fields that are used internally by the bdev subsystem.  Bdev modules
 *  must not read or write to these fields.
 */
	struct __bdev_io_internal_fields {
struct spdk_bdev_io_internal_fields {
	/** The bdev I/O channel that this was handled on. */
	struct spdk_bdev_channel *ch;

@@ -1065,7 +1040,38 @@ struct spdk_bdev_io {

	/** Data transfer completion callback */
	void (*data_transfer_cpl)(void *ctx, int rc);
	} internal;
};

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;

	/**
	 *  Fields that are used internally by the bdev subsystem.  Bdev modules
	 *  must not read or write to these fields.
	 */
	struct spdk_bdev_io_internal_fields internal;

	/**
	 * Per I/O context for use by the bdev module.