bdev_aio: enable double buffering on write path
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com> Change-Id: I621a8a3891c8f3829564940219c70c6520c6f9c7 Reviewed-on: https://review.gerrithub.io/427899 Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
807c3a2b27
commit
17d652d720
@ -324,24 +324,17 @@ bdev_aio_reset(struct file_disk *fdisk, struct bdev_aio_task *aio_task)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void bdev_aio_get_buf_cb(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io)
|
static void bdev_aio_get_buf_cb(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io)
|
||||||
{
|
|
||||||
bdev_aio_readv((struct file_disk *)bdev_io->bdev->ctxt,
|
|
||||||
ch,
|
|
||||||
(struct bdev_aio_task *)bdev_io->driver_ctx,
|
|
||||||
bdev_io->u.bdev.iovs,
|
|
||||||
bdev_io->u.bdev.iovcnt,
|
|
||||||
bdev_io->u.bdev.num_blocks * bdev_io->bdev->blocklen,
|
|
||||||
bdev_io->u.bdev.offset_blocks * bdev_io->bdev->blocklen);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _bdev_aio_submit_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io)
|
|
||||||
{
|
{
|
||||||
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, bdev_aio_get_buf_cb,
|
bdev_aio_readv((struct file_disk *)bdev_io->bdev->ctxt,
|
||||||
bdev_io->u.bdev.num_blocks * bdev_io->bdev->blocklen);
|
ch,
|
||||||
return 0;
|
(struct bdev_aio_task *)bdev_io->driver_ctx,
|
||||||
|
bdev_io->u.bdev.iovs,
|
||||||
|
bdev_io->u.bdev.iovcnt,
|
||||||
|
bdev_io->u.bdev.num_blocks * bdev_io->bdev->blocklen,
|
||||||
|
bdev_io->u.bdev.offset_blocks * bdev_io->bdev->blocklen);
|
||||||
|
break;
|
||||||
case SPDK_BDEV_IO_TYPE_WRITE:
|
case SPDK_BDEV_IO_TYPE_WRITE:
|
||||||
bdev_aio_writev((struct file_disk *)bdev_io->bdev->ctxt,
|
bdev_aio_writev((struct file_disk *)bdev_io->bdev->ctxt,
|
||||||
ch,
|
ch,
|
||||||
@ -350,6 +343,23 @@ static int _bdev_aio_submit_request(struct spdk_io_channel *ch, struct spdk_bdev
|
|||||||
bdev_io->u.bdev.iovcnt,
|
bdev_io->u.bdev.iovcnt,
|
||||||
bdev_io->u.bdev.num_blocks * bdev_io->bdev->blocklen,
|
bdev_io->u.bdev.num_blocks * bdev_io->bdev->blocklen,
|
||||||
bdev_io->u.bdev.offset_blocks * bdev_io->bdev->blocklen);
|
bdev_io->u.bdev.offset_blocks * bdev_io->bdev->blocklen);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
SPDK_ERRLOG("Wrong io type\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static int _bdev_aio_submit_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io)
|
||||||
|
{
|
||||||
|
switch (bdev_io->type) {
|
||||||
|
/* Read and write operations must be performed on buffers aligned to
|
||||||
|
* bdev->required_alignment. If user specified unaligned buffers,
|
||||||
|
* get the aligned buffer from the pool by calling spdk_bdev_io_get_buf. */
|
||||||
|
case SPDK_BDEV_IO_TYPE_READ:
|
||||||
|
case SPDK_BDEV_IO_TYPE_WRITE:
|
||||||
|
spdk_bdev_io_get_buf(bdev_io, bdev_aio_get_buf_cb,
|
||||||
|
bdev_io->u.bdev.num_blocks * bdev_io->bdev->blocklen);
|
||||||
return 0;
|
return 0;
|
||||||
case SPDK_BDEV_IO_TYPE_FLUSH:
|
case SPDK_BDEV_IO_TYPE_FLUSH:
|
||||||
bdev_aio_flush((struct file_disk *)bdev_io->bdev->ctxt,
|
bdev_aio_flush((struct file_disk *)bdev_io->bdev->ctxt,
|
||||||
|
Loading…
Reference in New Issue
Block a user