mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Remove const usage from destroy callbacks
As const segment_type or const format_type are never released use their non-const version and remove const downcast from dm_free calls. This change fixes many gcc warnings we were getting from them.
This commit is contained in:
parent
66781f5d5a
commit
9d9de35dca
@ -81,9 +81,9 @@ static int _errseg_modules_needed(struct dm_pool *mem,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _errseg_destroy(const struct segment_type *segtype)
|
static void _errseg_destroy(struct segment_type *segtype)
|
||||||
{
|
{
|
||||||
dm_free((void *)segtype);
|
dm_free(segtype);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct segtype_handler _error_ops = {
|
static struct segtype_handler _error_ops = {
|
||||||
|
@ -555,9 +555,9 @@ static void _format1_destroy_instance(struct format_instance *fid __attribute__(
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _format1_destroy(const struct format_type *fmt)
|
static void _format1_destroy(struct format_type *fmt)
|
||||||
{
|
{
|
||||||
dm_free((void *) fmt);
|
dm_free(fmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct format_handler _format1_ops = {
|
static struct format_handler _format1_ops = {
|
||||||
|
@ -286,9 +286,9 @@ static void _pool_destroy_instance(struct format_instance *fid __attribute__((un
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _pool_destroy(const struct format_type *fmt)
|
static void _pool_destroy(struct format_type *fmt)
|
||||||
{
|
{
|
||||||
dm_free((void *) fmt);
|
dm_free(fmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
|
@ -1719,7 +1719,7 @@ static void _free_raws(struct dm_list *raw_list)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _text_destroy(const struct format_type *fmt)
|
static void _text_destroy(struct format_type *fmt)
|
||||||
{
|
{
|
||||||
if (fmt->private) {
|
if (fmt->private) {
|
||||||
_free_dirs(&((struct mda_lists *) fmt->private)->dirs);
|
_free_dirs(&((struct mda_lists *) fmt->private)->dirs);
|
||||||
@ -1727,7 +1727,7 @@ static void _text_destroy(const struct format_type *fmt)
|
|||||||
dm_free(fmt->private);
|
dm_free(fmt->private);
|
||||||
}
|
}
|
||||||
|
|
||||||
dm_free((void *)fmt);
|
dm_free(fmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct metadata_area_ops _metadata_text_file_ops = {
|
static struct metadata_area_ops _metadata_text_file_ops = {
|
||||||
|
@ -31,9 +31,9 @@ static const char *_freeseg_name(const struct lv_segment *seg)
|
|||||||
return seg->segtype->name;
|
return seg->segtype->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _freeseg_destroy(const struct segment_type *segtype)
|
static void _freeseg_destroy(struct segment_type *segtype)
|
||||||
{
|
{
|
||||||
dm_free((void *)segtype);
|
dm_free(segtype);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct segtype_handler _freeseg_ops = {
|
static struct segtype_handler _freeseg_ops = {
|
||||||
|
@ -291,7 +291,7 @@ struct format_handler {
|
|||||||
/*
|
/*
|
||||||
* Destructor for format type
|
* Destructor for format type
|
||||||
*/
|
*/
|
||||||
void (*destroy) (const struct format_type * fmt);
|
void (*destroy) (struct format_type * fmt);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -97,7 +97,7 @@ struct segtype_handler {
|
|||||||
int (*modules_needed) (struct dm_pool *mem,
|
int (*modules_needed) (struct dm_pool *mem,
|
||||||
const struct lv_segment *seg,
|
const struct lv_segment *seg,
|
||||||
struct dm_list *modules);
|
struct dm_list *modules);
|
||||||
void (*destroy) (const struct segment_type * segtype);
|
void (*destroy) (struct segment_type * segtype);
|
||||||
int (*target_monitored) (struct lv_segment *seg, int *pending);
|
int (*target_monitored) (struct lv_segment *seg, int *pending);
|
||||||
int (*target_monitor_events) (struct lv_segment *seg, int events);
|
int (*target_monitor_events) (struct lv_segment *seg, int events);
|
||||||
int (*target_unmonitor_events) (struct lv_segment *seg, int events);
|
int (*target_unmonitor_events) (struct lv_segment *seg, int events);
|
||||||
|
@ -600,9 +600,9 @@ static int _mirrored_modules_needed(struct dm_pool *mem,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _mirrored_destroy(const struct segment_type *segtype)
|
static void _mirrored_destroy(struct segment_type *segtype)
|
||||||
{
|
{
|
||||||
dm_free((void *) segtype);
|
dm_free(segtype);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct segtype_handler _mirrored_ops = {
|
static struct segtype_handler _mirrored_ops = {
|
||||||
|
@ -406,9 +406,9 @@ static int _replicator_modules_needed(struct dm_pool *mem,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _replicator_destroy(const struct segment_type *segtype)
|
static void _replicator_destroy(struct segment_type *segtype)
|
||||||
{
|
{
|
||||||
dm_free((void *)segtype);
|
dm_free(segtype);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct segtype_handler _replicator_ops = {
|
static struct segtype_handler _replicator_ops = {
|
||||||
|
@ -218,9 +218,9 @@ static int _snap_modules_needed(struct dm_pool *mem,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _snap_destroy(const struct segment_type *segtype)
|
static void _snap_destroy(struct segment_type *segtype)
|
||||||
{
|
{
|
||||||
dm_free((void *)segtype);
|
dm_free(segtype);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct segtype_handler _snapshot_ops = {
|
static struct segtype_handler _snapshot_ops = {
|
||||||
|
@ -199,9 +199,9 @@ static int _striped_target_present(struct cmd_context *cmd,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void _striped_destroy(const struct segment_type *segtype)
|
static void _striped_destroy(struct segment_type *segtype)
|
||||||
{
|
{
|
||||||
dm_free((void *)segtype);
|
dm_free(segtype);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct segtype_handler _striped_ops = {
|
static struct segtype_handler _striped_ops = {
|
||||||
|
@ -74,9 +74,9 @@ static int _unknown_add_target_line(struct dev_manager *dm __attribute__((unused
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void _unknown_destroy(const struct segment_type *segtype)
|
static void _unknown_destroy(struct segment_type *segtype)
|
||||||
{
|
{
|
||||||
dm_free((void *)segtype);
|
dm_free(segtype);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct segtype_handler _unknown_ops = {
|
static struct segtype_handler _unknown_ops = {
|
||||||
|
@ -78,9 +78,9 @@ static int _zero_modules_needed(struct dm_pool *mem,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _zero_destroy(const struct segment_type *segtype)
|
static void _zero_destroy(struct segment_type *segtype)
|
||||||
{
|
{
|
||||||
dm_free((void *) segtype);
|
dm_free(segtype);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct segtype_handler _zero_ops = {
|
static struct segtype_handler _zero_ops = {
|
||||||
|
Loading…
Reference in New Issue
Block a user