module/raid: put raid_io initialization in one place
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Change-Id: Ie2b647031d00624e3faff57830c6e7e0e645a394 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471082 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com>
This commit is contained in:
parent
152cce0d53
commit
485c79126c
@ -401,11 +401,7 @@ _raid_bdev_submit_reset_request(struct spdk_io_channel *ch, struct spdk_bdev_io
|
|||||||
|
|
||||||
raid_bdev = (struct raid_bdev *)bdev_io->bdev->ctxt;
|
raid_bdev = (struct raid_bdev *)bdev_io->bdev->ctxt;
|
||||||
raid_io = (struct raid_bdev_io *)bdev_io->driver_ctx;
|
raid_io = (struct raid_bdev_io *)bdev_io->driver_ctx;
|
||||||
raid_io->raid_ch = spdk_io_channel_get_ctx(ch);
|
|
||||||
raid_io->base_bdev_io_submitted = 0;
|
|
||||||
raid_io->base_bdev_io_completed = 0;
|
|
||||||
raid_io->base_bdev_io_expected = raid_bdev->num_base_bdevs;
|
raid_io->base_bdev_io_expected = raid_bdev->num_base_bdevs;
|
||||||
raid_io->base_bdev_io_status = SPDK_BDEV_IO_STATUS_SUCCESS;
|
|
||||||
_raid_bdev_submit_reset_request_next(bdev_io);
|
_raid_bdev_submit_reset_request_next(bdev_io);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -422,14 +418,6 @@ _raid_bdev_submit_reset_request(struct spdk_io_channel *ch, struct spdk_bdev_io
|
|||||||
static void
|
static void
|
||||||
_raid_bdev_submit_null_payload_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io)
|
_raid_bdev_submit_null_payload_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io)
|
||||||
{
|
{
|
||||||
struct raid_bdev_io *raid_io;
|
|
||||||
|
|
||||||
raid_io = (struct raid_bdev_io *)bdev_io->driver_ctx;
|
|
||||||
raid_io->raid_ch = spdk_io_channel_get_ctx(ch);
|
|
||||||
raid_io->base_bdev_io_submitted = 0;
|
|
||||||
raid_io->base_bdev_io_completed = 0;
|
|
||||||
raid_io->base_bdev_io_status = SPDK_BDEV_IO_STATUS_SUCCESS;
|
|
||||||
|
|
||||||
SPDK_DEBUGLOG(SPDK_LOG_BDEV_RAID, "raid_bdev: type %d, range (0x%lx, 0x%lx)\n",
|
SPDK_DEBUGLOG(SPDK_LOG_BDEV_RAID, "raid_bdev: type %d, range (0x%lx, 0x%lx)\n",
|
||||||
bdev_io->type, bdev_io->u.bdev.offset_blocks, bdev_io->u.bdev.num_blocks);
|
bdev_io->type, bdev_io->u.bdev.offset_blocks, bdev_io->u.bdev.num_blocks);
|
||||||
|
|
||||||
@ -472,6 +460,13 @@ raid_bdev_get_buf_cb(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io,
|
|||||||
static void
|
static void
|
||||||
raid_bdev_submit_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io)
|
raid_bdev_submit_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io)
|
||||||
{
|
{
|
||||||
|
struct raid_bdev_io *raid_io = (struct raid_bdev_io *)bdev_io->driver_ctx;
|
||||||
|
|
||||||
|
raid_io->raid_ch = spdk_io_channel_get_ctx(ch);
|
||||||
|
raid_io->base_bdev_io_submitted = 0;
|
||||||
|
raid_io->base_bdev_io_completed = 0;
|
||||||
|
raid_io->base_bdev_io_status = SPDK_BDEV_IO_STATUS_SUCCESS;
|
||||||
|
|
||||||
switch (bdev_io->type) {
|
switch (bdev_io->type) {
|
||||||
case SPDK_BDEV_IO_TYPE_READ:
|
case SPDK_BDEV_IO_TYPE_READ:
|
||||||
spdk_bdev_io_get_buf(bdev_io, raid_bdev_get_buf_cb,
|
spdk_bdev_io_get_buf(bdev_io, raid_bdev_get_buf_cb,
|
||||||
|
@ -169,14 +169,11 @@ raid0_waitq_io_process(void *ctx)
|
|||||||
void
|
void
|
||||||
raid0_start_rw_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io)
|
raid0_start_rw_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io)
|
||||||
{
|
{
|
||||||
struct raid_bdev_io *raid_io;
|
|
||||||
struct raid_bdev *raid_bdev;
|
struct raid_bdev *raid_bdev;
|
||||||
uint64_t start_strip = 0;
|
uint64_t start_strip = 0;
|
||||||
uint64_t end_strip = 0;
|
uint64_t end_strip = 0;
|
||||||
|
|
||||||
raid_bdev = (struct raid_bdev *)bdev_io->bdev->ctxt;
|
raid_bdev = (struct raid_bdev *)bdev_io->bdev->ctxt;
|
||||||
raid_io = (struct raid_bdev_io *)bdev_io->driver_ctx;
|
|
||||||
raid_io->raid_ch = spdk_io_channel_get_ctx(ch);
|
|
||||||
start_strip = bdev_io->u.bdev.offset_blocks >> raid_bdev->strip_size_shift;
|
start_strip = bdev_io->u.bdev.offset_blocks >> raid_bdev->strip_size_shift;
|
||||||
end_strip = (bdev_io->u.bdev.offset_blocks + bdev_io->u.bdev.num_blocks - 1) >>
|
end_strip = (bdev_io->u.bdev.offset_blocks + bdev_io->u.bdev.num_blocks - 1) >>
|
||||||
raid_bdev->strip_size_shift;
|
raid_bdev->strip_size_shift;
|
||||||
|
Loading…
Reference in New Issue
Block a user