diff --git a/examples/blob/cli/blobcli.c b/examples/blob/cli/blobcli.c index e52b77561..eec132b6a 100644 --- a/examples/blob/cli/blobcli.c +++ b/examples/blob/cli/blobcli.c @@ -197,7 +197,7 @@ static void cli_cleanup(struct cli_context_t *cli_context) { if (cli_context->buff) { - spdk_dma_free(cli_context->buff); + spdk_free(cli_context->buff); } if (cli_context->cli_mode == CLI_MODE_SCRIPT) { int i; @@ -685,8 +685,8 @@ dump_imp_open_cb(void *cb_arg, struct spdk_blob *blob, int bserrno) * We'll transfer just one io_unit at a time to keep the buffer * small. This could be bigger of course. */ - cli_context->buff = spdk_dma_malloc(cli_context->io_unit_size, - ALIGN_4K, NULL); + cli_context->buff = spdk_malloc(cli_context->io_unit_size, ALIGN_4K, NULL, + SPDK_ENV_LCORE_ID_ANY, SPDK_MALLOC_DMA); if (cli_context->buff == NULL) { printf("Error in allocating memory\n"); spdk_blob_close(cli_context->blob, close_cb, cli_context); @@ -780,8 +780,8 @@ fill_blob_cb(void *arg1, struct spdk_blob *blob, int bserrno) cli_context->blob = blob; cli_context->io_unit_count = 0; cli_context->blob_io_units = spdk_blob_get_num_io_units(cli_context->blob); - cli_context->buff = spdk_dma_malloc(cli_context->io_unit_size, - ALIGN_4K, NULL); + cli_context->buff = spdk_malloc(cli_context->io_unit_size, ALIGN_4K, NULL, + SPDK_ENV_LCORE_ID_ANY, SPDK_MALLOC_DMA); if (cli_context->buff == NULL) { unload_bs(cli_context, "Error in allocating memory", -ENOMEM); diff --git a/examples/blob/hello_world/hello_blob.c b/examples/blob/hello_world/hello_blob.c index 02207678c..7255b9610 100644 --- a/examples/blob/hello_world/hello_blob.c +++ b/examples/blob/hello_world/hello_blob.c @@ -61,8 +61,8 @@ struct hello_context_t { static void hello_cleanup(struct hello_context_t *hello_context) { - spdk_dma_free(hello_context->read_buff); - spdk_dma_free(hello_context->write_buff); + spdk_free(hello_context->read_buff); + spdk_free(hello_context->write_buff); free(hello_context); } @@ -179,8 +179,9 @@ read_blob(struct hello_context_t *hello_context) { SPDK_NOTICELOG("entry\n"); - hello_context->read_buff = spdk_dma_malloc(hello_context->page_size, - 0x1000, NULL); + hello_context->read_buff = spdk_malloc(hello_context->page_size, + 0x1000, NULL, SPDK_ENV_LCORE_ID_ANY, + SPDK_MALLOC_DMA); if (hello_context->read_buff == NULL) { unload_bs(hello_context, "Error in memory allocation", -ENOMEM); @@ -224,8 +225,9 @@ blob_write(struct hello_context_t *hello_context) * Buffers for data transfer need to be allocated via SPDK. We will * tranfer 1 page of 4K aligned data at offset 0 in the blob. */ - hello_context->write_buff = spdk_dma_malloc(hello_context->page_size, - 0x1000, NULL); + hello_context->write_buff = spdk_malloc(hello_context->page_size, + 0x1000, NULL, SPDK_ENV_LCORE_ID_ANY, + SPDK_MALLOC_DMA); if (hello_context->write_buff == NULL) { unload_bs(hello_context, "Error in allocating memory", -ENOMEM); diff --git a/lib/blobfs/blobfs.c b/lib/blobfs/blobfs.c index 17dcce80e..58fffbe19 100644 --- a/lib/blobfs/blobfs.c +++ b/lib/blobfs/blobfs.c @@ -1579,7 +1579,7 @@ __rw_done(void *ctx, int bserrno) struct spdk_fs_request *req = ctx; struct spdk_fs_cb_args *args = &req->args; - spdk_dma_free(args->op.rw.pin_buf); + spdk_free(args->op.rw.pin_buf); args->fn.file_op(args->arg, bserrno); free_fs_request(req); } @@ -1671,7 +1671,8 @@ __readwrite(struct spdk_file *file, struct spdk_io_channel *_channel, args->op.rw.blocklen = lba_size; pin_buf_length = num_lba * lba_size; - args->op.rw.pin_buf = spdk_dma_malloc(pin_buf_length, lba_size, NULL); + args->op.rw.pin_buf = spdk_malloc(pin_buf_length, lba_size, NULL, + SPDK_ENV_SOCKET_ID_ANY, SPDK_MALLOC_DMA); if (args->op.rw.pin_buf == NULL) { SPDK_DEBUGLOG(SPDK_LOG_BLOBFS, "Failed to allocate buf for: file=%s offset=%jx length=%jx\n", file->name, offset, length);