From 7bdba4437d33b63c0dd3e08e2a5e3ed12d45e4a7 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Tue, 30 Aug 2016 12:56:06 -0700 Subject: [PATCH] bdev: make fn_table a const pointer The table of bdev function pointers should not need to be modified at runtime. Change-Id: I3e8876fc83df9296ce528231269b1a905c96072c Signed-off-by: Daniel Verkamp --- include/spdk/bdev.h | 2 +- lib/bdev/aio/blockdev_aio.c | 2 +- lib/bdev/malloc/blockdev_malloc.c | 2 +- lib/bdev/nvme/blockdev_nvme.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/spdk/bdev.h b/include/spdk/bdev.h index b7198ea327..e5e4f4cc1a 100644 --- a/include/spdk/bdev.h +++ b/include/spdk/bdev.h @@ -90,7 +90,7 @@ struct spdk_bdev { int thin_provisioning; /** function table for all LUN ops */ - struct spdk_bdev_fn_table *fn_table; + const struct spdk_bdev_fn_table *fn_table; /** Represents maximum unmap block descriptor count */ uint32_t max_unmap_bdesc_count; diff --git a/lib/bdev/aio/blockdev_aio.c b/lib/bdev/aio/blockdev_aio.c index ddfba25978..4f2251a7aa 100644 --- a/lib/bdev/aio/blockdev_aio.c +++ b/lib/bdev/aio/blockdev_aio.c @@ -288,7 +288,7 @@ blockdev_aio_io_type_supported(struct spdk_bdev *bdev, enum spdk_bdev_io_type io } } -static struct spdk_bdev_fn_table aio_fn_table = { +static const struct spdk_bdev_fn_table aio_fn_table = { .destruct = blockdev_aio_destruct, .check_io = blockdev_aio_check_io, .submit_request = blockdev_aio_submit_request, diff --git a/lib/bdev/malloc/blockdev_malloc.c b/lib/bdev/malloc/blockdev_malloc.c index 9ca3d13ff7..5d6081a150 100644 --- a/lib/bdev/malloc/blockdev_malloc.c +++ b/lib/bdev/malloc/blockdev_malloc.c @@ -266,7 +266,7 @@ blockdev_malloc_io_type_supported(struct spdk_bdev *bdev, enum spdk_bdev_io_type } } -static struct spdk_bdev_fn_table malloc_fn_table = { +static const struct spdk_bdev_fn_table malloc_fn_table = { .destruct = blockdev_malloc_destruct, .check_io = blockdev_malloc_check_io, .submit_request = blockdev_malloc_submit_request, diff --git a/lib/bdev/nvme/blockdev_nvme.c b/lib/bdev/nvme/blockdev_nvme.c index a60c3ccfaf..de0daa4ad7 100644 --- a/lib/bdev/nvme/blockdev_nvme.c +++ b/lib/bdev/nvme/blockdev_nvme.c @@ -294,7 +294,7 @@ blockdev_nvme_io_type_supported(struct spdk_bdev *bdev, enum spdk_bdev_io_type i } } -static struct spdk_bdev_fn_table nvmelib_fn_table = { +static const struct spdk_bdev_fn_table nvmelib_fn_table = { .destruct = blockdev_nvme_destruct, .check_io = blockdev_nvme_check_io, .submit_request = blockdev_nvme_submit_request,