Commit 0b6b572f authored by Seth Howell's avatar Seth Howell Committed by Daniel Verkamp
Browse files

lib/bdev_malloc: add support for the write_zeroes I/O type



Change-Id: Id66d773ff66a9cd1da6cf2515b3fe765cd8edbd6
Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/373971


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 8d70322a
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -320,6 +320,15 @@ static int _bdev_malloc_submit_request(struct spdk_io_channel *ch, struct spdk_b
					 (struct malloc_task *)bdev_io->driver_ctx,
					 bdev_io->u.unmap.offset,
					 bdev_io->u.unmap.len);

	case SPDK_BDEV_IO_TYPE_WRITE_ZEROES:
		/* bdev_malloc_unmap is implemented with a call to mem_cpy_fill which zeroes out all of the requested bytes. */
		return bdev_malloc_unmap((struct malloc_disk *)bdev_io->bdev->ctxt,
					 ch,
					 (struct malloc_task *)bdev_io->driver_ctx,
					 bdev_io->u.write.offset,
					 bdev_io->u.write.len);

	default:
		return -1;
	}
@@ -342,6 +351,7 @@ bdev_malloc_io_type_supported(void *ctx, enum spdk_bdev_io_type io_type)
	case SPDK_BDEV_IO_TYPE_FLUSH:
	case SPDK_BDEV_IO_TYPE_RESET:
	case SPDK_BDEV_IO_TYPE_UNMAP:
	case SPDK_BDEV_IO_TYPE_WRITE_ZEROES:
		return true;

	default: