Skip to contentSkip to conversation

LVM2 ./WHATS_NEW lib/device/device.h tools/pvc ...

PATCH [email protected] 1 participant 1 message Jul 23, 2008

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: wysochanski at sourceware.org 2008-07-23 19:46:33

Modified files:

	.              : WHATS_NEW 
	lib/device     : device.h 
	tools          : pvcreate.c pvremove.c 

Log message:
Remove dead code, is_lvm_partition() - no functional change.

This code does nothing. The function is #defined to 1 which ensures the only two if statements referencing it will never be true.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.933&r2=1.934
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/device.h.diff?cvsroot=lvm2&r1=1.34&r2=1.35
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvcreate.c.diff?cvsroot=lvm2&r1=1.66&r2=1.67
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvremove.c.diff?cvsroot=lvm2&r1=1.21&r2=1.22

WHATS_NEW +1 -0
@@ -1,5 +1,6 @@
 Version 2.02.40 - 
 ================================
+  Remove dead code, is_lvm_partition() - no functional change.
   Refactor pvcreate to divide parameter parsing & validation from create logic.
   Check for label_write() failure in _text_pv_write().
   Add pvcreate tests and update vgsplit tests to handle lvm1 and lvm2 metadata.
lib/device/device.h +0 -5
@@ -94,11 +94,6 @@
 /* Does device contain md superblock?  If so, where? */
 int dev_is_md(struct device *dev, uint64_t *sb);
 
-/* FIXME Check partition type if appropriate */
-
-#define is_lvm_partition(a) 1
-/* int is_lvm_partition(const char *name); */
-
 int is_partitioned_dev(struct device *dev);
 
 #endif
tools/pvcreate.c +0 -7
@@ -37,13 +37,6 @@
 	struct device *dev;
 	uint64_t md_superblock;
 
-	/* is the partition type set correctly ? */
-	if ((arg_count(cmd, force_ARG) < 1) && !is_lvm_partition(name)) {
-		log_error("%s: Not LVM partition type: use -f to override",
-			  name);
-		return 0;
-	}
-
 	/* Is there a pv here already? */
 	/* FIXME Use partial mode here? */
 	pv = pv_read(cmd, name, NULL, NULL, 0);
tools/pvremove.c +0 -7
@@ -26,13 +26,6 @@
 {
 	struct physical_volume *pv;
 
-	/* is the partition type set correctly ? */
-	if ((arg_count(cmd, force_ARG) < 1) && !is_lvm_partition(name)) {
-		log_error("%s: Not LVM partition type: use -f to override",
-			  name);
-		return 0;
-	}
-
 	/* Is there a pv here already? */
 	/* If not, this is an error unless you used -f. */
 	if (!(pv = pv_read(cmd, name, NULL, NULL, 1))) {