bdev: remove spdk_bdev_resubmit_io
We no longer support resubmitting an existing I/O to a lower bdev. This enables accurate tracking of I/O at each bdev layer for purposes of reset handling and QoS. __submit_request() in bdev.c is now only called from spdk_bdev_io_submit(), so just collapse these two functions together while we are here. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I1b46df42b1a6476f9dbd8c61dd3380dbd145315d Reviewed-on: https://review.gerrithub.io/377626 Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
parent
cd28ee8b7d
commit
ff9cadadb3
@ -368,9 +368,6 @@ struct spdk_bdev_io {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Per I/O context for use by the bdev module.
|
* Per I/O context for use by the bdev module.
|
||||||
*
|
|
||||||
* Note that vbdev modules may not use this field if modifying a bdev_io and resubmitting
|
|
||||||
* to the next lower bdev.
|
|
||||||
*/
|
*/
|
||||||
uint8_t driver_ctx[0];
|
uint8_t driver_ctx[0];
|
||||||
|
|
||||||
@ -400,7 +397,6 @@ void spdk_bdev_poller_stop(struct spdk_bdev_poller **ppoller);
|
|||||||
|
|
||||||
void spdk_bdev_io_get_buf(struct spdk_bdev_io *bdev_io, spdk_bdev_io_get_buf_cb cb);
|
void spdk_bdev_io_get_buf(struct spdk_bdev_io *bdev_io, spdk_bdev_io_get_buf_cb cb);
|
||||||
struct spdk_bdev_io *spdk_bdev_get_io(void);
|
struct spdk_bdev_io *spdk_bdev_get_io(void);
|
||||||
void spdk_bdev_io_resubmit(struct spdk_bdev_io *bdev_io, struct spdk_bdev_desc *new_bdev_desc);
|
|
||||||
void spdk_bdev_io_complete(struct spdk_bdev_io *bdev_io,
|
void spdk_bdev_io_complete(struct spdk_bdev_io *bdev_io,
|
||||||
enum spdk_bdev_io_status status);
|
enum spdk_bdev_io_status status);
|
||||||
|
|
||||||
|
@ -600,47 +600,22 @@ spdk_bdev_put_io(struct spdk_bdev_io *bdev_io)
|
|||||||
spdk_mempool_put(g_bdev_mgr.bdev_io_pool, (void *)bdev_io);
|
spdk_mempool_put(g_bdev_mgr.bdev_io_pool, (void *)bdev_io);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
__submit_request(struct spdk_bdev *bdev, struct spdk_bdev_io *bdev_io)
|
spdk_bdev_io_submit(struct spdk_bdev_io *bdev_io)
|
||||||
{
|
{
|
||||||
struct spdk_io_channel *ch;
|
struct spdk_bdev *bdev = bdev_io->bdev;
|
||||||
|
struct spdk_io_channel *ch = bdev_io->ch->channel;
|
||||||
|
|
||||||
assert(bdev_io->status == SPDK_BDEV_IO_STATUS_PENDING);
|
assert(bdev_io->status == SPDK_BDEV_IO_STATUS_PENDING);
|
||||||
|
|
||||||
ch = bdev_io->ch->channel;
|
|
||||||
|
|
||||||
bdev_io->ch->io_outstanding++;
|
bdev_io->ch->io_outstanding++;
|
||||||
bdev_io->in_submit_request = true;
|
bdev_io->in_submit_request = true;
|
||||||
bdev->fn_table->submit_request(ch, bdev_io);
|
bdev->fn_table->submit_request(ch, bdev_io);
|
||||||
bdev_io->in_submit_request = false;
|
bdev_io->in_submit_request = false;
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
spdk_bdev_io_submit(struct spdk_bdev_io *bdev_io)
|
|
||||||
{
|
|
||||||
struct spdk_bdev *bdev = bdev_io->bdev;
|
|
||||||
|
|
||||||
__submit_request(bdev, bdev_io);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
spdk_bdev_io_resubmit(struct spdk_bdev_io *bdev_io, struct spdk_bdev_desc *new_bdev_desc)
|
|
||||||
{
|
|
||||||
struct spdk_bdev *new_bdev = new_bdev_desc->bdev;
|
|
||||||
|
|
||||||
assert(bdev_io->status == SPDK_BDEV_IO_STATUS_PENDING);
|
|
||||||
bdev_io->bdev = new_bdev;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This bdev_io was already submitted so decrement io_outstanding to ensure it
|
|
||||||
* does not get double-counted.
|
|
||||||
*/
|
|
||||||
assert(bdev_io->ch->io_outstanding > 0);
|
|
||||||
bdev_io->ch->io_outstanding--;
|
|
||||||
__submit_request(new_bdev, bdev_io);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
spdk_bdev_io_init(struct spdk_bdev_io *bdev_io,
|
spdk_bdev_io_init(struct spdk_bdev_io *bdev_io,
|
||||||
struct spdk_bdev *bdev, void *cb_arg,
|
struct spdk_bdev *bdev, void *cb_arg,
|
||||||
|
Loading…
Reference in New Issue
Block a user