Skip to contentSkip to conversation

LVM2 ./WHATS_NEW lib/cache/lvmcache.c lib/lock ...

PATCH [email protected] 1 participant 1 message May 19, 2010

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: agk at sourceware.org 2010-05-19 00:52:56

Modified files:

	.              : WHATS_NEW 
	lib/cache      : lvmcache.c 
	lib/locking    : cluster_locking.c file_locking.c locking.c 

Log message:
Use is_orphan_vg in place of hard-coded prefix tests.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1562&r2=1.1563
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.86&r2=1.87
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/cluster_locking.c.diff?cvsroot=lvm2&r1=1.42&r2=1.43
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/file_locking.c.diff?cvsroot=lvm2&r1=1.44&r2=1.45
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.c.diff?cvsroot=lvm2&r1=1.80&r2=1.81

WHATS_NEW +1 -0
@@ -1,5 +1,6 @@
 Version 2.02.66 - 
 ===============================
+  Use is_orphan_vg in place of hard-coded prefix tests.
 
 Version 2.02.65 - 17th May 2010
 ===============================
lib/cache/lvmcache.c +2 -2
@@ -224,11 +224,11 @@
 
 /*
  * Ensure vgname2 comes after vgname1 alphabetically.
- * Special VG names beginning with '#' don't count.
+ * Orphans don't count.
  */
 static int _vgname_order_correct(const char *vgname1, const char *vgname2)
 {
-	if ((*vgname1 == '#') || (*vgname2 == '#'))
+	if (is_orphan_vg(vgname1) || is_orphan_vg(vgname2))
 		return 1;
 
 	if (strcmp(vgname1, vgname2) < 0)
lib/locking/cluster_locking.c +1 -1
@@ -406,7 +406,7 @@
 		}
 
 		/* If the VG name is empty then lock the unused PVs */
-		if (*resource == '#' || (flags & LCK_CACHE))
+		if (is_orphan_vg(resource) || (flags & LCK_CACHE))
 			dm_snprintf(lockname, sizeof(lockname), "P_%s",
 				    resource);
 		else
lib/locking/file_locking.c +1 -1
@@ -265,7 +265,7 @@
 		if (flags & LCK_CACHE)
 			break;
 
-		if (*resource == '#')
+		if (is_orphan_vg(resource))
 			dm_snprintf(lockfile, sizeof(lockfile),
 				     "%s/P_%s", _lock_dir, resource + 1);
 		else
lib/locking/locking.c +2 -2
@@ -369,7 +369,7 @@
 		return 0;
 	}
 
-	if (*resource == '#' && (flags & LCK_CACHE)) {
+	if (is_orphan_vg(resource) && (flags & LCK_CACHE)) {
 		log_error(INTERNAL_ERROR "P_%s referenced", resource);
 		return 0;
 	}
@@ -423,7 +423,7 @@
 		if (!_blocking_supported)
 			flags |= LCK_NONBLOCK;
 
-		if (vol[0] != '#' &&
+		if (!is_orphan_vg(vol) && 
 		    ((flags & LCK_TYPE_MASK) != LCK_UNLOCK) &&
 		    (!(flags & LCK_CACHE)) &&
 		    !lvmcache_verify_lock_order(vol))