bdev/rbd: add write zeroes support

Add write zeroes support to rbd bdev.

Change-Id: I77213709de612a750d6343021addf52db31d7bca
Signed-off-by: Jonas Pfefferle <pepperjo@japf.ch>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11823
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Jonas Pfefferle 2022-03-07 11:09:59 +01:00 committed by Tomasz Zawadzki
parent 027bfbb3dd
commit 8ccdd956d2

View File

@ -451,6 +451,8 @@ bdev_rbd_start_aio(struct bdev_rbd *disk, struct spdk_bdev_io *bdev_io,
}
} else if (bdev_io->type == SPDK_BDEV_IO_TYPE_FLUSH) {
ret = rbd_aio_flush(image, rbd_io->comp);
} else if (bdev_io->type == SPDK_BDEV_IO_TYPE_WRITE_ZEROES) {
ret = rbd_aio_write_zeroes(image, offset, len, rbd_io->comp, /* zero_flags */ 0, /* op_flags */ 0);
}
if (ret < 0) {
@ -604,6 +606,7 @@ _bdev_rbd_submit_request(void *ctx)
case SPDK_BDEV_IO_TYPE_WRITE:
case SPDK_BDEV_IO_TYPE_FLUSH:
case SPDK_BDEV_IO_TYPE_WRITE_ZEROES:
bdev_rbd_start_aio(disk,
bdev_io,
bdev_io->u.bdev.iovs,
@ -647,6 +650,7 @@ bdev_rbd_io_type_supported(void *ctx, enum spdk_bdev_io_type io_type)
case SPDK_BDEV_IO_TYPE_WRITE:
case SPDK_BDEV_IO_TYPE_FLUSH:
case SPDK_BDEV_IO_TYPE_RESET:
case SPDK_BDEV_IO_TYPE_WRITE_ZEROES:
return true;
default: