bdev: Move definition for spdk_bdev_module_channel up

Move this definition between the management channel and
the bdev channel struct since that's where it fits in
the logical hierarchy.

This is just code movement. No other changes.

Change-Id: I80b9909b14cad473a7768780ac9ab74a2f1309e5
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406852
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Ben Walker 2018-04-06 14:03:42 -07:00
parent 03717822c5
commit fe53e5330c

View File

@ -122,12 +122,35 @@ struct spdk_bdev_mgmt_channel {
TAILQ_HEAD(, spdk_bdev_module_channel) module_channels;
};
struct spdk_bdev_desc {
struct spdk_bdev *bdev;
spdk_bdev_remove_cb_t remove_cb;
void *remove_ctx;
bool write;
TAILQ_ENTRY(spdk_bdev_desc) link;
/*
* Per-module (or per-io_device) channel. Multiple bdevs built on the same io_device
* will queue here their IO that awaits retry. It makes it posible to retry sending
* IO to one bdev after IO from other bdev completes.
*/
struct spdk_bdev_module_channel {
/*
* Count of I/O submitted to bdev module and waiting for completion.
* Incremented before submit_request() is called on an spdk_bdev_io.
*/
uint64_t io_outstanding;
/*
* Queue of IO awaiting retry because of a previous NOMEM status returned
* on this channel.
*/
bdev_io_tailq_t nomem_io;
/*
* Threshold which io_outstanding must drop to before retrying nomem_io.
*/
uint64_t nomem_threshold;
/* I/O channel allocated by a bdev module */
struct spdk_io_channel *module_ch;
uint32_t ref;
TAILQ_ENTRY(spdk_bdev_module_channel) link;
};
#define BDEV_CH_RESET_IN_PROGRESS (1 << 0)
@ -191,40 +214,17 @@ struct spdk_bdev_channel {
};
struct spdk_bdev_desc {
struct spdk_bdev *bdev;
spdk_bdev_remove_cb_t remove_cb;
void *remove_ctx;
bool write;
TAILQ_ENTRY(spdk_bdev_desc) link;
};
#define __bdev_to_io_dev(bdev) (((char *)bdev) + 1)
#define __bdev_from_io_dev(io_dev) ((struct spdk_bdev *)(((char *)io_dev) - 1))
/*
* Per-module (or per-io_device) channel. Multiple bdevs built on the same io_device
* will queue here their IO that awaits retry. It makes it posible to retry sending
* IO to one bdev after IO from other bdev completes.
*/
struct spdk_bdev_module_channel {
/*
* Count of I/O submitted to bdev module and waiting for completion.
* Incremented before submit_request() is called on an spdk_bdev_io.
*/
uint64_t io_outstanding;
/*
* Queue of IO awaiting retry because of a previous NOMEM status returned
* on this channel.
*/
bdev_io_tailq_t nomem_io;
/*
* Threshold which io_outstanding must drop to before retrying nomem_io.
*/
uint64_t nomem_threshold;
/* I/O channel allocated by a bdev module */
struct spdk_io_channel *module_ch;
uint32_t ref;
TAILQ_ENTRY(spdk_bdev_module_channel) link;
};
static void spdk_bdev_write_zeroes_split(struct spdk_bdev_io *bdev_io, bool success, void *cb_arg);
struct spdk_bdev *