Skip to contentSkip to conversation

LVM2 daemons/clvmd/lvm-functions.c lib/command ...

PATCH [email protected] 1 participant 1 message Dec 17, 2008 Library code

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: wysochanski at sourceware.org 2008-12-17 16:46:45

Modified files:

	daemons/clvmd  : lvm-functions.c 
	lib/commands   : toolcontext.c toolcontext.h 
	lib            : lvm2.h 
	tools          : lvmcmdline.c 

Log message:
Remove struct arg * from struct cmd_context and create_toolcontext().

This allows us to remove one argument from create_toolcontext() and moves it closer to a generic library init function.

In the arg_*() functions, we just use _the_args() directly. For now we leave the first parameter to these arg_*() functions (struct cmd_context *) because of the number of files involved in removing the parameter.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.53&r2=1.54
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.70&r2=1.71
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.h.diff?cvsroot=lvm2&r1=1.28&r2=1.29
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/lvm2.h.diff?cvsroot=lvm2&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvmcmdline.c.diff?cvsroot=lvm2&r1=1.88&r2=1.89

daemons/clvmd/lvm-functions.c +1 -1
@@ -724,7 +724,7 @@
 /* Called to initialise the LVM context of the daemon */
 int init_lvm(int using_gulm)
 {
-	if (!(cmd = create_toolcontext(NULL, 0, 1))) {
+	if (!(cmd = create_toolcontext(0, 1))) {
 		log_error("Failed to allocate command context");
 		return 0;
 	}
lib/commands/toolcontext.c +1 -2
@@ -998,7 +998,7 @@
 }
 
 /* Entry point */
-struct cmd_context *create_toolcontext(struct arg *the_args, unsigned is_static,
+struct cmd_context *create_toolcontext(unsigned is_static,
 				       unsigned is_long_lived)
 {
 	struct cmd_context *cmd;
@@ -1021,7 +1021,6 @@
 		return NULL;
 	}
 	memset(cmd, 0, sizeof(*cmd));
-	cmd->args = the_args;
 	cmd->is_static = is_static;
 	cmd->is_long_lived = is_long_lived;
 	cmd->handles_missing_pvs = 0;
lib/commands/toolcontext.h +1 -2
@@ -65,7 +65,6 @@
 	unsigned rand_seed;
 	char *cmd_line;
 	struct command *command;
-	struct arg *args;
 	char **argv;
 	unsigned is_static:1;	/* Static binary? */
 	unsigned is_long_lived:1;	/* Optimises persistent_filter handling */
@@ -96,7 +95,7 @@
 	char sysfs_dir[PATH_MAX];
 };
 
-struct cmd_context *create_toolcontext(struct arg *the_args, unsigned is_static, unsigned is_long_lived);
+struct cmd_context *create_toolcontext(unsigned is_static, unsigned is_long_lived);
 void destroy_toolcontext(struct cmd_context *cmd);
 int refresh_toolcontext(struct cmd_context *cmd);
 int config_files_changed(struct cmd_context *cmd);
lib/lvm2.h +2 -2
@@ -24,7 +24,7 @@
  */
 struct arg;
 struct cmd_context;
-struct cmd_context *create_toolcontext(struct arg *the_args, unsigned is_static, unsigned is_long_lived);
+struct cmd_context *create_toolcontext(unsigned is_static, unsigned is_long_lived);
 void destroy_toolcontext(struct cmd_context *cmd);
 
 /*
@@ -37,7 +37,7 @@
  * NULL: Fail - unable to initialise handle.
  * non-NULL: Success - valid LVM2 handle returned
  */
-#define lvm2_create(X) create_toolcontext(NULL,0,1)
+#define lvm2_create(X) create_toolcontext(0,1)
 
 /*
  * lvm2_destroy
tools/lvmcmdline.c +32 -23

98 lines not on this page · raw message