diff --git a/lib/cache_segtype/cache.c b/lib/cache_segtype/cache.c index 20c575c8c..b6c47b07b 100644 --- a/lib/cache_segtype/cache.c +++ b/lib/cache_segtype/cache.c @@ -423,7 +423,7 @@ static int _modules_needed(struct dm_pool *mem, } #endif /* DEVMAPPER_SUPPORT */ -static struct segtype_handler _cache_pool_ops = { +static const struct segtype_handler _cache_pool_ops = { .display = _cache_display, .text_import = _cache_pool_text_import, .text_import_area_count = _cache_pool_text_import_area_count, @@ -762,7 +762,7 @@ static int _cache_add_target_line(struct dev_manager *dm, } #endif /* DEVMAPPER_SUPPORT */ -static struct segtype_handler _cache_ops = { +static const struct segtype_handler _cache_ops = { .display = _cache_display, .text_import = _cache_text_import, .text_import_area_count = _cache_text_import_area_count, diff --git a/lib/error/errseg.c b/lib/error/errseg.c index bbdf235b8..50f3b8c90 100644 --- a/lib/error/errseg.c +++ b/lib/error/errseg.c @@ -81,7 +81,7 @@ static void _errseg_destroy(struct segment_type *segtype) free(segtype); } -static struct segtype_handler _error_ops = { +static const struct segtype_handler _error_ops = { .merge_segments = _errseg_merge_segments, #ifdef DEVMAPPER_SUPPORT .add_target_line = _errseg_add_target_line, diff --git a/lib/integrity/integrity.c b/lib/integrity/integrity.c index e4f99b400..1576c856f 100644 --- a/lib/integrity/integrity.c +++ b/lib/integrity/integrity.c @@ -307,7 +307,7 @@ static int _integrity_add_target_line(struct dev_manager *dm, } #endif /* DEVMAPPER_SUPPORT */ -static struct segtype_handler _integrity_ops = { +static const struct segtype_handler _integrity_ops = { .display = _integrity_display, .text_import = _integrity_text_import, .text_import_area_count = _integrity_text_import_area_count, diff --git a/lib/metadata/segtype.h b/lib/metadata/segtype.h index 54f3f8330..9f16cdb7c 100644 --- a/lib/metadata/segtype.h +++ b/lib/metadata/segtype.h @@ -236,7 +236,7 @@ struct segment_type { uint64_t flags; uint32_t parity_devs; /* Parity drives required by segtype */ - struct segtype_handler *ops; + const struct segtype_handler *ops; const char *name; const char *dso; diff --git a/lib/mirror/mirrored.c b/lib/mirror/mirrored.c index 83f1bffcb..cdf7a0d48 100644 --- a/lib/mirror/mirrored.c +++ b/lib/mirror/mirrored.c @@ -491,7 +491,7 @@ static void _mirrored_destroy(struct segment_type *segtype) free(segtype); } -static struct segtype_handler _mirrored_ops = { +static const struct segtype_handler _mirrored_ops = { .display = _mirrored_display, .text_import_area_count = _mirrored_text_import_area_count, .text_import = _mirrored_text_import, diff --git a/lib/raid/raid.c b/lib/raid/raid.c index 2f1eb6cf8..9732c3dd5 100644 --- a/lib/raid/raid.c +++ b/lib/raid/raid.c @@ -616,7 +616,7 @@ static int _raid_target_unmonitor_events(struct lv_segment *seg, int events) # endif /* DMEVENTD */ #endif /* DEVMAPPER_SUPPORT */ -static struct segtype_handler _raid_ops = { +static const struct segtype_handler _raid_ops = { .display = _raid_display, .text_import_area_count = _raid_text_import_area_count, .text_import = _raid_text_import, diff --git a/lib/snapshot/snapshot.c b/lib/snapshot/snapshot.c index 8446a6914..0ec5320c5 100644 --- a/lib/snapshot/snapshot.c +++ b/lib/snapshot/snapshot.c @@ -229,7 +229,7 @@ static void _snap_destroy(struct segment_type *segtype) free(segtype); } -static struct segtype_handler _snapshot_ops = { +static const struct segtype_handler _snapshot_ops = { .target_name = _snap_target_name, .text_import = _snap_text_import, .text_export = _snap_text_export, diff --git a/lib/striped/striped.c b/lib/striped/striped.c index efed16982..1ff1ebdad 100644 --- a/lib/striped/striped.c +++ b/lib/striped/striped.c @@ -216,7 +216,7 @@ static void _striped_destroy(struct segment_type *segtype) free(segtype); } -static struct segtype_handler _striped_ops = { +static const struct segtype_handler _striped_ops = { .name = _striped_name, .display = _striped_display, .text_import_area_count = _striped_text_import_area_count, diff --git a/lib/thin/thin.c b/lib/thin/thin.c index 9ce04438d..eba2cce30 100644 --- a/lib/thin/thin.c +++ b/lib/thin/thin.c @@ -743,7 +743,7 @@ static void _thin_destroy(struct segment_type *segtype) free(segtype); } -static struct segtype_handler _thin_pool_ops = { +static const struct segtype_handler _thin_pool_ops = { .display = _thin_pool_display, .text_import = _thin_pool_text_import, .text_import_area_count = _thin_pool_text_import_area_count, @@ -762,7 +762,7 @@ static struct segtype_handler _thin_pool_ops = { .destroy = _thin_destroy, }; -static struct segtype_handler _thin_ops = { +static const struct segtype_handler _thin_ops = { .display = _thin_display, .text_import = _thin_text_import, .text_export = _thin_text_export, @@ -783,7 +783,7 @@ int init_multiple_segtypes(struct cmd_context *cmd, struct segtype_library *segl #endif { static const struct { - struct segtype_handler *ops; + const struct segtype_handler *ops; const char name[16]; uint32_t flags; } reg_segtypes[] = { diff --git a/lib/unknown/unknown.c b/lib/unknown/unknown.c index b7c06ace6..51aaebba5 100644 --- a/lib/unknown/unknown.c +++ b/lib/unknown/unknown.c @@ -54,7 +54,7 @@ static void _unknown_destroy(struct segment_type *segtype) free(segtype); } -static struct segtype_handler _unknown_ops = { +static const struct segtype_handler _unknown_ops = { .text_import = _unknown_text_import, .text_export = _unknown_text_export, .destroy = _unknown_destroy, diff --git a/lib/vdo/vdo.c b/lib/vdo/vdo.c index 6d3b67421..75a73eb57 100644 --- a/lib/vdo/vdo.c +++ b/lib/vdo/vdo.c @@ -562,7 +562,7 @@ static void _vdo_pool_destroy(struct segment_type *segtype) free((void *)segtype); } -static struct segtype_handler _vdo_ops = { +static const struct segtype_handler _vdo_ops = { .name = _vdo_name, .display = _vdo_display, .text_import = _vdo_text_import, @@ -578,7 +578,7 @@ static struct segtype_handler _vdo_ops = { .destroy = _vdo_pool_destroy, }; -static struct segtype_handler _vdo_pool_ops = { +static const struct segtype_handler _vdo_pool_ops = { .name = _vdo_pool_name, .display = _vdo_pool_display, .text_import = _vdo_pool_text_import, diff --git a/lib/writecache/writecache.c b/lib/writecache/writecache.c index 8ccaca2d0..4d56317f5 100644 --- a/lib/writecache/writecache.c +++ b/lib/writecache/writecache.c @@ -357,7 +357,7 @@ static int _writecache_add_target_line(struct dev_manager *dm, } #endif /* DEVMAPPER_SUPPORT */ -static struct segtype_handler _writecache_ops = { +static const struct segtype_handler _writecache_ops = { .display = _writecache_display, .text_import = _writecache_text_import, .text_import_area_count = _writecache_text_import_area_count, diff --git a/lib/zero/zero.c b/lib/zero/zero.c index cb204fc40..3e5bdbdc9 100644 --- a/lib/zero/zero.c +++ b/lib/zero/zero.c @@ -75,7 +75,7 @@ static void _zero_destroy(struct segment_type *segtype) free(segtype); } -static struct segtype_handler _zero_ops = { +static const struct segtype_handler _zero_ops = { .merge_segments = _zero_merge_segments, #ifdef DEVMAPPER_SUPPORT .add_target_line = _zero_add_target_line,