raid0: Use extended bdev rw API
That is a preparation for support of memory domains in bdev_raid Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com> Change-Id: I3a6e01eccd4d7e4bc197dc5ffe268d42081d41de Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11429 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
1299439f3d
commit
99719ef049
@ -3,6 +3,7 @@
|
||||
*
|
||||
* Copyright (c) Intel Corporation.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@ -132,15 +133,15 @@ raid0_submit_rw_request(struct raid_bdev_io *raid_io)
|
||||
assert(raid_ch->base_channel);
|
||||
base_ch = raid_ch->base_channel[pd_idx];
|
||||
if (bdev_io->type == SPDK_BDEV_IO_TYPE_READ) {
|
||||
ret = spdk_bdev_readv_blocks(base_info->desc, base_ch,
|
||||
bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt,
|
||||
pd_lba, pd_blocks, raid0_bdev_io_completion,
|
||||
raid_io);
|
||||
ret = spdk_bdev_readv_blocks_ext(base_info->desc, base_ch,
|
||||
bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt,
|
||||
pd_lba, pd_blocks, raid0_bdev_io_completion,
|
||||
raid_io, bdev_io->u.bdev.ext_opts);
|
||||
} else if (bdev_io->type == SPDK_BDEV_IO_TYPE_WRITE) {
|
||||
ret = spdk_bdev_writev_blocks(base_info->desc, base_ch,
|
||||
bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt,
|
||||
pd_lba, pd_blocks, raid0_bdev_io_completion,
|
||||
raid_io);
|
||||
ret = spdk_bdev_writev_blocks_ext(base_info->desc, base_ch,
|
||||
bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt,
|
||||
pd_lba, pd_blocks, raid0_bdev_io_completion,
|
||||
raid_io, bdev_io->u.bdev.ext_opts);
|
||||
} else {
|
||||
SPDK_ERRLOG("Recvd not supported io type %u\n", bdev_io->type);
|
||||
assert(0);
|
||||
|
@ -3,6 +3,7 @@
|
||||
*
|
||||
* Copyright (c) Intel Corporation.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@ -311,6 +312,16 @@ spdk_bdev_writev_blocks(struct spdk_bdev_desc *desc, struct spdk_io_channel *ch,
|
||||
return g_bdev_io_submit_status;
|
||||
}
|
||||
|
||||
int
|
||||
spdk_bdev_writev_blocks_ext(struct spdk_bdev_desc *desc, struct spdk_io_channel *ch,
|
||||
struct iovec *iov, int iovcnt,
|
||||
uint64_t offset_blocks, uint64_t num_blocks,
|
||||
spdk_bdev_io_completion_cb cb, void *cb_arg,
|
||||
struct spdk_bdev_ext_io_opts *opts)
|
||||
{
|
||||
return spdk_bdev_writev_blocks(desc, ch, iov, iovcnt, offset_blocks, num_blocks, cb, cb_arg);
|
||||
}
|
||||
|
||||
int
|
||||
spdk_bdev_reset(struct spdk_bdev_desc *desc, struct spdk_io_channel *ch,
|
||||
spdk_bdev_io_completion_cb cb, void *cb_arg)
|
||||
@ -460,6 +471,16 @@ spdk_bdev_readv_blocks(struct spdk_bdev_desc *desc, struct spdk_io_channel *ch,
|
||||
return g_bdev_io_submit_status;
|
||||
}
|
||||
|
||||
int
|
||||
spdk_bdev_readv_blocks_ext(struct spdk_bdev_desc *desc, struct spdk_io_channel *ch,
|
||||
struct iovec *iov, int iovcnt,
|
||||
uint64_t offset_blocks, uint64_t num_blocks,
|
||||
spdk_bdev_io_completion_cb cb, void *cb_arg,
|
||||
struct spdk_bdev_ext_io_opts *opts)
|
||||
{
|
||||
return spdk_bdev_readv_blocks(desc, ch, iov, iovcnt, offset_blocks, num_blocks, cb, cb_arg);
|
||||
}
|
||||
|
||||
void
|
||||
spdk_bdev_module_release_bdev(struct spdk_bdev *bdev)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user