master - segtype: drop cmdcontex pointer
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=97cccfbf1c000e597cf751e26284614a15f77cb5 Commit: 97cccfbf1c000e597cf751e26284614a15f77cb5 Parent: 87fc3b710c3b8fc656dcf48ec453e1da280ec696 Author: Zdenek Kabelac <[email protected]> AuthorDate: Mon Oct 27 10:50:52 2014 +0100 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Thu Oct 30 23:58:49 2014 +0100
segtype: drop cmdcontex pointer
Users of context provide their cmd pointer,
so don't keep it inside segtype.
--- lib/cache_segtype/cache.c | 4 ---- lib/commands/toolcontext.c | 1 - lib/error/errseg.c | 2 -- lib/freeseg/freeseg.c | 2 -- lib/metadata/segtype.h | 1 - lib/mirror/mirrored.c | 2 -- lib/raid/raid.c | 2 +- lib/snapshot/snapshot.c | 2 -- lib/striped/striped.c | 2 -- lib/unknown/unknown.c | 2 -- lib/zero/zero.c | 2 -- tools/reporter.c | 1 - 12 files changed, 1 insertions(+), 22 deletions(-)
lib/cache_segtype/cache.c +0 -4
@@ -388,12 +388,10 @@ int init_cache_segtypes(struct cmd_context *cmd,log_error ("Failed to allocate memory for cache_pool segtype" );return 0 ; } - segtype->cmd = cmd; segtype->name ="cache-pool" ; segtype->flags =SEG_CACHE_POOL |SEG_CANNOT_BE_ZEROED ; segtype->ops = &_cache_pool_ops; - segtype->private =NULL ;if (!lvm_register_segtype (seglib, segtype)) return_0;
@@ -404,12 +402,10 @@ int init_cache_segtypes(struct cmd_context *cmd,log_error ("Failed to allocate memory for cache segtype" );return 0 ; } - segtype->cmd = cmd; segtype->name ="cache" ; segtype->flags =SEG_CACHE ; segtype->ops = &_cache_ops; - segtype->private =NULL ;if (!lvm_register_segtype (seglib, segtype)) return_0;
lib/commands/toolcontext.c +0 -1
@@ -1174,7 +1174,6 @@ int lvm_register_segtype(struct segtype_library *seglib,struct segment_type *segtype2; segtype->library = seglib->lib; - segtype->cmd = seglib->cmd; dm_list_iterate_items(segtype2, &seglib->cmd->segtypes) {if (strcmp (segtype2->name, segtype->name))
lib/error/errseg.c +0 -2
@@ -94,10 +94,8 @@ struct segment_type *init_error_segtype(struct cmd_context *cmd)if (!segtype) return_NULL; - segtype->cmd = cmd; segtype->ops = &_error_ops; segtype->name ="error" ; - segtype->private =NULL ; segtype->flags =SEG_CAN_SPLIT |SEG_VIRTUAL |SEG_CANNOT_BE_ZEROED ;log_very_verbose ("Initialised segtype: %s" , segtype->name);
lib/freeseg/freeseg.c +0 -2
@@ -32,10 +32,8 @@ struct segment_type *init_free_segtype(struct cmd_context *cmd)if (!segtype) return_NULL; - segtype->cmd = cmd; segtype->ops = &_freeseg_ops; segtype->name ="free" ; - segtype->private =NULL ; segtype->flags =SEG_VIRTUAL |SEG_CANNOT_BE_ZEROED ;log_very_verbose ("Initialised segtype: %s" , segtype->name);
lib/metadata/segtype.h +0 -1
@@ -81,7 +81,6 @@ struct dev_manager;struct segment_type {struct dm_list list;/* Internal */ -struct cmd_context *cmd;/* lvm_register_segtype() sets this. */ uint32_t flags;uint32_t parity_devs;/* Parity drives required by segtype */
lib/mirror/mirrored.c +0 -2
@@ -618,10 +618,8 @@ struct segment_type *init_segtype(struct cmd_context *cmd)if (!segtype) return_NULL; - segtype->cmd = cmd; segtype->ops = &_mirrored_ops; segtype->name ="mirror" ; - segtype->private =NULL ; segtype->flags =SEG_MIRROR |SEG_AREAS_MIRRORED ;#ifdef DEVMAPPER_SUPPORT
lib/raid/raid.c +1 -1
@@ -462,7 +462,7 @@ static struct segment_type *_init_raid_segtype(struct cmd_context *cmd, rt->name);return NULL ; } - segtype->cmd = cmd; + segtype->ops = &_raid_ops; segtype->name = rt->name; segtype->flags =SEG_RAID | rt->extra_flags | monitored;
lib/snapshot/snapshot.c +0 -2
@@ -258,10 +258,8 @@ struct segment_type *init_segtype(struct cmd_context *cmd)if (!segtype) return_NULL; - segtype->cmd = cmd; segtype->ops = &_snapshot_ops; segtype->name ="snapshot" ; - segtype->private =NULL ; segtype->flags =SEG_SNAPSHOT |SEG_CANNOT_BE_ZEROED ;#ifdef DEVMAPPER_SUPPORT
lib/striped/striped.c +0 -2
@@ -228,10 +228,8 @@ struct segment_type *init_striped_segtype(struct cmd_context *cmd)if (!segtype) return_NULL; - segtype->cmd = cmd; segtype->ops = &_striped_ops; segtype->name ="striped" ; - segtype->private =NULL ; segtype->flags =SEG_CAN_SPLIT |SEG_AREAS_STRIPED |SEG_FORMAT1_SUPPORT ;
lib/unknown/unknown.c +0 -2
@@ -67,10 +67,8 @@ struct segment_type *init_unknown_segtype(struct cmd_context *cmd, const char *nreturn NULL ; } - segtype->cmd = cmd; segtype->ops = &_unknown_ops; segtype->name =dm_pool_strdup (cmd->libmem, name); - segtype->private =NULL ; segtype->flags =SEG_UNKNOWN |SEG_VIRTUAL |SEG_CANNOT_BE_ZEROED ;log_very_verbose ("Initialised segtype: %s" , segtype->name);
lib/zero/zero.c +0 -2
@@ -90,10 +90,8 @@ struct segment_type *init_zero_segtype(struct cmd_context *cmd)if (!segtype) return_NULL; - segtype->cmd = cmd; segtype->ops = &_zero_ops; segtype->name ="zero" ; - segtype->private =NULL ; segtype->flags =SEG_CAN_SPLIT |SEG_VIRTUAL |SEG_CANNOT_BE_ZEROED ;log_very_verbose ("Initialised segtype: %s" , segtype->name);
tools/reporter.c +0 -1
@@ -100,7 +100,6 @@ static int _do_pvsegs_sub_single(struct cmd_context *cmd,struct lvinfo lvinfo = { .exists =0 };struct segment_type _freeseg_type = { - .cmd = cmd, .name ="free" , .flags =SEG_VIRTUAL |SEG_CANNOT_BE_ZEROED , };