From 5072b1df80e2057c1f2ceec97afdcb84976d770f Mon Sep 17 00:00:00 2001 From: Konrad Sztyber Date: Thu, 16 Dec 2021 11:22:04 +0100 Subject: [PATCH] bdev/malloc: remove bdev_malloc_(reset|flush) The only thing these functions were doing was completing the IO, so it could just be inlined. Signed-off-by: Konrad Sztyber Change-Id: I5fbd9df763dd68953b1bda9c7752c57ef9ee5dd6 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10804 Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins Reviewed-by: Aleksey Marchuk Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- module/bdev/malloc/bdev_malloc.c | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/module/bdev/malloc/bdev_malloc.c b/module/bdev/malloc/bdev_malloc.c index 3cd47254b..908c6de02 100644 --- a/module/bdev/malloc/bdev_malloc.c +++ b/module/bdev/malloc/bdev_malloc.c @@ -225,23 +225,6 @@ bdev_malloc_unmap(struct malloc_disk *mdisk, byte_count, malloc_done, task); } -static int64_t -bdev_malloc_flush(struct malloc_disk *mdisk, struct malloc_task *task, - uint64_t offset, uint64_t nbytes) -{ - spdk_bdev_io_complete(spdk_bdev_io_from_ctx(task), SPDK_BDEV_IO_STATUS_SUCCESS); - - return 0; -} - -static int -bdev_malloc_reset(struct malloc_disk *mdisk, struct malloc_task *task) -{ - spdk_bdev_io_complete(spdk_bdev_io_from_ctx(task), SPDK_BDEV_IO_STATUS_SUCCESS); - - return 0; -} - static int _bdev_malloc_submit_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io) { struct malloc_channel *mch = spdk_io_channel_get_ctx(ch); @@ -279,14 +262,12 @@ static int _bdev_malloc_submit_request(struct spdk_io_channel *ch, struct spdk_b return 0; case SPDK_BDEV_IO_TYPE_RESET: - return bdev_malloc_reset((struct malloc_disk *)bdev_io->bdev->ctxt, - (struct malloc_task *)bdev_io->driver_ctx); + spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_SUCCESS); + return 0; case SPDK_BDEV_IO_TYPE_FLUSH: - return bdev_malloc_flush((struct malloc_disk *)bdev_io->bdev->ctxt, - (struct malloc_task *)bdev_io->driver_ctx, - bdev_io->u.bdev.offset_blocks * block_size, - bdev_io->u.bdev.num_blocks * block_size); + spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_SUCCESS); + return 0; case SPDK_BDEV_IO_TYPE_UNMAP: return bdev_malloc_unmap((struct malloc_disk *)bdev_io->bdev->ctxt,