From 526fa366d494f020eee25acaf02f49fd0b7f12c7 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Thu, 23 Aug 2018 14:04:25 -0700 Subject: [PATCH] bdev/raid: remove unneeded buf field buf is no longer needed, now that RAID I/O will never span a strip boundary. Signed-off-by: Jim Harris Change-Id: Icc03b985f540797597c238005bf9883f6f8ad010 Reviewed-on: https://review.gerrithub.io/423406 Tested-by: SPDK CI Jenkins Chandler-Test-Pool: SPDK Automated Test System Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto --- lib/bdev/raid/bdev_raid.c | 14 +++++--------- lib/bdev/raid/bdev_raid.h | 7 ++----- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/lib/bdev/raid/bdev_raid.c b/lib/bdev/raid/bdev_raid.c index 9bcb5d834..e2deeea43 100644 --- a/lib/bdev/raid/bdev_raid.c +++ b/lib/bdev/raid/bdev_raid.c @@ -287,17 +287,17 @@ raid_bdev_io_completion(struct spdk_bdev_io *bdev_io, bool success, void *cb_arg * params: * bdev_io - parent bdev io * start_strip - start strip number of this io - * buf - pointer to buffer for this io * returns: * 0 - success * non zero - failure */ static int -raid_bdev_submit_children(struct spdk_bdev_io *bdev_io, uint64_t start_strip, uint8_t *buf) +raid_bdev_submit_children(struct spdk_bdev_io *bdev_io, uint64_t start_strip) { struct raid_bdev_io *raid_io = (struct raid_bdev_io *)bdev_io->driver_ctx; struct raid_bdev_io_channel *raid_ch = spdk_io_channel_get_ctx(raid_io->ch); struct raid_bdev *raid_bdev = (struct raid_bdev *)bdev_io->bdev->ctxt; + uint8_t *buf = bdev_io->u.bdev.iovs->iov_base; uint64_t pd_strip; uint32_t offset_in_strip; uint64_t pd_lba; @@ -334,12 +334,8 @@ raid_bdev_submit_children(struct spdk_bdev_io *bdev_io, uint64_t start_strip, ui SPDK_ERRLOG("Recvd not supported io type %u\n", bdev_io->type); assert(0); } - if (ret != 0) { - raid_io->buf = buf; - return ret; - } - return 0; + return ret; } /* @@ -425,7 +421,7 @@ raid_bdev_waitq_io_process(void *ctx) */ raid_bdev = (struct raid_bdev *)bdev_io->bdev->ctxt; start_strip = bdev_io->u.bdev.offset_blocks >> raid_bdev->strip_size_shift; - ret = raid_bdev_submit_children(bdev_io, start_strip, raid_io->buf); + ret = raid_bdev_submit_children(bdev_io, start_strip); if (ret != 0) { raid_bdev_io_submit_fail_process(raid_bdev, bdev_io, raid_io, ret); } @@ -470,7 +466,7 @@ _raid_bdev_submit_rw_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bd SPDK_ERRLOG("I/O spans strip boundary!\n"); spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_FAILED); } - ret = raid_bdev_submit_children(bdev_io, start_strip, bdev_io->u.bdev.iovs->iov_base); + ret = raid_bdev_submit_children(bdev_io, start_strip); if (ret != 0) { raid_bdev_io_submit_fail_process(raid_bdev, bdev_io, raid_io, ret); } diff --git a/lib/bdev/raid/bdev_raid.h b/lib/bdev/raid/bdev_raid.h index 0934e5842..99c88f1b1 100644 --- a/lib/bdev/raid/bdev_raid.h +++ b/lib/bdev/raid/bdev_raid.h @@ -129,13 +129,10 @@ struct raid_bdev { */ struct raid_bdev_io { /* WaitQ entry, used only in waitq logic */ - struct spdk_bdev_io_wait_entry waitq_entry; + struct spdk_bdev_io_wait_entry waitq_entry; /* Original channel for this IO, used in queuing logic */ - struct spdk_io_channel *ch; - - /* current buffer location, used in queueing logic */ - uint8_t *buf; + struct spdk_io_channel *ch; }; /*