bdev: remove parent/child I/O related code
Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: Ia45876fb6f0eefd987cdb36521ecb591ef1f9499 Reviewed-on: https://review.gerrithub.io/365669 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
80161622b8
commit
03e0a3027f
@ -338,12 +338,6 @@ struct spdk_bdev_io {
|
||||
*/
|
||||
bool defer_callback;
|
||||
|
||||
/** Used in virtual device (e.g., RAID), indicates its parent spdk_bdev_io */
|
||||
struct spdk_bdev_io *parent;
|
||||
|
||||
/** Used in virtual device (e.g., RAID) for storing multiple child device I/Os */
|
||||
TAILQ_HEAD(child_io, spdk_bdev_io) child_io;
|
||||
|
||||
/** Member used for linking child I/Os together. */
|
||||
TAILQ_ENTRY(spdk_bdev_io) link;
|
||||
|
||||
@ -358,10 +352,6 @@ void spdk_bdev_unregister(struct spdk_bdev *bdev);
|
||||
|
||||
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_child_io(struct spdk_bdev_io *parent,
|
||||
struct spdk_bdev *bdev,
|
||||
spdk_bdev_io_completion_cb cb,
|
||||
void *cb_arg);
|
||||
void spdk_bdev_io_resubmit(struct spdk_bdev_io *bdev_io, struct spdk_bdev *new_bdev);
|
||||
void spdk_bdev_io_complete(struct spdk_bdev_io *bdev_io,
|
||||
enum spdk_bdev_io_status status);
|
||||
|
@ -536,38 +536,6 @@ spdk_bdev_io_init(struct spdk_bdev_io *bdev_io,
|
||||
bdev_io->gencnt = bdev->gencnt;
|
||||
bdev_io->status = SPDK_BDEV_IO_STATUS_PENDING;
|
||||
bdev_io->in_submit_request = false;
|
||||
TAILQ_INIT(&bdev_io->child_io);
|
||||
}
|
||||
|
||||
struct spdk_bdev_io *
|
||||
spdk_bdev_get_child_io(struct spdk_bdev_io *parent,
|
||||
struct spdk_bdev *bdev,
|
||||
spdk_bdev_io_completion_cb cb,
|
||||
void *cb_arg)
|
||||
{
|
||||
struct spdk_bdev_io *child;
|
||||
|
||||
child = spdk_bdev_get_io();
|
||||
if (!child) {
|
||||
SPDK_ERRLOG("Unable to get spdk_bdev_io\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (cb_arg == NULL) {
|
||||
cb_arg = child;
|
||||
}
|
||||
|
||||
spdk_bdev_io_init(child, bdev, cb_arg, cb);
|
||||
|
||||
child->type = parent->type;
|
||||
memcpy(&child->u, &parent->u, sizeof(child->u));
|
||||
child->buf = NULL;
|
||||
child->get_buf_cb = NULL;
|
||||
child->parent = parent;
|
||||
|
||||
TAILQ_INSERT_TAIL(&parent->child_io, child, link);
|
||||
|
||||
return child;
|
||||
}
|
||||
|
||||
bool
|
||||
@ -1088,8 +1056,6 @@ spdk_bdev_nvme_io_passthru(struct spdk_bdev *bdev, struct spdk_io_channel *ch,
|
||||
int
|
||||
spdk_bdev_free_io(struct spdk_bdev_io *bdev_io)
|
||||
{
|
||||
struct spdk_bdev_io *child_io, *tmp;
|
||||
|
||||
if (!bdev_io) {
|
||||
SPDK_ERRLOG("bdev_io is NULL\n");
|
||||
return -1;
|
||||
@ -1101,22 +1067,6 @@ spdk_bdev_free_io(struct spdk_bdev_io *bdev_io)
|
||||
return -1;
|
||||
}
|
||||
|
||||
TAILQ_FOREACH_SAFE(child_io, &bdev_io->child_io, link, tmp) {
|
||||
/*
|
||||
* Make sure no references to the parent I/O remain, since it is being
|
||||
* returned to the free pool.
|
||||
*/
|
||||
child_io->parent = NULL;
|
||||
TAILQ_REMOVE(&bdev_io->child_io, child_io, link);
|
||||
|
||||
/*
|
||||
* Child I/O may have a buf that needs to be returned to a pool
|
||||
* on a different core, so free it through the request submission
|
||||
* process rather than calling put_io directly here.
|
||||
*/
|
||||
spdk_bdev_free_io(child_io);
|
||||
}
|
||||
|
||||
spdk_bdev_put_io(bdev_io);
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user