Skip to contentSkip to conversation

LVM2/lib/metadata metadata-exported.h metadata.c

PATCH [email protected] 1 participant 1 message Jul 26, 2009

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: wysochanski at sourceware.org 2009-07-26 02:02:22

Modified files:
lib/metadata : metadata-exported.h metadata.c

Log message:
Remove use of void * from pvcreate_single.

We should use struct pvcreate_params to utilize compiler typechecking.

Author: Dave Wysochanski <[email protected]>

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata-exported.h.diff?cvsroot=lvm2&r1=1.98&r2=1.99
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.265&r2=1.266

lib/metadata/metadata-exported.h +1 -1
@@ -355,7 +355,7 @@
 };
 
 pv_t * pvcreate_single(struct cmd_context *cmd, const char *pv_name,
-		       void *handle);
+		       struct pvcreate_params *pp);
 
 /*
 * Utility functions
lib/metadata/metadata.c +2 -5
@@ -1119,19 +1119,16 @@
  * pv_t * (non-NULL): handle to physical volume created
  */
 pv_t * pvcreate_single(struct cmd_context *cmd, const char *pv_name,
-		       void *handle)
+		       struct pvcreate_params *pp)
 {
-	struct pvcreate_params *pp;
 	void *pv;
 	struct device *dev;
 	struct dm_list mdas;
 	struct pvcreate_params default_pp;
 
 	fill_default_pvcreate_params(&default_pp);
-	if (!handle)
+	if (!pp)
 		pp = &default_pp;
-	else
-		pp = (struct pvcreate_params *) handle;
 
 	if (pp->idp) {
 		if ((dev = device_from_pvid(cmd, pp->idp)) &&