1
0
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:
Zdenek Kabelac 2010-12-20 13:32:49 +00:00
parent 66781f5d5a
commit 9d9de35dca
13 changed files with 24 additions and 24 deletions

View File

@ -81,9 +81,9 @@ static int _errseg_modules_needed(struct dm_pool *mem,
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 = {

View File

@ -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 = {

View File

@ -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* */

View File

@ -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) {
_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((void *)fmt);
dm_free(fmt);
}
static struct metadata_area_ops _metadata_text_file_ops = {

View File

@ -31,9 +31,9 @@ static const char *_freeseg_name(const struct lv_segment *seg)
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 = {

View File

@ -291,7 +291,7 @@ struct format_handler {
/*
* Destructor for format type
*/
void (*destroy) (const struct format_type * fmt);
void (*destroy) (struct format_type * fmt);
};
/*

View File

@ -97,7 +97,7 @@ struct segtype_handler {
int (*modules_needed) (struct dm_pool *mem,
const struct lv_segment *seg,
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_monitor_events) (struct lv_segment *seg, int events);
int (*target_unmonitor_events) (struct lv_segment *seg, int events);

View File

@ -600,9 +600,9 @@ static int _mirrored_modules_needed(struct dm_pool *mem,
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 = {

View File

@ -406,9 +406,9 @@ static int _replicator_modules_needed(struct dm_pool *mem,
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 = {

View File

@ -218,9 +218,9 @@ static int _snap_modules_needed(struct dm_pool *mem,
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 = {

View File

@ -199,9 +199,9 @@ static int _striped_target_present(struct cmd_context *cmd,
}
#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 = {

View File

@ -74,9 +74,9 @@ static int _unknown_add_target_line(struct dev_manager *dm __attribute__((unused
}
#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 = {

View File

@ -78,9 +78,9 @@ static int _zero_modules_needed(struct dm_pool *mem,
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 = {