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,