bdev: call spdk_bdev_io_get_buf before splitting
We cannot split an iov if a buffer hasn't been allocated yet. So always call spdk_bdev_io_get_buf on reads before trying to split. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I2c26efb9dc6cb2c7c3e3b7ae5bab2c37844b9113 Reviewed-on: https://review.gerrithub.io/424879 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
parent
0a4a217c2f
commit
01e7c02e15
@ -1229,7 +1229,7 @@ _spdk_bdev_io_split_done(struct spdk_bdev_io *bdev_io, bool success, void *cb_ar
|
||||
}
|
||||
|
||||
static void
|
||||
_spdk_bdev_io_split(struct spdk_bdev_io *bdev_io)
|
||||
_spdk_bdev_io_split(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io)
|
||||
{
|
||||
assert(_spdk_bdev_io_type_can_split(bdev_io->type));
|
||||
|
||||
@ -1287,7 +1287,12 @@ spdk_bdev_io_submit(struct spdk_bdev_io *bdev_io)
|
||||
assert(bdev_io->internal.status == SPDK_BDEV_IO_STATUS_PENDING);
|
||||
|
||||
if (bdev->split_on_optimal_io_boundary && _spdk_bdev_io_should_split(bdev_io)) {
|
||||
_spdk_bdev_io_split(bdev_io);
|
||||
if (bdev_io->type == SPDK_BDEV_IO_TYPE_READ) {
|
||||
spdk_bdev_io_get_buf(bdev_io, _spdk_bdev_io_split,
|
||||
bdev_io->u.bdev.num_blocks * bdev_io->bdev->blocklen);
|
||||
} else {
|
||||
_spdk_bdev_io_split(NULL, bdev_io);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user