module/raid: add raid_bdev pointer to struct raid_io

This will make it easier to get to the raid_bdev when we only have the
raid_io.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I91df14f788a51ada10b0f8356de2162c1f34520c
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471085
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Artur Paszkiewicz 2019-10-10 12:07:02 +02:00 committed by Tomasz Zawadzki
parent 5b88597ac6
commit cb8dbf17dc
3 changed files with 8 additions and 4 deletions

View File

@ -327,7 +327,7 @@ raid_bdev_queue_io_wait(struct spdk_bdev_io *raid_bdev_io, uint8_t pd_idx,
spdk_bdev_io_wait_cb cb_fn, int ret)
{
struct raid_bdev_io *raid_io = (struct raid_bdev_io *)raid_bdev_io->driver_ctx;
struct raid_bdev *raid_bdev = (struct raid_bdev *)raid_bdev_io->bdev->ctxt;
struct raid_bdev *raid_bdev = raid_io->raid_bdev;
assert(ret != 0);
@ -377,7 +377,7 @@ raid_bdev_submit_reset_request(struct raid_bdev_io *raid_io)
uint8_t i;
bdev_io = spdk_bdev_io_from_ctx(raid_io);
raid_bdev = (struct raid_bdev *)bdev_io->bdev->ctxt;
raid_bdev = raid_io->raid_bdev;
raid_io->base_bdev_io_expected = raid_bdev->num_base_bdevs;
@ -436,6 +436,7 @@ raid_bdev_submit_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_i
{
struct raid_bdev_io *raid_io = (struct raid_bdev_io *)bdev_io->driver_ctx;
raid_io->raid_bdev = bdev_io->bdev->ctxt;
raid_io->raid_ch = spdk_io_channel_get_ctx(ch);
raid_io->base_bdev_io_submitted = 0;
raid_io->base_bdev_io_completed = 0;

View File

@ -90,6 +90,9 @@ struct raid_base_bdev_info {
* related to bdev_io for a raid bdev
*/
struct raid_bdev_io {
/* The raid bdev associated with this IO */
struct raid_bdev *raid_bdev;
/* WaitQ entry, used only in waitq logic */
struct spdk_bdev_io_wait_entry waitq_entry;

View File

@ -82,7 +82,7 @@ raid0_submit_rw_request(struct raid_bdev_io *raid_io)
{
struct spdk_bdev_io *bdev_io = spdk_bdev_io_from_ctx(raid_io);
struct raid_bdev_io_channel *raid_ch = raid_io->raid_ch;
struct raid_bdev *raid_bdev = (struct raid_bdev *)bdev_io->bdev->ctxt;
struct raid_bdev *raid_bdev = raid_io->raid_bdev;
uint64_t pd_strip;
uint32_t offset_in_strip;
uint64_t pd_lba;
@ -284,7 +284,7 @@ raid0_submit_null_payload_request(struct raid_bdev_io *raid_io)
int ret;
bdev_io = spdk_bdev_io_from_ctx(raid_io);
raid_bdev = (struct raid_bdev *)bdev_io->bdev->ctxt;
raid_bdev = raid_io->raid_bdev;
_raid0_get_io_range(&io_range, raid_bdev->num_base_bdevs,
raid_bdev->strip_size, raid_bdev->strip_size_shift,