test/nvme/deallocated_value: switch to spdk_*malloc().

spdk_dma_*malloc() is about to be deprecated.

Change-Id: I3c3c65829ea9479ec6574716f41ed61fb0a8d81c
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459555
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Darek Stojaczyk 2019-06-27 07:09:19 +02:00 committed by Changpeng Liu
parent e36f9cc73d
commit 3708070daf

View File

@ -242,7 +242,8 @@ deallocate_test(void)
memset(context.FFh_buf, 0xFF, max_block_size);
for (i = 0; i < NUM_BLOCKS; i++) {
context.write_buf[i] = spdk_dma_zmalloc(0x1000, max_block_size, NULL);
context.write_buf[i] = spdk_zmalloc(0x1000, max_block_size, NULL, SPDK_ENV_LCORE_ID_ANY,
SPDK_MALLOC_DMA);
if (context.write_buf[i] == NULL) {
printf("could not allocate buffer for test.\n");
cleanup(&context);
@ -250,7 +251,8 @@ deallocate_test(void)
}
fill_random(context.write_buf[i], 0x1000);
context.read_buf[i] = spdk_dma_zmalloc(0x1000, max_block_size, NULL);
context.read_buf[i] = spdk_zmalloc(0x1000, max_block_size, NULL, SPDK_ENV_LCORE_ID_ANY,
SPDK_MALLOC_DMA);
if (context.read_buf[i] == NULL) {
printf("could not allocate buffer for test.\n");
cleanup(&context);
@ -396,12 +398,12 @@ cleanup(struct deallocate_context *context)
}
for (i = 0; i < NUM_BLOCKS; i++) {
if (context->write_buf && context->write_buf[i]) {
spdk_dma_free(context->write_buf[i]);
spdk_free(context->write_buf[i]);
} else {
break;
}
if (context->read_buf && context->read_buf[i]) {
spdk_dma_free(context->read_buf[i]);
spdk_free(context->read_buf[i]);
} else {
break;
}