public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2005-12-19 21:01 agk
  0 siblings, 0 replies; 36+ messages in thread
From: agk @ 2005-12-19 21:01 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-12-19 21:01:39

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c activate.h 
	lib/mirror     : mirrored.c 

Log message:
	Set block_on_error parameter if available.
	Add target_version.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.336&r2=1.337
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.100&r2=1.101
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.46&r2=1.47
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.22&r2=1.23


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2012-03-23  9:58 zkabelac
  0 siblings, 0 replies; 36+ messages in thread
From: zkabelac @ 2012-03-23  9:58 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-03-23 09:58:05

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c activate.h 
	lib/metadata   : thin_manip.c 
	tools          : lvchange.c vgchange.c 

Log message:
	Update and fix monitoring of thin pool devices
	
	Code adds better support for monitoring of thin pool devices.
	update_pool_lv uses DMEVENTD_MONITOR_IGNORE to not manipulate with monitoring.
	vgchange & lvchange are checking real thin pool device for existance
	as we are using   _tpool  real device and visible LV pool device might not
	be even active (_tpool is activated implicitely for any thin volume).
	monitor_dev_for_events is another _lv_postorder like code it might be worth
	to think about reusing it here - for now update the code to properly
	monitory thin volume deps.
	For unmonitoring add extra code to check the usage of thin pool - in case it's in use
	unmonitoring of thin volume is skipped.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2364&r2=1.2365
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.243&r2=1.244
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.98&r2=1.99
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/thin_manip.c.diff?cvsroot=lvm2&r1=1.35&r2=1.36
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.140&r2=1.141
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgchange.c.diff?cvsroot=lvm2&r1=1.131&r2=1.132

--- LVM2/WHATS_NEW	2012/03/23 09:48:17	1.2364
+++ LVM2/WHATS_NEW	2012/03/23 09:58:04	1.2365
@@ -1,5 +1,6 @@
 Version 2.02.96 - 
 ================================
+  Update and fix monitoring of thin pool devices.
   Check hash insert success in lock_vg clvmd.
   Check for buffer overwrite in get_cluster_type() clvmd.
   Fix global/detect_internal_vg_cache_corruption config check.
--- LVM2/lib/activate/activate.c	2012/02/23 22:42:00	1.243
+++ LVM2/lib/activate/activate.c	2012/03/23 09:58:05	1.244
@@ -1221,6 +1221,8 @@
 	int (*monitor_fn) (struct lv_segment *s, int e);
 	uint32_t s;
 	static const struct lv_activate_opts zlaopts = { 0 };
+	static const struct lv_activate_opts thinopts = { .skip_in_use = 1 };
+	struct lvinfo info;
 
 	if (!laopts)
 		laopts = &zlaopts;
@@ -1236,6 +1238,19 @@
 		return 1;
 
 	/*
+	 * Allow to unmonitor thin pool via explicit pool unmonitor
+	 * or unmonitor before the last thin pool user deactivation
+	 * Skip unmonitor, if invoked via unmonitor of thin volume
+	 * and there is another thin pool user (open_count > 1)
+	 */
+	if (laopts->skip_in_use && lv_info(lv->vg->cmd, lv, 1, &info, 1, 0) &&
+	    (info.open_count != 1)) {
+		log_debug("Skipping unmonitor of opened %s (open:%d)",
+			  lv->name, info.open_count);
+		return 1;
+	}
+
+	/*
 	 * In case of a snapshot device, we monitor lv->snapshot->lv,
 	 * not the actual LV itself.
 	 */
@@ -1279,6 +1294,21 @@
 			}
 		}
 
+		/*
+		 * If requested unmonitoring of thin volume, request test
+		 * if there is no other thin pool user
+		 *
+		 * FIXME: code here looks like _lv_postorder()
+		 */
+		if (seg->pool_lv &&
+		    !monitor_dev_for_events(cmd, seg->pool_lv,
+					    (!monitor) ? &thinopts : NULL, monitor))
+			r = 0;
+
+		if (seg->metadata_lv &&
+		    !monitor_dev_for_events(cmd, seg->metadata_lv, NULL, monitor))
+			r = 0;
+
 		if (!seg_monitored(seg) || (seg->status & PVMOVE))
 			continue;
 
--- LVM2/lib/activate/activate.h	2012/02/23 22:42:00	1.98
+++ LVM2/lib/activate/activate.h	2012/03/23 09:58:05	1.99
@@ -36,6 +36,7 @@
 	int no_merging;
 	int real_pool;
 	int is_activate;
+	int skip_in_use;
 	unsigned revert;
 	unsigned read_only;
 };
--- LVM2/lib/metadata/thin_manip.c	2012/03/02 13:26:09	1.35
+++ LVM2/lib/metadata/thin_manip.c	2012/03/23 09:58:05	1.36
@@ -388,6 +388,8 @@
 
 int update_pool_lv(struct logical_volume *lv, int activate)
 {
+	int monitored;
+
 	if (!lv_is_thin_pool(lv)) {
 		log_error(INTERNAL_ERROR "Updated LV %s is not pool.", lv->name);
 		return 0;
@@ -399,10 +401,13 @@
 	if (activate) {
 		/* If the pool is not active, do activate deactivate */
 		if (!lv_is_active(lv)) {
+			monitored = dmeventd_monitor_mode();
+			init_dmeventd_monitor(DMEVENTD_MONITOR_IGNORE);
 			if (!activate_lv_excl(lv->vg->cmd, lv))
 				return_0;
 			if (!deactivate_lv(lv->vg->cmd, lv))
 				return_0;
+			init_dmeventd_monitor(monitored);
 		}
 		/*
 		 * Resume active pool to send thin messages.
--- LVM2/tools/lvchange.c	2012/03/06 02:30:50	1.140
+++ LVM2/tools/lvchange.c	2012/03/23 09:58:05	1.141
@@ -94,7 +94,8 @@
 {
 	struct lvinfo info;
 
-	if (!lv_info(cmd, lv, 0, &info, 0, 0) || !info.exists) {
+	if (!lv_info(cmd, lv, lv_is_thin_pool(lv) ? 1 : 0,
+		     &info, 0, 0) || !info.exists) {
 		log_error("Logical volume, %s, is not active", lv->name);
 		return 0;
 	}
--- LVM2/tools/vgchange.c	2012/02/28 14:24:59	1.131
+++ LVM2/tools/vgchange.c	2012/03/23 09:58:05	1.132
@@ -24,21 +24,19 @@
 	struct lv_list *lvl;
 	struct logical_volume *lv;
 	struct lvinfo info;
-	int lv_active;
 	int r = 1;
 
 	dm_list_iterate_items(lvl, &vg->lvs) {
 		lv = lvl->lv;
 
-		if (!lv_info(cmd, lv, 0, &info, 0, 0))
-			lv_active = 0;
-		else
-			lv_active = info.exists;
-
+		if (!lv_info(cmd, lv, lv_is_thin_pool(lv) ? 1 : 0,
+			     &info, 0, 0) ||
+		    !info.exists)
+			continue;
 		/*
 		 * FIXME: Need to consider all cases... PVMOVE, etc
 		 */
-		if ((lv->status & PVMOVE) || !lv_active)
+		if (lv->status & PVMOVE)
 			continue;
 
 		if (!monitor_dev_for_events(cmd, lv, 0, reg)) {


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2012-02-23 22:42 zkabelac
  0 siblings, 0 replies; 36+ messages in thread
From: zkabelac @ 2012-02-23 22:42 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-02-23 22:42:00

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c activate.h 

Log message:
	Use const for lv
	
	lv_is_active doesn't needs modifiable LV struct so keep it const.
	
	Remove lv_send_message() left bits from code -
	they were never released in 2.02.89.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2307&r2=1.2308
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.242&r2=1.243
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.97&r2=1.98

--- LVM2/WHATS_NEW	2012/02/23 22:30:20	1.2307
+++ LVM2/WHATS_NEW	2012/02/23 22:41:57	1.2308
@@ -1,5 +1,6 @@
 Version 2.02.94 - 
 ====================================
+  Use const lv pointer for lv_is_active...() functions. 
   Use same signed numbers in _mirrored_transient_status().
   Integrate client-side lvmetad into build.
 
@@ -172,7 +173,6 @@
   Apply appropriate udev flags when suspending/resuming mirror sub-LVs.
   Fix vgsplit to handle mirrored logs.
   Clarify multi-name device filter pattern matching explanation in lvm.conf.
-  Introduce lv_send_message and dev_manager_send_message.
   Introduce revert_lv for better pvmove cleanup.
   Replace incomplete pvmove activation failure recovery code with a message.
   Abort if _finish_pvmove suspend_lvs fails instead of cleaning up incompletely.
--- LVM2/lib/activate/activate.c	2012/02/23 13:11:08	1.242
+++ LVM2/lib/activate/activate.c	2012/02/23 22:42:00	1.243
@@ -194,7 +194,7 @@
 {
 	return 0;
 }
-int lvs_in_vg_activated(struct volume_group *vg)
+int lvs_in_vg_activated(const struct volume_group *vg)
 {
 	return 0;
 }
@@ -242,10 +242,6 @@
 {
 	return 1;
 }
-int lv_send_message(const struct logical_volume *lv, const char *message)
-{
-	return 0;
-}
 int pv_uses_vg(struct physical_volume *pv,
 	       struct volume_group *vg)
 {
@@ -258,23 +254,23 @@
 {
 }
 
-int lv_is_active(struct logical_volume *lv)
+int lv_is_active(const struct logical_volume *lv)
 {
 	return 0;
 }
-int lv_is_active_but_not_locally(struct logical_volume *lv)
+int lv_is_active_but_not_locally(const struct logical_volume *lv)
 {
 	return 0;
 }
-int lv_is_active_exclusive(struct logical_volume *lv)
+int lv_is_active_exclusive(const struct logical_volume *lv)
 {
 	return 0;
 }
-int lv_is_active_exclusive_locally(struct logical_volume *lv)
+int lv_is_active_exclusive_locally(const struct logical_volume *lv)
 {
 	return 0;
 }
-int lv_is_active_exclusive_remotely(struct logical_volume *lv)
+int lv_is_active_exclusive_remotely(const struct logical_volume *lv)
 {
 	return 0;
 }
@@ -293,6 +289,7 @@
 {
 }
 /* dev_manager.c */
+#include "targets.h"
 int add_areas_line(struct dev_manager *dm, struct lv_segment *seg,
 		   struct dm_tree_node *node, uint32_t start_area,
 		   uint32_t areas)
@@ -842,7 +839,7 @@
 	return r;
 }
 
-static int _lv_active(struct cmd_context *cmd, struct logical_volume *lv)
+static int _lv_active(struct cmd_context *cmd, const struct logical_volume *lv)
 {
 	struct lvinfo info;
 
@@ -944,7 +941,7 @@
  * These two functions return the number of visible LVs in the state,
  * or -1 on error.  FIXME Check this.
  */
-int lvs_in_vg_activated(struct volume_group *vg)
+int lvs_in_vg_activated(const struct volume_group *vg)
 {
 	struct lv_list *lvl;
 	int count = 0;
@@ -999,7 +996,7 @@
  *
  * Returns: 0 or 1
  */
-static int _lv_is_active(struct logical_volume *lv,
+static int _lv_is_active(const struct logical_volume *lv,
 			 int *locally, int *exclusive)
 {
 	int r, l, e; /* remote, local, and exclusive */
@@ -1055,32 +1052,32 @@
 	return r || l;
 }
 
-int lv_is_active(struct logical_volume *lv)
+int lv_is_active(const struct logical_volume *lv)
 {
 	return _lv_is_active(lv, NULL, NULL);
 }
 
-int lv_is_active_but_not_locally(struct logical_volume *lv)
+int lv_is_active_but_not_locally(const struct logical_volume *lv)
 {
 	int l;
 	return _lv_is_active(lv, &l, NULL) && !l;
 }
 
-int lv_is_active_exclusive(struct logical_volume *lv)
+int lv_is_active_exclusive(const struct logical_volume *lv)
 {
 	int e;
 
 	return _lv_is_active(lv, NULL, &e) && e;
 }
 
-int lv_is_active_exclusive_locally(struct logical_volume *lv)
+int lv_is_active_exclusive_locally(const struct logical_volume *lv)
 {
 	int l, e;
 
 	return _lv_is_active(lv, &l, &e) && l && e;
 }
 
-int lv_is_active_exclusive_remotely(struct logical_volume *lv)
+int lv_is_active_exclusive_remotely(const struct logical_volume *lv)
 {
 	int l, e;
 
--- LVM2/lib/activate/activate.h	2012/01/25 13:10:26	1.97
+++ LVM2/lib/activate/activate.h	2012/02/23 22:42:00	1.98
@@ -111,14 +111,14 @@
 /*
  * Return number of LVs in the VG that are active.
  */
-int lvs_in_vg_activated(struct volume_group *vg);
+int lvs_in_vg_activated(const struct volume_group *vg);
 int lvs_in_vg_opened(const struct volume_group *vg);
 
-int lv_is_active(struct logical_volume *lv);
-int lv_is_active_but_not_locally(struct logical_volume *lv);
-int lv_is_active_exclusive(struct logical_volume *lv);
-int lv_is_active_exclusive_locally(struct logical_volume *lv);
-int lv_is_active_exclusive_remotely(struct logical_volume *lv);
+int lv_is_active(const struct logical_volume *lv);
+int lv_is_active_but_not_locally(const struct logical_volume *lv);
+int lv_is_active_exclusive(const struct logical_volume *lv);
+int lv_is_active_exclusive_locally(const struct logical_volume *lv);
+int lv_is_active_exclusive_remotely(const struct logical_volume *lv);
 
 int lv_has_target_type(struct dm_pool *mem, struct logical_volume *lv,
 		       const char *layer, const char *target_type);


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2012-01-25 13:10 zkabelac
  0 siblings, 0 replies; 36+ messages in thread
From: zkabelac @ 2012-01-25 13:10 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-01-25 13:10:26

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c activate.h 

Log message:
	Rename  origin_only to more generic use_layer flag
	
	Since now we have more layered devices i.e. thin volumes - support
	selection of layer via flag.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2239&r2=1.2240
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.238&r2=1.239
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.96&r2=1.97

--- LVM2/WHATS_NEW	2012/01/25 11:32:41	1.2239
+++ LVM2/WHATS_NEW	2012/01/25 13:10:26	1.2240
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Rename origin_only parameter to more generic flag use_layer for lv_info().
   Thin pools have segment fields thin_count, zero, transaction_id.
   Each new created LV volume has creation lv_time and lv_host.
   Print data_percent and metadata_percent for verbose lvs.
--- LVM2/lib/activate/activate.c	2012/01/25 09:13:10	1.238
+++ LVM2/lib/activate/activate.c	2012/01/25 13:10:26	1.239
@@ -151,13 +151,12 @@
 {
 	return 0;
 }
-int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, unsigned origin_only,
+int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, int use_layer,
 	    struct lvinfo *info, int with_open_count, int with_read_ahead)
 {
 	return 0;
 }
-int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s,
-		    unsigned origin_only,
+int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s, int use_layer,
 		    struct lvinfo *info, int with_open_count, int with_read_ahead)
 {
 	return 0;
@@ -532,10 +531,11 @@
 /*
  * Returns 1 if info structure populated, else 0 on failure.
  */
-int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, unsigned origin_only,
+int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, int use_layer,
 	    struct lvinfo *info, int with_open_count, int with_read_ahead)
 {
 	struct dm_info dminfo;
+	const char *layer;
 
 	if (!activation())
 		return 0;
@@ -552,7 +552,14 @@
 			fs_unlock(); /* For non clustered - wait if there are non-delete ops */
 	}
 
-	if (!dev_manager_info(lv->vg->cmd->mem, lv, (lv_is_origin(lv) && origin_only) ? "real" : NULL, with_open_count,
+	if (use_layer && lv_is_thin_pool(lv))
+		layer = "tpool";
+	else if (use_layer && lv_is_origin(lv))
+		layer = "real";
+	else
+		layer = NULL;
+
+	if (!dev_manager_info(lv->vg->cmd->mem, lv, layer, with_open_count,
 			      with_read_ahead, &dminfo, &info->read_ahead))
 		return_0;
 
@@ -568,8 +575,7 @@
 	return 1;
 }
 
-int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s,
-		    unsigned origin_only,
+int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s, int use_layer,
 		    struct lvinfo *info, int with_open_count, int with_read_ahead)
 {
 	int r;
@@ -578,10 +584,7 @@
 	if (!(lv = lv_from_lvid(cmd, lvid_s, 0)))
 		return 0;
 
-	if (!lv_is_origin(lv))
-		origin_only = 0;
-
-	r = lv_info(cmd, lv, origin_only, info, with_open_count, with_read_ahead);
+	r = lv_info(cmd, lv, use_layer, info, with_open_count, with_read_ahead);
 	release_vg(lv->vg);
 
 	return r;
--- LVM2/lib/activate/activate.h	2012/01/25 09:06:43	1.96
+++ LVM2/lib/activate/activate.h	2012/01/25 13:10:26	1.97
@@ -79,10 +79,9 @@
 /*
  * Returns 1 if info structure has been populated, else 0.
  */
-int lv_info(struct cmd_context *cmd, const struct logical_volume *lv,
-	    unsigned origin_only, struct lvinfo *info,
-	    int with_open_count, int with_read_ahead);
-int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s, unsigned origin_only,
+int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, int use_layer,
+	    struct lvinfo *info, int with_open_count, int with_read_ahead);
+int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s, int use_layer,
 		    struct lvinfo *info, int with_open_count, int with_read_ahead);
 
 int lv_check_not_in_use(struct cmd_context *cmd, struct logical_volume *lv,


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2012-01-25  8:48 zkabelac
  0 siblings, 0 replies; 36+ messages in thread
From: zkabelac @ 2012-01-25  8:48 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-01-25 08:48:43

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c activate.h dev_manager.c 
	                 dev_manager.h 

Log message:
	Thin add lv_thin_pool_transaction_id
	
	Easy function to get transaction_id status value.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2236&r2=1.2237
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.233&r2=1.234
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.94&r2=1.95
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.264&r2=1.265
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.h.diff?cvsroot=lvm2&r1=1.44&r2=1.45

--- LVM2/WHATS_NEW	2012/01/24 14:33:38	1.2236
+++ LVM2/WHATS_NEW	2012/01/25 08:48:42	1.2237
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Add lv_thin_pool_transaction_id to read the transaction_id value.
   Use suspend|resume_origin_only when up-converting RAID, as mirrors do.
   Fix the way RAID meta LVs are added to the dependency tree.
   Change exclusive LV activation logic to try local node before remote nodes.
--- LVM2/lib/activate/activate.c	2012/01/21 05:29:52	1.233
+++ LVM2/lib/activate/activate.c	2012/01/25 08:48:43	1.234
@@ -762,6 +762,35 @@
 	return r;
 }
 
+/*
+ * Returns 1 if transaction_id set, else 0 on failure.
+ */
+int lv_thin_pool_transaction_id(const struct logical_volume *lv,
+				uint64_t *transaction_id)
+{
+	int r;
+	struct dev_manager *dm;
+	struct dm_status_thin_pool *status;
+
+	if (!activation())
+		return 0;
+
+	log_debug("Checking thin percent for LV %s/%s",
+		  lv->vg->name, lv->name);
+
+	if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, 1)))
+		return_0;
+
+	if (!(r = dev_manager_thin_pool_status(dm, lv, &status)))
+		stack;
+	else
+		*transaction_id = status->transaction_id;
+
+	dev_manager_destroy(dm);
+
+	return r;
+}
+
 static int _lv_active(struct cmd_context *cmd, struct logical_volume *lv)
 {
 	struct lvinfo info;
--- LVM2/lib/activate/activate.h	2012/01/20 00:27:19	1.94
+++ LVM2/lib/activate/activate.h	2012/01/25 08:48:43	1.95
@@ -105,6 +105,8 @@
 			 percent_t *percent);
 int lv_thin_percent(const struct logical_volume *lv, int mapped,
 		    percent_t *percent);
+int lv_thin_pool_transaction_id(const struct logical_volume *lv,
+				uint64_t *transaction_id);
 
 /*
  * Return number of LVs in the VG that are active.
--- LVM2/lib/activate/dev_manager.c	2012/01/23 20:56:43	1.264
+++ LVM2/lib/activate/dev_manager.c	2012/01/25 08:48:43	1.265
@@ -882,6 +882,48 @@
 
 #endif
 
+int dev_manager_thin_pool_status(struct dev_manager *dm,
+				 const struct logical_volume *lv,
+				 struct dm_status_thin_pool **status)
+{
+	const char *dlid;
+	struct dm_task *dmt;
+	struct dm_info info;
+	uint64_t start, length;
+	char *type = NULL;
+	char *params = NULL;
+	int r = 0;
+
+	/* Build dlid for the thin pool layer */
+	if (!(dlid = build_dm_uuid(dm->mem, lv->lvid.s, _thin_layer)))
+		return_0;
+
+	log_debug("Getting thin pool device status for %s.", lv->name);
+
+	if (!(dmt = _setup_task(NULL, dlid, 0, DM_DEVICE_STATUS, 0, 0)))
+		return_0;
+
+	if (!dm_task_no_open_count(dmt))
+		log_error("Failed to disable open_count.");
+
+	if (!dm_task_run(dmt))
+		goto_out;
+
+	if (!dm_task_get_info(dmt, &info) || !info.exists)
+		goto_out;
+
+	dm_get_next_target(dmt, NULL, &start, &length, &type, &params);
+
+	if (!dm_get_status_thin_pool(dm->mem, params, status))
+		goto_out;
+
+	r = 1;
+out:
+	dm_task_destroy(dmt);
+
+	return r;
+}
+
 int dev_manager_thin_pool_percent(struct dev_manager *dm,
 				  const struct logical_volume *lv,
 				  int metadata, percent_t *percent)
--- LVM2/lib/activate/dev_manager.h	2012/01/19 15:27:54	1.44
+++ LVM2/lib/activate/dev_manager.h	2012/01/25 08:48:43	1.45
@@ -54,6 +54,9 @@
 int dev_manager_mirror_percent(struct dev_manager *dm,
 			       const struct logical_volume *lv, int wait,
 			       percent_t *percent, uint32_t *event_nr);
+int dev_manager_thin_pool_status(struct dev_manager *dm,
+				 const struct logical_volume *lv,
+				 struct dm_status_thin_pool **status);
 int dev_manager_thin_pool_percent(struct dev_manager *dm,
 				  const struct logical_volume *lv,
 				  int metadata, percent_t *percent);


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2011-11-18 19:31 zkabelac
  0 siblings, 0 replies; 36+ messages in thread
From: zkabelac @ 2011-11-18 19:31 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-11-18 19:31:10

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c fs.c 
	lib/commands   : toolcontext.c 
	lib/format_text: format-text.c 
	lib/metadata   : metadata.c 

Log message:
	Replace dynamic buffer allocations for PATH_MAX
	
	Use static buffer instead of stack allocated buffer.
	This reduces stack size usage of lvm tool and the
	change is very simple.
	
	Since the whole library is not thread safe - it should not
	add any new problems - and if there will be some conversion
	it's easy to convert this to use some preallocated buffer.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2190&r2=1.2191
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.223&r2=1.224
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/fs.c.diff?cvsroot=lvm2&r1=1.63&r2=1.64
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.140&r2=1.141
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/format-text.c.diff?cvsroot=lvm2&r1=1.185&r2=1.186
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.473&r2=1.474

--- LVM2/WHATS_NEW	2011/11/18 19:28:00	1.2190
+++ LVM2/WHATS_NEW	2011/11/18 19:31:09	1.2191
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Reduce stack allocation of some PATH_MAX sized char buffers.
   Unlock memory before writing metadata.
   Add query before removing snapshots when inactive snapshot origin is removed.
   Allow changing availability state of snapshots.
--- LVM2/lib/activate/activate.c	2011/11/11 16:41:37	1.223
+++ LVM2/lib/activate/activate.c	2011/11/18 19:31:09	1.224
@@ -38,7 +38,7 @@
 
 int lvm1_present(struct cmd_context *cmd)
 {
-	char path[PATH_MAX];
+	static char path[PATH_MAX];
 
 	if (dm_snprintf(path, sizeof(path), "%s/lvm/global", cmd->proc_dir)
 	    < 0) {
@@ -294,7 +294,7 @@
 	const struct dm_config_node *cn;
 	const struct dm_config_value *cv;
 	const char *str;
-	char path[PATH_MAX];
+	static char path[PATH_MAX];
 
 	if (!(cn = find_config_tree_node(cmd, "activation/volume_list"))) {
 		log_verbose("activation/volume_list configuration setting "
--- LVM2/lib/activate/fs.c	2011/10/14 13:23:48	1.63
+++ LVM2/lib/activate/fs.c	2011/11/18 19:31:09	1.64
@@ -36,7 +36,7 @@
 
 static int _mk_dir(const char *dev_dir, const char *vg_name)
 {
-	char vg_path[PATH_MAX];
+	static char vg_path[PATH_MAX];
 	mode_t old_umask;
 
 	if (dm_snprintf(vg_path, sizeof(vg_path), "%s%s",
@@ -67,7 +67,7 @@
 
 static int _rm_dir(const char *dev_dir, const char *vg_name)
 {
-	char vg_path[PATH_MAX];
+	static char vg_path[PATH_MAX];
 
 	if (dm_snprintf(vg_path, sizeof(vg_path), "%s%s",
 			 dev_dir, vg_name) == -1) {
@@ -87,7 +87,7 @@
 static void _rm_blks(const char *dir)
 {
 	const char *name;
-	char path[PATH_MAX];
+	static char path[PATH_MAX];
 	struct dirent *dirent;
 	struct stat buf;
 	DIR *d;
@@ -124,8 +124,8 @@
 static int _mk_link(const char *dev_dir, const char *vg_name,
 		    const char *lv_name, const char *dev, int check_udev)
 {
-	char lv_path[PATH_MAX], link_path[PATH_MAX], lvm1_group_path[PATH_MAX];
-	char vg_path[PATH_MAX];
+	static char lv_path[PATH_MAX], link_path[PATH_MAX], lvm1_group_path[PATH_MAX];
+	static char vg_path[PATH_MAX];
 	struct stat buf, buf_lp;
 
 	if (dm_snprintf(vg_path, sizeof(vg_path), "%s%s",
@@ -226,7 +226,7 @@
 		    const char *lv_name, int check_udev)
 {
 	struct stat buf;
-	char lv_path[PATH_MAX];
+	static char lv_path[PATH_MAX];
 
 	if (dm_snprintf(lv_path, sizeof(lv_path), "%s%s/%s",
 			 dev_dir, vg_name, lv_name) == -1) {
--- LVM2/lib/commands/toolcontext.c	2011/11/11 15:11:11	1.140
+++ LVM2/lib/commands/toolcontext.c	2011/11/18 19:31:09	1.141
@@ -477,7 +477,7 @@
 
 static int _load_config_file(struct cmd_context *cmd, const char *tag)
 {
-	char config_file[PATH_MAX] = "";
+	static char config_file[PATH_MAX] = "";
 	const char *filler = "";
 	struct stat info;
 	struct config_tree_list *cfl;
@@ -786,10 +786,10 @@
 
 static int _init_filters(struct cmd_context *cmd, unsigned load_persistent_cache)
 {
+	static char cache_file[PATH_MAX];
 	const char *dev_cache = NULL, *cache_dir, *cache_file_prefix;
 	struct dev_filter *f3, *f4;
 	struct stat st;
-	char cache_file[PATH_MAX];
 
 	cmd->dump_filter = 0;
 
@@ -1138,8 +1138,8 @@
 
 static int _init_backup(struct cmd_context *cmd)
 {
+	static char default_dir[PATH_MAX];
 	uint32_t days, min;
-	char default_dir[PATH_MAX];
 	const char *dir;
 
 	if (!cmd->system_dir[0]) {
--- LVM2/lib/format_text/format-text.c	2011/08/30 14:55:17	1.185
+++ LVM2/lib/format_text/format-text.c	2011/11/18 19:31:10	1.186
@@ -1791,6 +1791,7 @@
 static int _create_vg_text_instance(struct format_instance *fid,
                                     const struct format_instance_ctx *fic)
 {
+	static char path[PATH_MAX];
 	uint32_t type = fic->type;
 	struct text_fid_context *fidtc;
 	struct metadata_area *mda;
@@ -1798,7 +1799,6 @@
 	struct dir_list *dl;
 	struct raw_list *rl;
 	struct dm_list *dir_list, *raw_list;
-	char path[PATH_MAX];
 	struct text_context tc;
 	struct lvmcache_vginfo *vginfo;
 	struct lvmcache_info *info;
--- LVM2/lib/metadata/metadata.c	2011/11/18 19:28:01	1.473
+++ LVM2/lib/metadata/metadata.c	2011/11/18 19:31:10	1.474
@@ -452,12 +452,12 @@
 
 static int validate_new_vg_name(struct cmd_context *cmd, const char *vg_name)
 {
-	char vg_path[PATH_MAX];
+	static char vg_path[PATH_MAX];
 
 	if (!validate_name(vg_name))
 		return_0;
 
-	snprintf(vg_path, PATH_MAX, "%s%s", cmd->dev_dir, vg_name);
+	snprintf(vg_path, sizeof(vg_path), "%s%s", cmd->dev_dir, vg_name);
 	if (path_exists(vg_path)) {
 		log_error("%s: already exists in filesystem", vg_path);
 		return 0;
@@ -4201,7 +4201,7 @@
 int fid_add_mda(struct format_instance *fid, struct metadata_area *mda,
 		 const char *key, size_t key_len, const unsigned sub_key)
 {
-	char full_key[PATH_MAX];
+	static char full_key[PATH_MAX];
 	dm_list_add(mda_is_ignored(mda) ? &fid->metadata_areas_ignored :
 					  &fid->metadata_areas_in_use, &mda->list);
 
@@ -4212,7 +4212,7 @@
 	/* Add metadata area to index. */
 	if (fid->type & FMT_INSTANCE_VG) {
 		if (!_convert_key_to_string(key, key_len, sub_key,
-					    full_key, PATH_MAX))
+					    full_key, sizeof(full_key)))
 		return_0;
 
 		dm_hash_insert(fid->metadata_areas_index.hash,
@@ -4246,13 +4246,13 @@
 					  const char *key, size_t key_len,
 					  const unsigned sub_key)
 {
-	char full_key[PATH_MAX];
+	static char full_key[PATH_MAX];
 	struct metadata_area *mda = NULL;
 
 
 	if (fid->type & FMT_INSTANCE_VG) {
 		if (!_convert_key_to_string(key, key_len, sub_key,
-					    full_key, PATH_MAX))
+					    full_key, sizeof(full_key)))
 			return_NULL;
 		mda = (struct metadata_area *) dm_hash_lookup(fid->metadata_areas_index.hash,
 							      full_key);
@@ -4266,8 +4266,8 @@
 int fid_remove_mda(struct format_instance *fid, struct metadata_area *mda,
 		   const char *key, size_t key_len, const unsigned sub_key)
 {
+	static char full_key[PATH_MAX];
 	struct metadata_area *mda_indexed = NULL;
-	char full_key[PATH_MAX];
 
 	/* At least one of mda or key must be specified. */
 	if (!mda && !key)
@@ -4287,7 +4287,7 @@
 
 		if (fid->type & FMT_INSTANCE_VG) {
 			if (!_convert_key_to_string(key, key_len, sub_key,
-					    full_key, PATH_MAX))
+					    full_key, sizeof(full_key)))
 				return_0;
 
 			dm_hash_remove(fid->metadata_areas_index.hash, full_key);


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2011-10-06 14:55 jbrassow
  0 siblings, 0 replies; 36+ messages in thread
From: jbrassow @ 2011-10-06 14:55 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2011-10-06 14:55:40

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c activate.h 
	lib/metadata   : mirror.c 

Log message:
	Fix splitmirror in cluster having different DM/LVM views of storage.
	This patch also does some clean-up of the splitmirrors code.
	
	I've attempted to clean-up the splitmirrors code to make it easier to
	understand with fewer operations.  I've tried to reduce the number of
	metadata operations without compromising the intermediate stages which
	are necessary for easy clean-up in the even of failure.
	
	These changes now correctly handle cluster situations - including exclusive
	cluster mirrors.  Whereas before, a splitmirror operation would result in
	remote nodes having LVM commands report the newly split LV with a proper
	name while DM commands would report the old (pre-split) names of the device.
	IOW, there was a kernel/userspace mismatch.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2148&r2=1.2149
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.216&r2=1.217
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.82&r2=1.83
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.172&r2=1.173

--- LVM2/WHATS_NEW	2011/10/06 14:49:16	1.2148
+++ LVM2/WHATS_NEW	2011/10/06 14:55:39	1.2149
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Fix splitmirror in cluster having different DM/LVM views of storage.
   Fix improper udev settings during suspend/resume for mirror sub-LVs.
   Fix vgsplit when there are mirrors that have mirrored logs.
   Clarify multi-name device filter pattern matching explanation in lvm.conf.5.
--- LVM2/lib/activate/activate.c	2011/10/03 18:37:47	1.216
+++ LVM2/lib/activate/activate.c	2011/10/06 14:55:40	1.217
@@ -230,10 +230,19 @@
 void activation_exit(void)
 {
 }
+
 int lv_is_active(struct logical_volume *lv)
 {
 	return 0;
 }
+int lv_is_active_but_not_locally(struct logical_volume *lv)
+{
+	return 0;
+}
+int lv_is_active_exclusive(struct logical_volume *lv)
+{
+	return 0;
+}
 int lv_is_active_exclusive_locally(struct logical_volume *lv)
 {
 	return 0;
@@ -242,6 +251,7 @@
 {
 	return 0;
 }
+
 int lv_check_transient(struct logical_volume *lv)
 {
 	return 1;
@@ -873,6 +883,13 @@
 	return _lv_is_active(lv, &l, NULL) && !l;
 }
 
+int lv_is_active_exclusive(struct logical_volume *lv)
+{
+	int e;
+
+	return _lv_is_active(lv, NULL, &e) && e;
+}
+
 int lv_is_active_exclusive_locally(struct logical_volume *lv)
 {
 	int l, e;
--- LVM2/lib/activate/activate.h	2011/10/03 18:37:47	1.82
+++ LVM2/lib/activate/activate.h	2011/10/06 14:55:40	1.83
@@ -109,6 +109,7 @@
 
 int lv_is_active(struct logical_volume *lv);
 int lv_is_active_but_not_locally(struct logical_volume *lv);
+int lv_is_active_exclusive(struct logical_volume *lv);
 int lv_is_active_exclusive_locally(struct logical_volume *lv);
 int lv_is_active_exclusive_remotely(struct logical_volume *lv);
 
--- LVM2/lib/metadata/mirror.c	2011/10/06 14:49:16	1.172
+++ LVM2/lib/metadata/mirror.c	2011/10/06 14:55:40	1.173
@@ -395,6 +395,22 @@
 }
 
 /*
+ * Activate an LV similarly (i.e. SH or EX) to a given "model" LV
+ */
+static int _activate_lv_like_model(struct logical_volume *model,
+				   struct logical_volume *lv)
+{
+	if (lv_is_active_exclusive(model)) {
+		if (!activate_lv_excl(lv->vg->cmd, lv))
+			return_0;
+	} else {
+		if (!activate_lv(lv->vg->cmd, lv))
+			return_0;
+	}
+	return 1;
+}
+
+/*
  * Delete independent/orphan LV, it must acquire lock.
  */
 static int _delete_lv(struct logical_volume *mirror_lv, struct logical_volume *lv)
@@ -417,13 +433,9 @@
 		}
 	}
 
-	if (lv_is_active_exclusive_locally(lv)) {
-		if (!activate_lv_excl(cmd, lv))
-			return_0;
-	} else {
-		if (!activate_lv(cmd, lv))
-			return_0;
-	}
+	// FIXME: shouldn't the activation type be based on mirror_lv, not lv?
+	if (!_activate_lv_like_model(lv, lv))
+		return_0;
 
 	sync_local_dev_names(lv->vg->cmd);
 	if (!deactivate_lv(cmd, lv))
@@ -560,8 +572,14 @@
 
 	if (!lv_mirror_percent(lv->vg->cmd, lv, 0, &sync_percent,
 			       NULL)) {
-		log_error("Unable to determine mirror sync status of %s/%s.",
-			  lv->vg->name, lv->name);
+		if (lv_is_active_but_not_locally(lv))
+			log_error("Unable to determine mirror sync status of"
+				  " remotely active LV, %s/%s",
+				  lv->vg->name, lv->name);
+		else
+			log_error("Unable to determine mirror "
+				  "sync status of %s/%s.",
+				  lv->vg->name, lv->name);
 		return 0;
 	}
 
@@ -584,7 +602,7 @@
 	struct logical_volume *detached_log_lv = NULL;
 	struct lv_segment *mirrored_seg = first_seg(lv);
 	struct dm_list split_images;
-	struct lv_list *lvl, *new_lvl = NULL;
+	struct lv_list *lvl;
 	struct cmd_context *cmd = lv->vg->cmd;
 
 	if (!(lv->status & MIRRORED)) {
@@ -626,12 +644,18 @@
 		sub_lv = seg_lv(mirrored_seg, mirrored_seg->area_count);
 
 		sub_lv->status &= ~MIRROR_IMAGE;
-		lv_set_visible(sub_lv);
 		release_lv_segment_area(mirrored_seg, mirrored_seg->area_count,
 					mirrored_seg->area_len);
 
 		log_very_verbose("%s assigned to be split", sub_lv->name);
 
+		if (!new_lv) {
+			lv_set_visible(sub_lv);
+			new_lv = sub_lv;
+			continue;
+		}
+
+		/* If there is more than one image being split, add to list */
 		lvl = dm_pool_alloc(lv->vg->vgmem, sizeof(*lvl));
 		if (!lvl) {
 			log_error("lv_list alloc failed");
@@ -640,90 +664,7 @@
 		lvl->lv = sub_lv;
 		dm_list_add(&split_images, &lvl->list);
 	}
-	sub_lv = NULL;
-
-	/*
-	 * If no more mirrors, remove mirror layer.
-	 * The sub_lv is removed entirely later - leaving
-	 * only the top-level (now linear) LV.
-	 */
-	if (mirrored_seg->area_count == 1) {
-		sub_lv = seg_lv(mirrored_seg, 0);
-		sub_lv->status &= ~MIRROR_IMAGE;
-		lv_set_visible(sub_lv);
-		detached_log_lv = detach_mirror_log(mirrored_seg);
-		if (!remove_layer_from_lv(lv, sub_lv))
-			return_0;
-		lv->status &= ~MIRRORED;
-		lv->status &= ~LV_NOTSYNCED;
-	}
-
-	if (!vg_write(mirrored_seg->lv->vg)) {
-		log_error("Intermediate VG metadata write failed.");
-		return 0;
-	}
-
-	/*
-	 * Suspend the mirror - this includes all the sub-LVs and
-	 *                      soon-to-be-split sub-LVs
-	 */
-	if (!suspend_lv(cmd, mirrored_seg->lv)) {
-		log_error("Failed to lock %s", mirrored_seg->lv->name);
-		vg_revert(mirrored_seg->lv->vg);
-		return 0;
-	}
-
-	if (!vg_commit(mirrored_seg->lv->vg)) {
-		resume_lv(cmd, mirrored_seg->lv);
-		return 0;
-	}
-
-	log_very_verbose("Updating \"%s\" in kernel", mirrored_seg->lv->name);
-
-	/*
-	 * Resume the mirror - this also activates the visible, independent
-	 *                     soon-to-be-split sub-LVs
-	 */
-	if (!resume_lv(cmd, mirrored_seg->lv)) {
-		log_error("Problem resuming %s", mirrored_seg->lv->name);
-		return 0;
-	}
-
-	/* Remove original mirror layer if it has been converted to linear */
-	if (sub_lv && !_delete_lv(lv, sub_lv))
-		return_0;
-
-	/* Remove the log if it has been converted to linear */
-	if (detached_log_lv && !_delete_lv(lv, detached_log_lv))
-		return_0;
-
-	/*
-	 * Step 2:
-	 *   The original mirror has been changed and we now have visible,
-	 *   independent, not-yet-renamed, active sub-LVs.  We must:
-	 *   - deactivate the split sub-LVs
-	 *   - rename them
-	 *   - form new mirror if necessary
-	 *   - commit VG changes
-	 *   - activate the new LV
-	 */
-	sync_local_dev_names(lv->vg->cmd);
-	dm_list_iterate_items(lvl, &split_images) {
-		if (!new_lv) {
-			/* Grab 1st sub-LV for later */
-			new_lvl = lvl;
-			new_lv = lvl->lv;
-		}
-
-		sub_lv = lvl->lv;
-		if (!deactivate_lv(cmd, sub_lv)) {
-			log_error("Failed to deactivate former mirror image, %s",
-				  sub_lv->name);
-			return 0;
-		}
-	}
 
-	dm_list_del(&new_lvl->list);
 	new_lv->name = dm_pool_strdup(lv->vg->vgmem, split_name);
 	if (!new_lv->name) {
 		log_error("Unable to rename newly split LV");
@@ -780,19 +721,77 @@
 		init_mirror_in_sync(1);
 	}
 
-	if (!vg_write(mirrored_seg->lv->vg) ||
-	    !vg_commit(mirrored_seg->lv->vg))
-		return_0;
+	sub_lv = NULL;
+
+	/*
+	 * If no more mirrors, remove mirror layer.
+	 * The sub_lv is removed entirely later - leaving
+	 * only the top-level (now linear) LV.
+	 */
+	if (mirrored_seg->area_count == 1) {
+		sub_lv = seg_lv(mirrored_seg, 0);
+		sub_lv->status &= ~MIRROR_IMAGE;
+		lv_set_visible(sub_lv);
+		detached_log_lv = detach_mirror_log(mirrored_seg);
+		if (!remove_layer_from_lv(lv, sub_lv))
+			return_0;
+		lv->status &= ~MIRRORED;
+		lv->status &= ~LV_NOTSYNCED;
+	}
+
+	if (!vg_write(mirrored_seg->lv->vg)) {
+		log_error("Intermediate VG metadata write failed.");
+		return 0;
+	}
 
-	/* Bring newly split-off LV into existence */
-	if (!activate_lv(cmd, new_lv)) {
-		log_error("Failed to activate newly split LV, %s",
-			  new_lv->name);
+	/*
+	 * Suspend the mirror - this includes all the sub-LVs and
+	 *                      soon-to-be-split sub-LVs
+	 */
+	if (!suspend_lv(cmd, mirrored_seg->lv)) {
+		log_error("Failed to lock %s", mirrored_seg->lv->name);
+		vg_revert(mirrored_seg->lv->vg);
 		return 0;
 	}
 
-	log_very_verbose("%" PRIu32 " image(s) detached from %s",
-			 split_count, lv->name);
+	if (!vg_commit(mirrored_seg->lv->vg)) {
+		resume_lv(cmd, mirrored_seg->lv);
+		return 0;
+	}
+
+	log_very_verbose("Updating \"%s\" in kernel", mirrored_seg->lv->name);
+
+	/*
+	 * Resume the mirror - this also activates the visible, independent
+	 *                     soon-to-be-split sub-LVs
+	 */
+	if (!resume_lv(cmd, mirrored_seg->lv)) {
+		log_error("Problem resuming %s", mirrored_seg->lv->name);
+		return 0;
+	}
+
+	/*
+	 * Recycle newly split LV so it is properly renamed.
+	 *   Cluster requires the extra deactivate/activate calls.
+	 */
+	if (vg_is_clustered(lv->vg) &&
+	    (!deactivate_lv(cmd, new_lv) ||
+	     !_activate_lv_like_model(lv, new_lv))) {
+		log_error("Failed to rename newly split LV in the kernel");
+		return 0;
+	}
+	if (!suspend_lv(cmd, new_lv) || !resume_lv(cmd, new_lv)) {
+		log_error("Failed to rename newly split LV in the kernel");
+		return 0;
+	}
+
+	/* Remove original mirror layer if it has been converted to linear */
+	if (sub_lv && !_delete_lv(lv, sub_lv))
+		return_0;
+
+	/* Remove the log if it has been converted to linear */
+	if (detached_log_lv && !_delete_lv(lv, detached_log_lv))
+		return_0;
 
 	return 1;
 }


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2011-10-03 18:37 zkabelac
  0 siblings, 0 replies; 36+ messages in thread
From: zkabelac @ 2011-10-03 18:37 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-10-03 18:37:48

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c activate.h dev_manager.c 
	                 dev_manager.h 

Log message:
	Add lvm functions for sending messages.
	
	Functions are currently only needed for thin provissioning.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2143&r2=1.2144
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.215&r2=1.216
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.81&r2=1.82
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.235&r2=1.236
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.h.diff?cvsroot=lvm2&r1=1.38&r2=1.39

--- LVM2/WHATS_NEW	2011/09/27 22:43:40	1.2143
+++ LVM2/WHATS_NEW	2011/10/03 18:37:47	1.2144
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Introduce lv_send_message and dev_manager_send_message.
   Introduce revert_lv for better pvmove cleanup.
   Replace incomplete pvmove activation failure recovery code with a message.
   Abort if _finish_pvmove suspend_lvs fails instead of cleaning up incompletely.
--- LVM2/lib/activate/activate.c	2011/09/27 22:43:40	1.215
+++ LVM2/lib/activate/activate.c	2011/10/03 18:37:47	1.216
@@ -215,6 +215,10 @@
 {
 	return 1;
 }
+int lv_send_message(const struct logical_volume *lv, const char *message)
+{
+	return 0;
+}
 int pv_uses_vg(struct physical_volume *pv,
 	       struct volume_group *vg)
 {
@@ -1643,6 +1647,55 @@
 	return r;
 }
 
+#if 0
+// FIXME: Remove this - example of supported messages thin pool
+"create_thin %u", dev_id
+"create_snap %u", dev_id
+"delete %u", dev_id
+"trim %u %" PRIu64, dev_id, new_size_sec
+"set_transaction_id %" PRIu64 " %" PRIu64, cur_id, new_id
+#endif
+
+int lv_send_message(const struct logical_volume *lv, const char *msg_format, ...)
+{
+	va_list ap;
+	struct dev_manager *dm;
+	const size_t buf_size = 128;
+	char *buf = NULL;
+	int r = 0, pr;
+
+	if (!activation())
+		return 0;
+
+	if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, 1)))
+		return_0;
+
+	if (!(buf = dm_malloc(buf_size))) {
+		log_error("Failed to allocate message buffer.");
+		goto out;
+	}
+
+	va_start(ap, msg_format);
+	pr = vsnprintf(buf, buf_size, msg_format, ap);
+	va_end(ap);
+
+	if (pr < 0 || pr >= buf_size) {
+		log_error("Failed to create message in reserved buffer size "
+			  "%" PRIsize_t, buf_size);
+		goto out;
+	}
+
+	log_debug("Sending message '%s' to LV %s/%s", buf, lv->vg->name, lv->name);
+
+	if (!(r = dev_manager_send_message(dm, lv, buf)))
+		stack;
+out:
+	dm_free(buf);
+	dev_manager_destroy(dm);
+
+	return r;
+}
+
 /*
  * Does PV use VG somewhere in its construction?
  * Returns 1 on failure.
--- LVM2/lib/activate/activate.h	2011/09/27 22:43:40	1.81
+++ LVM2/lib/activate/activate.h	2011/10/03 18:37:47	1.82
@@ -71,6 +71,8 @@
 int lv_deactivate(struct cmd_context *cmd, const char *lvid_s);
 
 int lv_mknodes(struct cmd_context *cmd, const struct logical_volume *lv);
+__attribute__ ((format(printf, 2, 3)))
+int lv_send_message(const struct logical_volume *lv, const char *msg_format, ...);
 
 /*
  * Returns 1 if info structure has been populated, else 0.
--- LVM2/lib/activate/dev_manager.c	2011/10/03 18:24:47	1.235
+++ LVM2/lib/activate/dev_manager.c	2011/10/03 18:37:47	1.236
@@ -876,6 +876,34 @@
 	return r;
 }
 
+/*
+ * Send message
+ */
+int dev_manager_send_message(struct dev_manager *dm, const struct logical_volume *lv, const char *message)
+{
+	const char *name;
+	struct dm_task *dmt;
+	int r = 0;
+
+	if (!(name = dm_build_dm_name(dm->mem, lv->vg->name, lv->name, NULL)))
+		return_0;
+
+	if (!(dmt = _setup_task(name, NULL, NULL, DM_DEVICE_TARGET_MSG, 0, 0)))
+		return_0;
+
+	if (!dm_task_set_message(dmt, message))
+		goto_out;
+
+	if (!dm_task_run(dmt))
+		goto_out;
+
+	r = 1;
+out:
+	dm_task_destroy(dmt);
+
+	return r;
+}
+
 static uint16_t _get_udev_flags(struct dev_manager *dm, struct logical_volume *lv,
 				const char *layer)
 {
--- LVM2/lib/activate/dev_manager.h	2011/06/17 14:14:19	1.38
+++ LVM2/lib/activate/dev_manager.h	2011/10/03 18:37:48	1.39
@@ -62,6 +62,7 @@
 int dev_manager_transient(struct dev_manager *dm, struct logical_volume *lv) __attribute__((nonnull(1, 2)));
 
 int dev_manager_mknodes(const struct logical_volume *lv);
+int dev_manager_send_message(struct dev_manager *dm, const struct logical_volume *lv, const char *message);
 
 /*
  * Put the desired changes into effect.


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2011-09-22 17:33 prajnoha
  0 siblings, 0 replies; 36+ messages in thread
From: prajnoha @ 2011-09-22 17:33 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	prajnoha@sourceware.org	2011-09-22 17:33:51

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c activate.h 
	lib/commands   : toolcontext.c 
	lib/metadata   : lv_manip.c 
	libdm          : libdm-deptree.c 

Log message:
	Replace open_count check with holders/mounted_fs check on lvremove path.
	
	Before, we used to display "Can't remove open logical volume" which was
	generic. There 3 possibilities of how a device could be opened:
	- used by another device
	- having a filesystem on that device which is mounted
	- opened directly by an application
	
	With the help of sysfs info, we can distinguish the first two situations.
	The third one will be subject to "remove retry" logic - if it's opened
	quickly (e.g. a parallel scan from within a udev rule run), this will
	finish quickly and we can remove it once it has finished. If it's a
	legitimate application that keeps the device opened, we'll do our best
	to remove the device, but we will fail finally after a few retries.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2130&r2=1.2131
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.212&r2=1.213
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.79&r2=1.80
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.135&r2=1.136
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.289&r2=1.290
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-deptree.c.diff?cvsroot=lvm2&r1=1.109&r2=1.110

--- LVM2/WHATS_NEW	2011/09/22 15:36:21	1.2130
+++ LVM2/WHATS_NEW	2011/09/22 17:33:50	1.2131
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Replace open_count check with holders/mounted_fs check on lvremove path.
   Disallow the creation of mirrors (mirror or raid1 segtype) with only one leg.
   Cleanup restart clvmd code (no memory allocation, debug print passed args).
   Add all exclusive locks to clvmd restart option args.
--- LVM2/lib/activate/activate.c	2011/08/30 14:55:16	1.212
+++ LVM2/lib/activate/activate.c	2011/09/22 17:33:50	1.213
@@ -526,6 +526,31 @@
 	return r;
 }
 
+int lv_check_not_in_use(struct cmd_context *cmd __attribute__((unused)),
+			struct logical_volume *lv, struct lvinfo *info)
+{
+	if (!info->exists)
+		return 1;
+
+	/* If sysfs is not used, use open_count information only. */
+	if (!*dm_sysfs_dir())
+		return !info->open_count;
+
+	if (dm_device_has_holders(info->major, info->minor)) {
+		log_error("Logical volume %s/%s is used by another device.",
+			  lv->vg->name, lv->name);
+		return 0;
+	}
+
+	if (dm_device_has_mounted_fs(info->major, info->minor)) {
+		log_error("Logical volume %s/%s contains a filesystem in use.",
+			  lv->vg->name, lv->name);
+		return 0;
+	}
+
+	return 1;
+}
+
 /*
  * Returns 1 if percent set, else 0 on failure.
  */
@@ -1437,11 +1462,9 @@
 	}
 
 	if (lv_is_visible(lv)) {
-		if (info.open_count) {
-			log_error("LV %s/%s in use: not deactivating",
-				  lv->vg->name, lv->name);
-			goto out;
-		}
+		if (!lv_check_not_in_use(cmd, lv, &info))
+			goto_out;
+
 		if (lv_is_origin(lv) && _lv_has_open_snapshots(lv))
 			goto_out;
 	}
--- LVM2/lib/activate/activate.h	2011/08/11 18:24:41	1.79
+++ LVM2/lib/activate/activate.h	2011/09/22 17:33:51	1.80
@@ -80,6 +80,9 @@
 int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s, unsigned origin_only,
 		    struct lvinfo *info, int with_open_count, int with_read_ahead);
 
+int lv_check_not_in_use(struct cmd_context *cmd, struct logical_volume *lv,
+			struct lvinfo *info);
+
 /*
  * Returns 1 if activate_lv has been set: 1 = activate; 0 = don't.
  */
--- LVM2/lib/commands/toolcontext.c	2011/09/02 12:38:43	1.135
+++ LVM2/lib/commands/toolcontext.c	2011/09/22 17:33:51	1.136
@@ -264,6 +264,7 @@
 	/* FIXME Use global value of sysfs_dir everywhere instead cmd->sysfs_dir. */
 	_get_sysfs_dir(cmd);
 	set_sysfs_dir_path(cmd->sysfs_dir);
+	dm_set_sysfs_dir(cmd->sysfs_dir);
 
 	/* activation? */
 	cmd->default_settings.activation = find_config_tree_int(cmd,
--- LVM2/lib/metadata/lv_manip.c	2011/09/16 18:39:03	1.289
+++ LVM2/lib/metadata/lv_manip.c	2011/09/22 17:33:51	1.290
@@ -3099,11 +3099,8 @@
 	/* FIXME Ensure not referred to by another existing LVs */
 
 	if (lv_info(cmd, lv, 0, &info, 1, 0)) {
-		if (info.open_count) {
-			log_error("Can't remove open logical volume \"%s\"",
-				  lv->name);
-			return 0;
-		}
+		if (!lv_check_not_in_use(cmd, lv, &info))
+			return_0;
 
 		if (lv_is_active(lv) && (force == PROMPT) &&
 		    lv_is_visible(lv) &&
--- LVM2/libdm/libdm-deptree.c	2011/09/07 08:37:48	1.109
+++ LVM2/libdm/libdm-deptree.c	2011/09/22 17:33:51	1.110
@@ -940,6 +940,30 @@
 	return r;
 }
 
+static int _check_device_not_in_use(struct dm_info *info)
+{
+	if (!info->exists)
+		return 1;
+
+	/* If sysfs is not used, use open_count information only. */
+	if (!*dm_sysfs_dir())
+		return !info->open_count;
+
+	if (dm_device_has_holders(info->major, info->minor)) {
+		log_error("Device %" PRIu32 ":%" PRIu32 " is used "
+			  "by another device.", info->major, info->minor);
+		return 0;
+	}
+
+	if (dm_device_has_mounted_fs(info->major, info->minor)) {
+		log_error("Device %" PRIu32 ":%" PRIu32 " contains "
+			  "a filesystem in use.", info->major, info->minor);
+		return 0;
+	}
+
+	return 1;
+}
+
 /* Check if all parent nodes of given node have open_count == 0 */
 static int _node_has_closed_parents(struct dm_tree_node *node,
 				    const char *uuid_prefix,
@@ -1184,9 +1208,11 @@
 		    !info.exists)
 			continue;
 
+		if (!_check_device_not_in_use(&info))
+			continue;
+
 		/* Also checking open_count in parent nodes of presuspend_node */
-		if (info.open_count ||
-		    (child->presuspend_node &&
+		if ((child->presuspend_node &&
 		     !_node_has_closed_parents(child->presuspend_node,
 					       uuid_prefix, uuid_prefix_len))) {
 			/* Only report error from (likely non-internal) dependency at top level */


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2011-06-30 18:25 agk
  0 siblings, 0 replies; 36+ messages in thread
From: agk @ 2011-06-30 18:25 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2011-06-30 18:25:19

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c dev_manager.c 
	lib/metadata   : lv_manip.c metadata.h 

Log message:
	When suspending, automatically preload newly-visible existing LVs
	Let's find out if this makes things better or worse overall...

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2033&r2=1.2034
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.203&r2=1.204
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.220&r2=1.221
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.265&r2=1.266
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.246&r2=1.247

--- LVM2/WHATS_NEW	2011/06/30 09:24:58	1.2033
+++ LVM2/WHATS_NEW	2011/06/30 18:25:18	1.2034
@@ -1,5 +1,6 @@
 Version 2.02.86 -  
 =================================
+  When suspending, automatically preload newly-visible existing LVs.
   Report internal error when parameters are missing on table load.
   Teardown any stray devices with $COMMON_PREFIX during test runs.
   Reinstate correct permissions when creating mirrors. [2.02.85]
--- LVM2/lib/activate/activate.c	2011/06/22 21:31:21	1.203
+++ LVM2/lib/activate/activate.c	2011/06/30 18:25:18	1.204
@@ -1097,6 +1097,26 @@
 #endif
 }
 
+struct detached_lv_data {
+	struct logical_volume *lv_pre;
+	struct lv_activate_opts *laopts;
+	int *flush_required;
+};
+
+static int _preload_detached_lv(struct cmd_context *cmd, struct logical_volume *lv, void *data)
+{
+	struct detached_lv_data *detached = data;
+	struct lv_list *lvl_pre;
+
+	if ((lvl_pre = find_lv_in_vg(detached->lv_pre->vg, lv->name))) {
+		if (lv_is_visible(lvl_pre->lv) && lv_is_active(lv) &&
+		    !_lv_preload(lvl_pre->lv, detached->laopts, detached->flush_required))
+			return_0;
+	}
+
+	return 1;
+}
+
 static int _lv_suspend(struct cmd_context *cmd, const char *lvid_s,
 		       struct lv_activate_opts *laopts, int error_if_not_suspended)
 {
@@ -1105,6 +1125,7 @@
 	struct seg_list *sl;
 	struct lvinfo info;
 	int r = 0, lockfs = 0, flush_required = 0;
+	struct detached_lv_data detached;
 
 	if (!activation())
 		return 1;
@@ -1172,9 +1193,21 @@
 			}
 			if (!_lv_preload(lvl_pre->lv, laopts, &flush_required))
 				goto_out;
-		} else if (!_lv_preload(lv_pre, laopts, &flush_required))
-			/* FIXME Revert preloading */
-			goto_out;
+		} else {
+			if (!_lv_preload(lv_pre, laopts, &flush_required))
+				/* FIXME Revert preloading */
+				goto_out;
+
+			/*
+			 * Search for existing LVs that have become detached and preload them.
+			 */
+			detached.lv_pre = lv_pre;
+			detached.laopts = laopts;
+			detached.flush_required = &flush_required;
+
+			if (!for_each_sub_lv(cmd, lv, &_preload_detached_lv, &detached))
+				goto_out;
+		}
 	}
 
 	if (!monitor_dev_for_events(cmd, lv, laopts, 0))
--- LVM2/lib/activate/dev_manager.c	2011/06/17 14:50:53	1.220
+++ LVM2/lib/activate/dev_manager.c	2011/06/30 18:25:18	1.221
@@ -1096,11 +1096,11 @@
 		return NULL;
 	}
 
-	if (!_add_lv_to_dtree(dm, dtree, lv, origin_only))
+	if (!_add_lv_to_dtree(dm, dtree, lv, lv_is_origin(lv) ? origin_only : 0))
 		goto_bad;
 
 	/* Add any snapshots of this LV */
-	if (!origin_only)
+	if (!origin_only && lv_is_origin(lv))
 		dm_list_iterate_safe(snh, snht, &lv->snapshot_segs)
 			if (!_add_lv_to_dtree(dm, dtree, dm_list_struct_base(snh, struct lv_segment, origin_list)->cow, 0))
 				goto_bad;
@@ -1714,7 +1714,7 @@
 	/* Restore fs cookie */
 	dm_tree_set_cookie(root, fs_get_cookie());
 
-	if (!(dlid = build_dm_uuid(dm->mem, lv->lvid.s, laopts->origin_only ? "real" : NULL)))
+	if (!(dlid = build_dm_uuid(dm->mem, lv->lvid.s, (lv_is_origin(lv) && laopts->origin_only) ? "real" : NULL)))
 		goto_out;
 
 	/* Only process nodes with uuid of "LVM-" plus VG id. */
@@ -1744,7 +1744,7 @@
 	case PRELOAD:
 	case ACTIVATE:
 		/* Add all required new devices to tree */
-		if (!_add_new_lv_to_dtree(dm, dtree, lv, laopts, laopts->origin_only ? "real" : NULL))
+		if (!_add_new_lv_to_dtree(dm, dtree, lv, laopts, (lv_is_origin(lv) && laopts->origin_only) ? "real" : NULL))
 			goto_out;
 
 		/* Preload any devices required before any suspensions */
--- LVM2/lib/metadata/lv_manip.c	2011/06/29 17:05:53	1.265
+++ LVM2/lib/metadata/lv_manip.c	2011/06/30 18:25:18	1.266
@@ -2317,7 +2317,7 @@
 	return _rename_single_lv(lv, new_name);
 }
 
-/* Callback for _for_each_sub_lv */
+/* Callback for for_each_sub_lv */
 static int _rename_cb(struct cmd_context *cmd, struct logical_volume *lv,
 		      void *data)
 {
@@ -2327,32 +2327,31 @@
 }
 
 /*
- * Loop down sub LVs and call "func" for each.
- * "func" is responsible to log necessary information on failure.
+ * Loop down sub LVs and call fn for each.
+ * fn is responsible to log necessary information on failure.
  */
-static int _for_each_sub_lv(struct cmd_context *cmd, struct logical_volume *lv,
-			    int (*func)(struct cmd_context *cmd,
-					struct logical_volume *lv,
-					void *data),
-			    void *data)
+int for_each_sub_lv(struct cmd_context *cmd, struct logical_volume *lv,
+		    int (*fn)(struct cmd_context *cmd,
+			      struct logical_volume *lv, void *data),
+		    void *data)
 {
 	struct logical_volume *org;
 	struct lv_segment *seg;
 	uint32_t s;
 
 	if (lv_is_cow(lv) && lv_is_virtual_origin(org = origin_from_cow(lv)))
-		if (!func(cmd, org, data))
+		if (!fn(cmd, org, data))
 			return_0;
 
 	dm_list_iterate_items(seg, &lv->segments) {
-		if (seg->log_lv && !func(cmd, seg->log_lv, data))
+		if (seg->log_lv && !fn(cmd, seg->log_lv, data))
 			return_0;
 		for (s = 0; s < seg->area_count; s++) {
 			if (seg_type(seg, s) != AREA_LV)
 				continue;
-			if (!func(cmd, seg_lv(seg, s), data))
+			if (!fn(cmd, seg_lv(seg, s), data))
 				return_0;
-			if (!_for_each_sub_lv(cmd, seg_lv(seg, s), func, data))
+			if (!for_each_sub_lv(cmd, seg_lv(seg, s), fn, data))
 				return_0;
 		}
 	}
@@ -2397,7 +2396,7 @@
 	/* rename sub LVs */
 	lv_names.old = lv->name;
 	lv_names.new = new_name;
-	if (!_for_each_sub_lv(cmd, lv, _rename_cb, (void *) &lv_names))
+	if (!for_each_sub_lv(cmd, lv, _rename_cb, (void *) &lv_names))
 		return 0;
 
 	/* rename main LV */
--- LVM2/lib/metadata/metadata.h	2011/06/17 14:30:58	1.246
+++ LVM2/lib/metadata/metadata.h	2011/06/30 18:25:18	1.247
@@ -441,6 +441,11 @@
 int remove_seg_from_segs_using_this_lv(struct logical_volume *lv, struct lv_segment *seg);
 struct lv_segment *get_only_segment_using_this_lv(struct logical_volume *lv);
 
+int for_each_sub_lv(struct cmd_context *cmd, struct logical_volume *lv,
+                    int (*fn)(struct cmd_context *cmd,
+                              struct logical_volume *lv, void *data),
+                    void *data);
+
 /*
  * Calculate readahead from underlying PV devices
  */


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2011-06-22 21:31 jbrassow
  0 siblings, 0 replies; 36+ messages in thread
From: jbrassow @ 2011-06-22 21:31 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2011-06-22 21:31:21

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c activate.h 
	lib/metadata   : mirror.c 

Log message:
	Fix issue preventing cluster mirror creation.
	
	Mirrors used to be created by first creating a linear device and then adding
	the other images plus the log.  Now mirrors are created by creating all the
	images in one go and then adding the log separately.  The new way ran into
	the condition that cluster mirrors cannot change the log type (in the case
	of creation, from core -> disk) while the mirror is not active.  (It isn't
	active because it is in the process of being created.)  The reason this
	condition is in place is because a remote node may have the mirror active, and
	we don't want to alter the log underneath it.
	
	What we really needed was a way of checking if the mirror was active remotely
	but not locally, and in that case do not allow a change of the log.  I've added
	this check, and cluster mirrors can now be created again.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2023&r2=1.2024
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.202&r2=1.203
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.77&r2=1.78
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.154&r2=1.155

--- LVM2/WHATS_NEW	2011/06/17 14:50:53	1.2023
+++ LVM2/WHATS_NEW	2011/06/22 21:31:21	1.2024
@@ -1,5 +1,6 @@
 Version 2.02.86 -  
 =================================
+  Fix issue preventing cluster mirror creation.
   Disable udev fallback by default and add activation/udev_fallback to lvm.conf.
   Call vg_mark_partial_lvs() before VG structure is returned from the cache.
   Remove unused internal flag ACTIVATE_EXCL from the code.
--- LVM2/lib/activate/activate.c	2011/06/17 14:30:58	1.202
+++ LVM2/lib/activate/activate.c	2011/06/22 21:31:21	1.203
@@ -823,13 +823,11 @@
 	return _lv_is_active(lv, NULL, NULL);
 }
 
-/*
-int lv_is_active_locally(struct logical_volume *lv)
+int lv_is_active_but_not_locally(struct logical_volume *lv)
 {
 	int l;
-	return _lv_is_active(lv, &l, NULL) && l;
+	return _lv_is_active(lv, &l, NULL) && !l;
 }
-*/
 
 int lv_is_active_exclusive_locally(struct logical_volume *lv)
 {
--- LVM2/lib/activate/activate.h	2011/06/17 14:14:19	1.77
+++ LVM2/lib/activate/activate.h	2011/06/22 21:31:21	1.78
@@ -101,6 +101,7 @@
 int lvs_in_vg_opened(const struct volume_group *vg);
 
 int lv_is_active(struct logical_volume *lv);
+int lv_is_active_but_not_locally(struct logical_volume *lv);
 int lv_is_active_exclusive_locally(struct logical_volume *lv);
 int lv_is_active_exclusive_remotely(struct logical_volume *lv);
 
--- LVM2/lib/metadata/mirror.c	2011/06/17 14:27:35	1.154
+++ LVM2/lib/metadata/mirror.c	2011/06/22 21:31:21	1.155
@@ -1857,15 +1857,9 @@
 		return 0;
 	}
 
-	/*
-	 * We are unable to convert the log of inactive cluster mirrors
-	 * due to the inability to detect whether the mirror is active
-	 * on remote nodes (even though it is inactive on this node)
-	 */
-	if (vg_is_clustered(lv->vg) &&
-	    !(lv_info(cmd, lv, 0, &info, 0, 0) && info.exists)) {
-		log_error("Unable to convert the log of inactive "
-			  "cluster mirror %s", lv->name);
+	if (lv_is_active_but_not_locally(lv)) {
+		log_error("Unable to convert the log of a mirror, %s, that is "
+			  "active remotely but not locally", lv->name);
 		return 0;
 	}
 


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2011-06-17 14:22 zkabelac
  0 siblings, 0 replies; 36+ messages in thread
From: zkabelac @ 2011-06-17 14:22 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-06-17 14:22:49

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c dev_manager.c 
	lib/snapshot   : snapshot.c 

Log message:
	Use lv_activate_opts struct instead of ACTIVATE_EXCL status flag
	
	Let's hope all conditions has been properly converted.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2018&r2=1.2019
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.199&r2=1.200
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.218&r2=1.219
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/snapshot.c.diff?cvsroot=lvm2&r1=1.56&r2=1.57

--- LVM2/WHATS_NEW	2011/06/17 14:17:16	1.2018
+++ LVM2/WHATS_NEW	2011/06/17 14:22:48	1.2019
@@ -1,5 +1,6 @@
 Version 2.02.86 -  
 =================================
+  Use lv_activate_opts struct instead of MERGING status flag.
   Use lv_activate_opts struct instead of ACTIVATE_EXCL status flag.
   Add lv_activate_opts structure for activation (replacing activation flags).
   Fix a problem with inconsistent pre-commit metadata on MISSING_PV devices.
--- LVM2/lib/activate/activate.c	2011/06/17 14:14:19	1.199
+++ LVM2/lib/activate/activate.c	2011/06/17 14:22:48	1.200
@@ -986,8 +986,8 @@
 	 * In case of a snapshot device, we monitor lv->snapshot->lv,
 	 * not the actual LV itself.
 	 */
-	if (lv_is_cow(lv) && !lv_is_merging_cow(lv))
-		return monitor_dev_for_events(cmd, lv->snapshot->lv, 0, monitor);
+	if (lv_is_cow(lv) && (laopts->no_merging || !lv_is_merging_cow(lv)))
+		return monitor_dev_for_events(cmd, lv->snapshot->lv, NULL, monitor);
 
 	/*
 	 * In case this LV is a snapshot origin, we instead monitor
--- LVM2/lib/activate/dev_manager.c	2011/06/17 14:14:19	1.218
+++ LVM2/lib/activate/dev_manager.c	2011/06/17 14:22:48	1.219
@@ -1276,7 +1276,7 @@
 
 	size = (uint64_t) snap_seg->len * snap_seg->origin->vg->extent_size;
 
-	if (lv_is_merging_cow(lv)) {
+	if (!laopts->no_merging && lv_is_merging_cow(lv)) {
 		/* cow is to be merged so load the error target */
 		if (!dm_tree_node_add_error_target(dnode, size))
 			return_0;
@@ -1412,7 +1412,7 @@
 	/* If this is a snapshot origin, add real LV */
 	/* If this is a snapshot origin + merging snapshot, add cow + real LV */
 	} else if (lv_is_origin(seg->lv) && !layer) {
-		if (lv_is_merging_origin(seg->lv)) {
+		if (!laopts->no_merging && lv_is_merging_origin(seg->lv)) {
 			if (!_add_new_lv_to_dtree(dm, dtree,
 			     find_merging_cow(seg->lv)->cow, laopts, "cow"))
 				return_0;
@@ -1423,7 +1423,7 @@
 		}
 		if (!_add_new_lv_to_dtree(dm, dtree, seg->lv, laopts, "real"))
 			return_0;
-	} else if (lv_is_cow(seg->lv) && !layer) {
+	} else if (!laopts->no_merging && lv_is_cow(seg->lv) && !layer) {
 		if (!_add_new_lv_to_dtree(dm, dtree, seg->lv, laopts, "cow"))
 			return_0;
 	} else {
@@ -1437,14 +1437,14 @@
 
 	/* Now we've added its dependencies, we can add the target itself */
 	if (lv_is_origin(seg->lv) && !layer) {
-		if (!lv_is_merging_origin(seg->lv)) {
+		if (laopts->no_merging || !lv_is_merging_origin(seg->lv)) {
 			if (!_add_origin_target_to_dtree(dm, dnode, seg->lv))
 				return_0;
 		} else {
 			if (!_add_snapshot_merge_target_to_dtree(dm, dnode, seg->lv))
 				return_0;
 		}
-	} else if (lv_is_cow(seg->lv) && !layer) {
+	} else if (!laopts->no_merging && lv_is_cow(seg->lv) && !layer) {
 		if (!_add_snapshot_target_to_dtree(dm, dnode, seg->lv, laopts))
 			return_0;
 	} else if (!_add_target_to_dtree(dm, dnode, seg, laopts))
@@ -1490,7 +1490,7 @@
 					   dtree)) && dinfo->open_count)) {
 			/* FIXME Is there anything simpler to check for instead? */
 			if (!lv_has_target_type(dm->mem, lv, NULL, "snapshot-merge"))
-				clear_snapshot_merge(lv);
+				laopts->no_merging = 1;
 		}
 	}
 
@@ -1542,7 +1542,7 @@
 		/* These aren't real segments in the LVM2 metadata */
 		if (lv_is_origin(lv) && !layer)
 			break;
-		if (lv_is_cow(lv) && !layer)
+		if (!laopts->no_merging && lv_is_cow(lv) && !layer)
 			break;
 		if (max_stripe_size < seg->stripe_size * seg->area_count)
 			max_stripe_size = seg->stripe_size * seg->area_count;
--- LVM2/lib/snapshot/snapshot.c	2011/06/17 14:14:20	1.56
+++ LVM2/lib/snapshot/snapshot.c	2011/06/17 14:22:49	1.57
@@ -31,7 +31,7 @@
 static const char *_snap_target_name(const struct lv_segment *seg,
 				     const struct lv_activate_opts *laopts)
 {
-	if (seg->status & MERGING)
+	if (!laopts->no_merging && (seg->status & MERGING))
 		return "snapshot-merge";
 
 	return _snap_name(seg);


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2011-06-17 14:14 zkabelac
  0 siblings, 0 replies; 36+ messages in thread
From: zkabelac @ 2011-06-17 14:14 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-06-17 14:14:21

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c activate.h dev_manager.c 
	                 dev_manager.h 
	lib/error      : errseg.c 
	lib/metadata   : segtype.h 
	lib/mirror     : mirrored.c 
	lib/replicator : replicator.c 
	lib/snapshot   : snapshot.c 
	lib/striped    : striped.c 
	lib/unknown    : unknown.c 
	lib/zero       : zero.c 

Log message:
	Add lv_activate_opts structure
	
	To avoid modification of 'read-only' volume group structure
	add a new structure to pass local data around the code for LV
	activation.
	
	As origin_only is one such flag - replace this parameter with new
	struct lv_activate_opts.
	
	More parameters might eventually become part of lv_activate_opts.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2016&r2=1.2017
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.198&r2=1.199
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.76&r2=1.77
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.217&r2=1.218
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.h.diff?cvsroot=lvm2&r1=1.37&r2=1.38
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/error/errseg.c.diff?cvsroot=lvm2&r1=1.23&r2=1.24
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/segtype.h.diff?cvsroot=lvm2&r1=1.34&r2=1.35
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.87&r2=1.88
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/replicator/replicator.c.diff?cvsroot=lvm2&r1=1.6&r2=1.7
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/snapshot.c.diff?cvsroot=lvm2&r1=1.55&r2=1.56
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/striped/striped.c.diff?cvsroot=lvm2&r1=1.36&r2=1.37
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/unknown/unknown.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/zero/zero.c.diff?cvsroot=lvm2&r1=1.24&r2=1.25

--- LVM2/WHATS_NEW	2011/06/15 17:48:35	1.2016
+++ LVM2/WHATS_NEW	2011/06/17 14:14:19	1.2017
@@ -1,5 +1,6 @@
 Version 2.02.86 -  
 =================================
+  Add lv_activate_opts structure for activation (replacing activation flags).
   Fix a problem with inconsistent pre-commit metadata on MISSING_PV devices.
   Add proper udev library context initialization and finalization to liblvm.
   Fix last snapshot removal to avoid table reload while a device is suspended.
--- LVM2/lib/activate/activate.c	2011/06/13 22:28:04	1.198
+++ LVM2/lib/activate/activate.c	2011/06/17 14:14:19	1.199
@@ -243,7 +243,7 @@
 	return 1;
 }
 int monitor_dev_for_events(struct cmd_context *cmd, struct logical_volume *lv,
-			   unsigned origin_only, int monitor)
+			   struct lv_activate_opts *laopts, int monitor)
 {
 	return 1;
 }
@@ -632,7 +632,7 @@
 	return info.open_count;
 }
 
-static int _lv_activate_lv(struct logical_volume *lv, unsigned origin_only)
+static int _lv_activate_lv(struct logical_volume *lv, struct lv_activate_opts *laopts)
 {
 	int r;
 	struct dev_manager *dm;
@@ -640,14 +640,15 @@
 	if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, (lv->status & PVMOVE) ? 0 : 1)))
 		return_0;
 
-	if (!(r = dev_manager_activate(dm, lv, origin_only)))
+	if (!(r = dev_manager_activate(dm, lv, laopts)))
 		stack;
 
 	dev_manager_destroy(dm);
 	return r;
 }
 
-static int _lv_preload(struct logical_volume *lv, unsigned origin_only, int *flush_required)
+static int _lv_preload(struct logical_volume *lv, struct lv_activate_opts *laopts,
+		       int *flush_required)
 {
 	int r;
 	struct dev_manager *dm;
@@ -655,7 +656,7 @@
 	if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, (lv->status & PVMOVE) ? 0 : 1)))
 		return_0;
 
-	if (!(r = dev_manager_preload(dm, lv, origin_only, flush_required)))
+	if (!(r = dev_manager_preload(dm, lv, laopts, flush_required)))
 		stack;
 
 	dev_manager_destroy(dm);
@@ -677,7 +678,8 @@
 	return r;
 }
 
-static int _lv_suspend_lv(struct logical_volume *lv, unsigned origin_only, int lockfs, int flush_required)
+static int _lv_suspend_lv(struct logical_volume *lv, struct lv_activate_opts *laopts,
+			  int lockfs, int flush_required)
 {
 	int r;
 	struct dev_manager *dm;
@@ -689,7 +691,7 @@
 	if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, (lv->status & PVMOVE) ? 0 : 1)))
 		return_0;
 
-	if (!(r = dev_manager_suspend(dm, lv, origin_only, lockfs, flush_required)))
+	if (!(r = dev_manager_suspend(dm, lv, laopts, lockfs, flush_required)))
 		stack;
 
 	dev_manager_destroy(dm);
@@ -955,7 +957,7 @@
  * Returns 1 otherwise.
  */
 int monitor_dev_for_events(struct cmd_context *cmd, struct logical_volume *lv,
-			   unsigned origin_only, int monitor)
+			   const struct lv_activate_opts *laopts, int monitor)
 {
 #ifdef DMEVENTD
 	int i, pending = 0, monitored;
@@ -965,6 +967,10 @@
 	struct lv_segment *log_seg;
 	int (*monitor_fn) (struct lv_segment *s, int e);
 	uint32_t s;
+	static const struct lv_activate_opts zlaopts = { 0 };
+
+	if (!laopts)
+		laopts = &zlaopts;
 
 	/* skip dmeventd code altogether */
 	if (dmeventd_monitor_mode() == DMEVENTD_MONITOR_IGNORE)
@@ -988,10 +994,10 @@
 	 * each of its respective snapshots.  The origin itself may
 	 * also need to be monitored if it is a mirror, for example.
 	 */
-	if (!origin_only && lv_is_origin(lv))
+	if (!laopts->origin_only && lv_is_origin(lv))
 		dm_list_iterate_safe(snh, snht, &lv->snapshot_segs)
 			if (!monitor_dev_for_events(cmd, dm_list_struct_base(snh,
-				    struct lv_segment, origin_list)->cow, 0, monitor))
+				    struct lv_segment, origin_list)->cow, NULL, monitor))
 				r = 0;
 
 	/*
@@ -1001,7 +1007,7 @@
 	if ((seg = first_seg(lv)) != NULL && seg->log_lv != NULL &&
 	    (log_seg = first_seg(seg->log_lv)) != NULL &&
 	    seg_is_mirrored(log_seg))
-		if (!monitor_dev_for_events(cmd, seg->log_lv, 0, monitor))
+		if (!monitor_dev_for_events(cmd, seg->log_lv, NULL, monitor))
 			r = 0;
 
 	dm_list_iterate(tmp, &lv->segments) {
@@ -1011,7 +1017,7 @@
 		for (s = 0; s < seg->area_count; s++) {
 			if (seg_type(seg, s) != AREA_LV)
 				continue;
-			if (!monitor_dev_for_events(cmd, seg_lv(seg, s), 0,
+			if (!monitor_dev_for_events(cmd, seg_lv(seg, s), NULL,
 						    monitor)) {
 				log_error("Failed to %smonitor %s",
 					  monitor ? "" : "un",
@@ -1092,7 +1098,7 @@
 }
 
 static int _lv_suspend(struct cmd_context *cmd, const char *lvid_s,
-		       unsigned origin_only, int error_if_not_suspended)
+		       struct lv_activate_opts *laopts, int error_if_not_suspended)
 {
 	struct logical_volume *lv = NULL, *lv_pre = NULL, *pvmove_lv = NULL;
 	struct lv_list *lvl_pre;
@@ -1112,15 +1118,15 @@
 
 	/* Ignore origin_only unless LV is origin in both old and new metadata */
 	if (!lv_is_origin(lv) || !lv_is_origin(lv_pre))
-		origin_only = 0;
+		laopts->origin_only = 0;
 
 	if (test_mode()) {
-		_skip("Suspending %s%s.", lv->name, origin_only ? " origin without snapshots" : "");
+		_skip("Suspending %s%s.", lv->name, laopts->origin_only ? " origin without snapshots" : "");
 		r = 1;
 		goto out;
 	}
 
-	if (!lv_info(cmd, lv, origin_only, &info, 0, 0))
+	if (!lv_info(cmd, lv, laopts->origin_only, &info, 0, 0))
 		goto_out;
 
 	if (!info.exists || info.suspended) {
@@ -1155,7 +1161,7 @@
 					log_error("LV %s missing from preload metadata", sl->seg->lv->name);
 					goto out;
 				}
-				if (!_lv_preload(lvl_pre->lv, origin_only, &flush_required))
+				if (!_lv_preload(lvl_pre->lv, laopts, &flush_required))
 					goto_out;
 			}
 			/* Now preload the PVMOVE LV itself */
@@ -1164,14 +1170,14 @@
 				log_error("LV %s missing from preload metadata", pvmove_lv->name);
 				goto out;
 			}
-			if (!_lv_preload(lvl_pre->lv, origin_only, &flush_required))
+			if (!_lv_preload(lvl_pre->lv, laopts, &flush_required))
 				goto_out;
-		} else if (!_lv_preload(lv_pre, origin_only, &flush_required))
+		} else if (!_lv_preload(lv_pre, laopts, &flush_required))
 			/* FIXME Revert preloading */
 			goto_out;
 	}
 
-	if (!monitor_dev_for_events(cmd, lv, origin_only, 0))
+	if (!monitor_dev_for_events(cmd, lv, laopts, 0))
 		/* FIXME Consider aborting here */
 		stack;
 
@@ -1179,7 +1185,7 @@
 	if (pvmove_lv)
 		critical_section_inc(cmd, "suspending pvmove LV");
 
-	if (!origin_only &&
+	if (!laopts->origin_only &&
 	    (lv_is_origin(lv_pre) || lv_is_cow(lv_pre)))
 		lockfs = 1;
 
@@ -1193,7 +1199,7 @@
  	 */
 	if ((lv_pre->vg->status & PRECOMMITTED) &&
 	    (lv_pre->status & LOCKED) && find_pvmove_lv_in_lv(lv_pre)) {
-		if (!_lv_suspend_lv(lv_pre, origin_only, lockfs, flush_required)) {
+		if (!_lv_suspend_lv(lv_pre, laopts, lockfs, flush_required)) {
 			critical_section_dec(cmd, "failed precommitted suspend");
 			if (pvmove_lv)
 				critical_section_dec(cmd, "failed precommitted suspend (pvmove)");
@@ -1201,7 +1207,7 @@
 		}
 	} else {
 		/* Normal suspend */
-		if (!_lv_suspend_lv(lv, origin_only, lockfs, flush_required)) {
+		if (!_lv_suspend_lv(lv, laopts, lockfs, flush_required)) {
 			critical_section_dec(cmd, "failed suspend");
 			if (pvmove_lv)
 				critical_section_dec(cmd, "failed suspend (pvmove)");
@@ -1224,7 +1230,9 @@
 /* Returns success if the device is not active */
 int lv_suspend_if_active(struct cmd_context *cmd, const char *lvid_s, unsigned origin_only)
 {
-	return _lv_suspend(cmd, lvid_s, origin_only, 0);
+	struct lv_activate_opts laopts = { .origin_only = origin_only };
+
+	return _lv_suspend(cmd, lvid_s, &laopts, 0);
 }
 
 /* No longer used */
@@ -1246,8 +1254,7 @@
   * @error_if_not_active
   */
 static int _lv_resume(struct cmd_context *cmd, const char *lvid_s,
-		      unsigned origin_only, unsigned exclusive,
-		      int error_if_not_active)
+		      struct lv_activate_opts *laopts, int error_if_not_active)
 {
 	struct logical_volume *lv;
 	struct lvinfo info;
@@ -1260,19 +1267,19 @@
 		goto_out;
 
 	if (!lv_is_origin(lv))
-		origin_only = 0;
+		laopts->origin_only = 0;
 
 	if (test_mode()) {
-		_skip("Resuming %s%s.", lv->name, origin_only ? " without snapshots" : "");
+		_skip("Resuming %s%s.", lv->name, laopts->origin_only ? " without snapshots" : "");
 		r = 1;
 		goto out;
 	}
 
 	log_debug("Resuming LV %s/%s%s%s.", lv->vg->name, lv->name,
 		  error_if_not_active ? "" : " if active",
-		  origin_only ? " without snapshots" : "");
+		  laopts->origin_only ? " without snapshots" : "");
 
-	if (!lv_info(cmd, lv, origin_only, &info, 0, 0))
+	if (!lv_info(cmd, lv, laopts->origin_only, &info, 0, 0))
 		goto_out;
 
 	if (!info.exists || !info.suspended) {
@@ -1289,15 +1296,15 @@
 	 * non-clustered target should be used.  This only happens
 	 * if ACTIVATE_EXCL is set in lv->status.
 	 */
-	if (exclusive)
+	if (laopts->exclusive)
 		lv->status |= ACTIVATE_EXCL;
 
-	if (!_lv_activate_lv(lv, origin_only))
+	if (!_lv_activate_lv(lv, laopts))
 		goto_out;
 
 	critical_section_dec(cmd, "resumed");
 
-	if (!monitor_dev_for_events(cmd, lv, origin_only, 1))
+	if (!monitor_dev_for_events(cmd, lv, laopts, 1))
 		stack;
 
 	r = 1;
@@ -1312,12 +1319,24 @@
 int lv_resume_if_active(struct cmd_context *cmd, const char *lvid_s,
 			unsigned origin_only, unsigned exclusive)
 {
-	return _lv_resume(cmd, lvid_s, origin_only, exclusive, 0);
+	struct lv_activate_opts laopts = {
+		.origin_only = origin_only,
+		/*
+		 * When targets are activated exclusively in a cluster, the
+		 * non-clustered target should be used.  This only happens
+		 * if exclusive is set.
+		 */
+		.exclusive = exclusive
+	};
+
+	return _lv_resume(cmd, lvid_s, &laopts, 0);
 }
 
 int lv_resume(struct cmd_context *cmd, const char *lvid_s, unsigned origin_only)
 {
-	return _lv_resume(cmd, lvid_s, origin_only, 0, 1);
+	struct lv_activate_opts laopts = { .origin_only = origin_only, };
+
+	return _lv_resume(cmd, lvid_s, &laopts, 1);
 }
 
 static int _lv_has_open_snapshots(struct logical_volume *lv)
@@ -1386,7 +1405,7 @@
 
 	lv_calculate_readahead(lv, NULL);
 
-	if (!monitor_dev_for_events(cmd, lv, 0, 0))
+	if (!monitor_dev_for_events(cmd, lv, NULL, 0))
 		stack;
 
 	critical_section_inc(cmd, "deactivating");
@@ -1434,7 +1453,7 @@
 }
 
 static int _lv_activate(struct cmd_context *cmd, const char *lvid_s,
-			int exclusive, int filter)
+			struct lv_activate_opts *laopts, int filter)
 {
 	struct logical_volume *lv;
 	struct lvinfo info;
@@ -1470,7 +1489,8 @@
 		goto out;
 	}
 
-	log_debug("Activating %s/%s%s.", lv->vg->name, lv->name, exclusive ? " exclusively" : "");
+	log_debug("Activating %s/%s%s.", lv->vg->name, lv->name,
+		  laopts->exclusive ? " exclusively" : "");
 
 	if (!lv_info(cmd, lv, 0, &info, 0, 0))
 		goto_out;
@@ -1485,15 +1505,12 @@
 
 	lv_calculate_readahead(lv, NULL);
 
-	if (exclusive)
-		lv->status |= ACTIVATE_EXCL;
-
 	critical_section_inc(cmd, "activating");
-	if (!(r = _lv_activate_lv(lv, 0)))
+	if (!(r = _lv_activate_lv(lv, laopts)))
 		stack;
 	critical_section_dec(cmd, "activated");
 
-	if (r && !monitor_dev_for_events(cmd, lv, 0, 1))
+	if (r && !monitor_dev_for_events(cmd, lv, laopts, 1))
 		stack;
 
 out:
@@ -1508,7 +1525,9 @@
 /* Activate LV */
 int lv_activate(struct cmd_context *cmd, const char *lvid_s, int exclusive)
 {
-	if (!_lv_activate(cmd, lvid_s, exclusive, 0))
+	struct lv_activate_opts laopts = { .exclusive = exclusive };
+
+	if (!_lv_activate(cmd, lvid_s, &laopts, 0))
 		return_0;
 
 	return 1;
@@ -1517,7 +1536,9 @@
 /* Activate LV only if it passes filter */
 int lv_activate_with_filter(struct cmd_context *cmd, const char *lvid_s, int exclusive)
 {
-	if (!_lv_activate(cmd, lvid_s, exclusive, 1))
+	struct lv_activate_opts laopts = { .exclusive = exclusive };
+
+	if (!_lv_activate(cmd, lvid_s, &laopts, 1))
 		return_0;
 
 	return 1;
--- LVM2/lib/activate/activate.h	2011/02/18 14:47:29	1.76
+++ LVM2/lib/activate/activate.h	2011/06/17 14:14:19	1.77
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
- * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
  *
@@ -30,6 +30,12 @@
 	uint32_t read_ahead;
 };
 
+struct lv_activate_opts {
+	int exclusive;
+	int origin_only;
+	int no_merging;
+};
+
 /* target attribute flags */
 #define MIRROR_LOG_CLUSTERED	0x00000001U
 
@@ -102,7 +108,7 @@
 		       const char *layer, const char *target_type);
 
 int monitor_dev_for_events(struct cmd_context *cmd, struct logical_volume *lv,
-			   unsigned origin_only, int do_reg);
+			   const struct lv_activate_opts *laopts, int do_reg);
 
 #ifdef DMEVENTD
 #  include "libdevmapper-event.h"
--- LVM2/lib/activate/dev_manager.c	2011/06/11 00:03:07	1.217
+++ LVM2/lib/activate/dev_manager.c	2011/06/17 14:14:19	1.218
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
- * Copyright (C) 2004-2010 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
  *
@@ -1045,7 +1045,7 @@
 /*
  * Add LV and any known dependencies
  */
-static int _add_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree, struct logical_volume *lv, unsigned origin_only)
+static int _add_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree, struct logical_volume *lv, int origin_only)
 {
 	struct seg_list *sl;
 
@@ -1077,7 +1077,7 @@
 	return 1;
 }
 
-static struct dm_tree *_create_partial_dtree(struct dev_manager *dm, struct logical_volume *lv, unsigned origin_only)
+static struct dm_tree *_create_partial_dtree(struct dev_manager *dm, struct logical_volume *lv, int origin_only)
 {
 	struct dm_tree *dtree;
 	struct dm_list *snh, *snht;
@@ -1254,8 +1254,9 @@
 }
 
 static int _add_snapshot_target_to_dtree(struct dev_manager *dm,
-					   struct dm_tree_node *dnode,
-					   struct logical_volume *lv)
+					 struct dm_tree_node *dnode,
+					 struct logical_volume *lv,
+					 struct lv_activate_opts *laopts)
 {
 	const char *origin_dlid;
 	const char *cow_dlid;
@@ -1288,8 +1289,9 @@
 }
 
 static int _add_target_to_dtree(struct dev_manager *dm,
-				  struct dm_tree_node *dnode,
-				  struct lv_segment *seg)
+				struct dm_tree_node *dnode,
+				struct lv_segment *seg,
+				struct lv_activate_opts *laopts)
 {
 	uint64_t extent_size = seg->lv->vg->extent_size;
 
@@ -1301,47 +1303,52 @@
 
 	return seg->segtype->ops->add_target_line(dm, dm->mem, dm->cmd,
 						  &dm->target_state, seg,
-						  dnode,
+						  laopts, dnode,
 						  extent_size * seg->len,
 						  &dm-> pvmove_mirror_count);
 }
 
 static int _add_new_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
-				  struct logical_volume *lv, const char *layer);
+				struct logical_volume *lv,
+				struct lv_activate_opts *laopts,
+				const char *layer);
 
 /* Add all replicators' LVs */
 static int _add_replicator_dev_target_to_dtree(struct dev_manager *dm,
 					       struct dm_tree *dtree,
-					       struct lv_segment *seg)
+					       struct lv_segment *seg,
+					       struct lv_activate_opts *laopts)
 {
 	struct replicator_device *rdev;
 	struct replicator_site *rsite;
 
 	/* For inactive replicator add linear mapping */
 	if (!lv_is_active_replicator_dev(seg->lv)) {
-		if (!_add_new_lv_to_dtree(dm, dtree, seg->lv->rdevice->lv, NULL))
+		if (!_add_new_lv_to_dtree(dm, dtree, seg->lv->rdevice->lv, laopts, NULL))
 			return_0;
 		return 1;
 	}
 
 	/* Add rlog and replicator nodes */
 	if (!seg->replicator ||
-            !first_seg(seg->replicator)->rlog_lv ||
+	    !first_seg(seg->replicator)->rlog_lv ||
 	    !_add_new_lv_to_dtree(dm, dtree,
-				  first_seg(seg->replicator)->rlog_lv, NULL) ||
-	    !_add_new_lv_to_dtree(dm, dtree, seg->replicator, NULL))
+				  first_seg(seg->replicator)->rlog_lv,
+				  laopts, NULL) ||
+	    !_add_new_lv_to_dtree(dm, dtree, seg->replicator, laopts, NULL))
 	    return_0;
 
 	/* Activation of one replicator_dev node activates all other nodes */
 	dm_list_iterate_items(rsite, &seg->replicator->rsites) {
 		dm_list_iterate_items(rdev, &rsite->rdevices) {
 			if (rdev->lv &&
-			    !_add_new_lv_to_dtree(dm, dtree, rdev->lv, NULL))
+			    !_add_new_lv_to_dtree(dm, dtree, rdev->lv,
+						  laopts, NULL))
 				return_0;
 
 			if (rdev->slog &&
-			    !_add_new_lv_to_dtree(dm, dtree,
-						  rdev->slog, NULL))
+			    !_add_new_lv_to_dtree(dm, dtree, rdev->slog,
+						  laopts, NULL))
 				return_0;
 		}
 	}
@@ -1356,7 +1363,7 @@
 			if (!rdev->replicator_dev->lv ||
 			    !_add_new_lv_to_dtree(dm, dtree,
 						  rdev->replicator_dev->lv,
-						  NULL))
+						  laopts, NULL))
 				return_0;
 		}
 	}
@@ -1365,10 +1372,11 @@
 }
 
 static int _add_segment_to_dtree(struct dev_manager *dm,
-				   struct dm_tree *dtree,
-				   struct dm_tree_node *dnode,
-				   struct lv_segment *seg,
-				   const char *layer)
+				 struct dm_tree *dtree,
+				 struct dm_tree_node *dnode,
+				 struct lv_segment *seg,
+				 struct lv_activate_opts *laopts,
+				 const char *layer)
 {
 	uint32_t s;
 	struct dm_list *snh;
@@ -1378,7 +1386,7 @@
 	/* Ensure required device-mapper targets are loaded */
 	seg_present = find_cow(seg->lv) ? : seg;
 	target_name = (seg_present->segtype->ops->target_name ?
-		       seg_present->segtype->ops->target_name(seg_present) :
+		       seg_present->segtype->ops->target_name(seg_present, laopts) :
 		       seg_present->segtype->name);
 
 	log_debug("Checking kernel supports %s segment type for %s%s%s",
@@ -1395,35 +1403,35 @@
 
 	/* Add mirror log */
 	if (seg->log_lv &&
-	    !_add_new_lv_to_dtree(dm, dtree, seg->log_lv, NULL))
+	    !_add_new_lv_to_dtree(dm, dtree, seg->log_lv, laopts, NULL))
 		return_0;
 
 	if (seg_is_replicator_dev(seg)) {
-		if (!_add_replicator_dev_target_to_dtree(dm, dtree, seg))
+		if (!_add_replicator_dev_target_to_dtree(dm, dtree, seg, laopts))
 			return_0;
 	/* If this is a snapshot origin, add real LV */
 	/* If this is a snapshot origin + merging snapshot, add cow + real LV */
 	} else if (lv_is_origin(seg->lv) && !layer) {
 		if (lv_is_merging_origin(seg->lv)) {
 			if (!_add_new_lv_to_dtree(dm, dtree,
-			     find_merging_cow(seg->lv)->cow, "cow"))
+			     find_merging_cow(seg->lv)->cow, laopts, "cow"))
 				return_0;
 			/*
 			 * Must also add "real" LV for use when
 			 * snapshot-merge target is added
 			 */
 		}
-		if (!_add_new_lv_to_dtree(dm, dtree, seg->lv, "real"))
+		if (!_add_new_lv_to_dtree(dm, dtree, seg->lv, laopts, "real"))
 			return_0;
 	} else if (lv_is_cow(seg->lv) && !layer) {
-		if (!_add_new_lv_to_dtree(dm, dtree, seg->lv, "cow"))
+		if (!_add_new_lv_to_dtree(dm, dtree, seg->lv, laopts, "cow"))
 			return_0;
 	} else {
 		/* Add any LVs used by this segment */
 		for (s = 0; s < seg->area_count; s++)
 			if ((seg_type(seg, s) == AREA_LV) &&
 			    (!_add_new_lv_to_dtree(dm, dtree, seg_lv(seg, s),
-						   NULL)))
+						   laopts, NULL)))
 				return_0;
 	}
 
@@ -1437,22 +1445,24 @@
 				return_0;
 		}
 	} else if (lv_is_cow(seg->lv) && !layer) {
-		if (!_add_snapshot_target_to_dtree(dm, dnode, seg->lv))
+		if (!_add_snapshot_target_to_dtree(dm, dnode, seg->lv, laopts))
 			return_0;
-	} else if (!_add_target_to_dtree(dm, dnode, seg))
+	} else if (!_add_target_to_dtree(dm, dnode, seg, laopts))
 		return_0;
 
 	if (lv_is_origin(seg->lv) && !layer)
 		/* Add any snapshots of this LV */
 		dm_list_iterate(snh, &seg->lv->snapshot_segs)
-			if (!_add_new_lv_to_dtree(dm, dtree, dm_list_struct_base(snh, struct lv_segment, origin_list)->cow, NULL))
+			if (!_add_new_lv_to_dtree(dm, dtree, dm_list_struct_base(snh, struct lv_segment, origin_list)->cow,
+						  laopts, NULL))
 				return_0;
 
 	return 1;
 }
 
 static int _add_new_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
-				struct logical_volume *lv, const char *layer)
+				struct logical_volume *lv, struct lv_activate_opts *laopts,
+				const char *layer)
 {
 	struct lv_segment *seg;
 	struct lv_layer *lvlayer;
@@ -1527,7 +1537,7 @@
 	/* Create table */
 	dm->pvmove_mirror_count = 0u;
 	dm_list_iterate_items(seg, &lv->segments) {
-		if (!_add_segment_to_dtree(dm, dtree, dnode, seg, layer))
+		if (!_add_segment_to_dtree(dm, dtree, dnode, seg, laopts, layer))
 			return_0;
 		/* These aren't real segments in the LVM2 metadata */
 		if (lv_is_origin(lv) && !layer)
@@ -1551,7 +1561,7 @@
 	/* Add any LVs referencing a PVMOVE LV unless told not to */
 	if (dm->track_pvmove_deps && (lv->status & PVMOVE))
 		dm_list_iterate_items(sl, &lv->segs_using_this_lv)
-			if (!_add_new_lv_to_dtree(dm, dtree, sl->seg->lv, NULL))
+			if (!_add_new_lv_to_dtree(dm, dtree, sl->seg->lv, laopts, NULL))
 				return_0;
 
 	return 1;
@@ -1671,14 +1681,14 @@
 }
 
 static int _tree_action(struct dev_manager *dm, struct logical_volume *lv,
-			unsigned origin_only, action_t action)
+			struct lv_activate_opts *laopts, action_t action)
 {
 	struct dm_tree *dtree;
 	struct dm_tree_node *root;
 	char *dlid;
 	int r = 0;
 
-	if (!(dtree = _create_partial_dtree(dm, lv, origin_only)))
+	if (!(dtree = _create_partial_dtree(dm, lv, laopts->origin_only)))
 		return_0;
 
 	if (!(root = dm_tree_find_node(dtree, 0, 0))) {
@@ -1689,14 +1699,14 @@
 	/* Restore fs cookie */
 	dm_tree_set_cookie(root, fs_get_cookie());
 
-	if (!(dlid = build_dm_uuid(dm->mem, lv->lvid.s, origin_only ? "real" : NULL)))
+	if (!(dlid = build_dm_uuid(dm->mem, lv->lvid.s, laopts->origin_only ? "real" : NULL)))
 		goto_out;
 
 	/* Only process nodes with uuid of "LVM-" plus VG id. */
 	switch(action) {
 	case CLEAN:
 		/* Deactivate any unused non-toplevel nodes */
-		if (!_clean_tree(dm, root, origin_only ? dlid : NULL))
+		if (!_clean_tree(dm, root, laopts->origin_only ? dlid : NULL))
 			goto_out;
 		break;
 	case DEACTIVATE:
@@ -1719,7 +1729,7 @@
 	case PRELOAD:
 	case ACTIVATE:
 		/* Add all required new devices to tree */
-		if (!_add_new_lv_to_dtree(dm, dtree, lv, origin_only ? "real" : NULL))
+		if (!_add_new_lv_to_dtree(dm, dtree, lv, laopts, laopts->origin_only ? "real" : NULL))
 			goto_out;
 
 		/* Preload any devices required before any suspensions */
@@ -1758,19 +1768,24 @@
 }
 
 /* origin_only may only be set if we are resuming (not activating) an origin LV */
-int dev_manager_activate(struct dev_manager *dm, struct logical_volume *lv, unsigned origin_only)
+int dev_manager_activate(struct dev_manager *dm, struct logical_volume *lv,
+			 struct lv_activate_opts *laopts)
 {
-	if (!_tree_action(dm, lv, origin_only, ACTIVATE))
+	if (!_tree_action(dm, lv, laopts, ACTIVATE))
 		return_0;
 
-	return _tree_action(dm, lv, origin_only, CLEAN);
+	return _tree_action(dm, lv, laopts, CLEAN);
 }
 
 /* origin_only may only be set if we are resuming (not activating) an origin LV */
 int dev_manager_preload(struct dev_manager *dm, struct logical_volume *lv,
-			unsigned origin_only, int *flush_required)
+			struct lv_activate_opts *laopts, int *flush_required)
 {
-	if (!_tree_action(dm, lv, origin_only, PRELOAD))
+	/* FIXME Update the pvmove implementation! */
+	if ((lv->status & PVMOVE) || (lv->status & LOCKED))
+		return 1;
+
+	if (!_tree_action(dm, lv, laopts, PRELOAD))
 		return 0;
 
 	*flush_required = dm->flush_required;
@@ -1780,19 +1795,20 @@
 
 int dev_manager_deactivate(struct dev_manager *dm, struct logical_volume *lv)
 {
+	struct lv_activate_opts laopts = { 0 };
 	int r;
 
-	r = _tree_action(dm, lv, 0, DEACTIVATE);
+	r = _tree_action(dm, lv, &laopts, DEACTIVATE);
 
 	return r;
 }
 
 int dev_manager_suspend(struct dev_manager *dm, struct logical_volume *lv,
-			unsigned origin_only, int lockfs, int flush_required)
+			struct lv_activate_opts *laopts, int lockfs, int flush_required)
 {
 	dm->flush_required = flush_required;
 
-	return _tree_action(dm, lv, origin_only, lockfs ? SUSPEND_WITH_LOCKFS : SUSPEND);
+	return _tree_action(dm, lv, laopts, lockfs ? SUSPEND_WITH_LOCKFS : SUSPEND);
 }
 
 /*
--- LVM2/lib/activate/dev_manager.h	2011/06/11 00:03:07	1.37
+++ LVM2/lib/activate/dev_manager.h	2011/06/17 14:14:19	1.38
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.  
- * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
  *
@@ -19,6 +19,7 @@
 #include "metadata-exported.h"
 
 struct logical_volume;
+struct lv_activate_opts;
 struct volume_group;
 struct cmd_context;
 struct dev_manager;
@@ -52,10 +53,11 @@
 			       const struct logical_volume *lv, int wait,
 			       percent_t *percent, uint32_t *event_nr);
 int dev_manager_suspend(struct dev_manager *dm, struct logical_volume *lv,
-			unsigned origin_only, int lockfs, int flush_required);
-int dev_manager_activate(struct dev_manager *dm, struct logical_volume *lv, unsigned origin_only);
+			struct lv_activate_opts *laopts, int lockfs, int flush_required);
+int dev_manager_activate(struct dev_manager *dm, struct logical_volume *lv,
+			 struct lv_activate_opts *laopts);
 int dev_manager_preload(struct dev_manager *dm, struct logical_volume *lv,
-			unsigned origin_only, int *flush_required);
+			struct lv_activate_opts *laopts, int *flush_required);
 int dev_manager_deactivate(struct dev_manager *dm, struct logical_volume *lv);
 int dev_manager_transient(struct dev_manager *dm, struct logical_volume *lv) __attribute__((nonnull(1, 2)));
 
--- LVM2/lib/error/errseg.c	2011/03/25 21:59:42	1.23
+++ LVM2/lib/error/errseg.c	2011/06/17 14:14:19	1.24
@@ -45,6 +45,7 @@
 				struct cmd_context *cmd __attribute__((unused)),
 				void **target_state __attribute__((unused)),
 				struct lv_segment *seg __attribute__((unused)),
+				const struct lv_activate_opts *laopts __attribute__((unused)),
 				struct dm_tree_node *node, uint64_t len,
 				uint32_t *pvmove_mirror_count __attribute__((unused)))
 {
--- LVM2/lib/metadata/segtype.h	2010/12/20 13:32:49	1.34
+++ LVM2/lib/metadata/segtype.h	2011/06/17 14:14:20	1.35
@@ -22,6 +22,7 @@
 struct cmd_context;
 struct config_tree;
 struct lv_segment;
+struct lv_activate_opts;
 struct formatter;
 struct config_node;
 struct dev_manager;
@@ -66,7 +67,8 @@
 
 struct segtype_handler {
 	const char *(*name) (const struct lv_segment * seg);
-	const char *(*target_name) (const struct lv_segment * seg);
+	const char *(*target_name) (const struct lv_segment *seg,
+				    const struct lv_activate_opts *laopts);
 	void (*display) (const struct lv_segment * seg);
 	int (*text_export) (const struct lv_segment * seg,
 			    struct formatter * f);
@@ -78,10 +80,11 @@
 	int (*merge_segments) (struct lv_segment * seg1,
 			       struct lv_segment * seg2);
 	int (*add_target_line) (struct dev_manager *dm, struct dm_pool *mem,
-                                struct cmd_context *cmd, void **target_state,
-                                struct lv_segment *seg,
-                                struct dm_tree_node *node, uint64_t len,
-                                uint32_t *pvmove_mirror_count);
+				struct cmd_context *cmd, void **target_state,
+				struct lv_segment *seg,
+				const struct lv_activate_opts *laopts,
+				struct dm_tree_node *node, uint64_t len,
+				uint32_t *pvmove_mirror_count);
 	int (*target_status_compatible) (const char *type);
 	int (*check_transient_status) (struct lv_segment *seg, char *params);
 	int (*target_percent) (void **target_state,
--- LVM2/lib/mirror/mirrored.c	2011/05/07 13:32:06	1.87
+++ LVM2/lib/mirror/mirrored.c	2011/06/17 14:14:20	1.88
@@ -349,6 +349,7 @@
 }
 
 static int _add_log(struct dm_pool *mem, struct lv_segment *seg,
+		    const struct lv_activate_opts *laopts,
 		    struct dm_tree_node *node, uint32_t area_count, uint32_t region_size)
 {
 	unsigned clustered = 0;
@@ -390,10 +391,11 @@
 }
 
 static int _mirrored_add_target_line(struct dev_manager *dm, struct dm_pool *mem,
-				struct cmd_context *cmd, void **target_state,
-				struct lv_segment *seg,
-				struct dm_tree_node *node, uint64_t len,
-				uint32_t *pvmove_mirror_count)
+				     struct cmd_context *cmd, void **target_state,
+				     struct lv_segment *seg,
+				     const struct lv_activate_opts *laopts,
+				     struct dm_tree_node *node, uint64_t len,
+				     uint32_t *pvmove_mirror_count)
 {
 	struct mirror_state *mirr_state;
 	uint32_t area_count = seg->area_count;
@@ -451,7 +453,7 @@
 	if (!dm_tree_node_add_mirror_target(node, len))
 		return_0;
 
-	if ((r = _add_log(mem, seg, node, area_count, region_size)) <= 0) {
+	if ((r = _add_log(mem, seg, laopts, node, area_count, region_size)) <= 0) {
 		stack;
 		return r;
 	}
--- LVM2/lib/replicator/replicator.c	2011/03/25 21:59:42	1.6
+++ LVM2/lib/replicator/replicator.c	2011/06/17 14:14:20	1.7
@@ -327,6 +327,7 @@
 				       struct cmd_context *cmd,
 				       void **target_state,
 				       struct lv_segment *seg,
+				       const struct lv_activate_opts *laopts,
 				       struct dm_tree_node *node,
 				       uint64_t len,
 				       uint32_t *pvmove_mirror_count)
@@ -609,6 +610,7 @@
 					   struct cmd_context *cmd,
 					   void **target_state,
 					   struct lv_segment *seg,
+					   const struct lv_activate_opts *laopts,
 					   struct dm_tree_node *node,
 					   uint64_t len,
 					   uint32_t *pvmove_mirror_count)
--- LVM2/lib/snapshot/snapshot.c	2011/04/29 00:21:15	1.55
+++ LVM2/lib/snapshot/snapshot.c	2011/06/17 14:14:20	1.56
@@ -28,7 +28,8 @@
 	return seg->segtype->name;
 }
 
-static const char *_snap_target_name(const struct lv_segment *seg)
+static const char *_snap_target_name(const struct lv_segment *seg,
+				     const struct lv_activate_opts *laopts)
 {
 	if (seg->status & MERGING)
 		return "snapshot-merge";
--- LVM2/lib/striped/striped.c	2011/03/25 21:59:43	1.36
+++ LVM2/lib/striped/striped.c	2011/06/17 14:14:20	1.37
@@ -164,6 +164,7 @@
 				struct cmd_context *cmd __attribute__((unused)),
 				void **target_state __attribute__((unused)),
 				struct lv_segment *seg,
+				const struct lv_activate_opts *laopts __attribute__((unused)),
 				struct dm_tree_node *node, uint64_t len,
 				uint32_t *pvmove_mirror_count __attribute__((unused)))
 {
--- LVM2/lib/unknown/unknown.c	2011/03/25 21:59:43	1.5
+++ LVM2/lib/unknown/unknown.c	2011/06/17 14:14:21	1.6
@@ -67,6 +67,7 @@
 				struct cmd_context *cmd __attribute__((unused)),
 				void **target_state __attribute__((unused)),
 				struct lv_segment *seg __attribute__((unused)),
+				const struct lv_activate_opts *laopts __attribute__((unused)),
 				struct dm_tree_node *node, uint64_t len,
 				uint32_t *pvmove_mirror_count __attribute__((unused)))
 {
--- LVM2/lib/zero/zero.c	2011/03/25 21:59:43	1.24
+++ LVM2/lib/zero/zero.c	2011/06/17 14:14:21	1.25
@@ -44,6 +44,7 @@
 				 struct cmd_context *cmd __attribute__((unused)),
 				 void **target_state __attribute__((unused)),
 				 struct lv_segment *seg __attribute__((unused)),
+				 const struct lv_activate_opts *laopts __attribute__((unused)),
 				 struct dm_tree_node *node,uint64_t len,
 				 uint32_t *pvmove_mirror_count __attribute__((unused)))
 {


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2011-02-04 19:14 zkabelac
  0 siblings, 0 replies; 36+ messages in thread
From: zkabelac @ 2011-02-04 19:14 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-02-04 19:14:41

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c fs.c 
	libdm          : libdm-common.c 

Log message:
	Fix operation node stacking for consecutive dm ops
	
	With the ability to stack many operations in one udev transaction -
	in same cases we are adding and removing same device at the same time
	(i.e. deactivate followed by activate).
	
	This leads to a problem of checking stacked operations:
	i.e. remove /dev/node1 followed by create /dev/node1
	
	If the node creation is handled with udev - there is a problem as
	stacked operation gives warning about existing node1 and will try to
	remove it - while next operation needs to recreate it.
	
	Current code removes all previous stacked operation if the fs op is
	FS_DEL - patch adds similar behavior for FS_ADD - it will try to
	remove any 'delete' operation if udev is in use.
	
	For FS_RENAME operation it seems to be more complex. But as we
	are always stacking FS_READ_AHEAD after FS_ADD operation -
	should be safe to remove all previous operation on the node
	when udev is running.
	
	Code does same checking for stacking libdm and liblvm operations.
	
	As a very simple optimization counters were added for each stacked ops
	type to avoid unneeded list scans if some operation does not exists in
	the list.
	
	Enable skipping of fs_unlock() (udev sync) if only DEL operations are staked.
	as we do not use lv_info for already deleted nodes.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1902&r2=1.1903
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.189&r2=1.190
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/fs.c.diff?cvsroot=lvm2&r1=1.58&r2=1.59
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-common.c.diff?cvsroot=lvm2&r1=1.108&r2=1.109

--- LVM2/WHATS_NEW	2011/02/03 16:03:13	1.1902
+++ LVM2/WHATS_NEW	2011/02/04 19:14:39	1.1903
@@ -1,5 +1,6 @@
 Version 2.02.83 - 
 ===================================
+  Fix operation node stacking for consecutive dm ops.
   Increase hash table size to 1024 lv names and 64 pv uuids.
   Remove fs_unlock() from lv_resume path.
   Fix wipe size when setting up mda.
--- LVM2/lib/activate/activate.c	2011/02/03 01:58:21	1.189
+++ LVM2/lib/activate/activate.c	2011/02/04 19:14:40	1.190
@@ -469,7 +469,7 @@
 	if (with_open_count) {
 		if (locking_is_clustered())
 			sync_local_dev_names(cmd); /* Wait to have udev in sync */
-		else //if (fs_has_non_delete_ops())
+		else if (fs_has_non_delete_ops())
 			fs_unlock(); /* For non clustered - wait if there are non-delete ops */
 	}
 
--- LVM2/lib/activate/fs.c	2011/02/03 01:24:46	1.58
+++ LVM2/lib/activate/fs.c	2011/02/04 19:14:40	1.59
@@ -257,7 +257,8 @@
 typedef enum {
 	FS_ADD,
 	FS_DEL,
-	FS_RENAME
+	FS_RENAME,
+	NUM_FS_OPS
 } fs_op_t;
 
 static int _do_fs_op(fs_op_t type, const char *dev_dir, const char *vg_name,
@@ -283,12 +284,18 @@
 
 		if (!_mk_link(dev_dir, vg_name, lv_name, dev, check_udev))
 			stack;
+	default:;
 	}
 
 	return 1;
 }
 
 static DM_LIST_INIT(_fs_ops);
+/*
+ * Count number of stacked fs_op_t operations to allow to skip dm_list search.
+ * FIXME: handling of FS_RENAME
+ */
+static int _count_fs_ops[NUM_FS_OPS];
 
 struct fs_op_parms {
 	struct dm_list list;
@@ -309,15 +316,84 @@
 	*pos += strlen(*ptr) + 1;
 }
 
+static void _del_fs_op(struct fs_op_parms *fsp)
+{
+	_count_fs_ops[fsp->type]--;
+	dm_list_del(&fsp->list);
+	dm_free(fsp);
+}
+
+/* Check if there is other the type of fs operation stacked */
+static int _other_fs_ops(fs_op_t type)
+{
+	int i;
+
+	for (i = 0; i < NUM_FS_OPS; i++)
+		if (type != i && _count_fs_ops[i])
+			return 1;
+	return 0;
+}
+
+/* Check if udev is supposed to create nodes */
+static int _check_udev(int check_udev)
+{
+    return check_udev && dm_udev_get_sync_support() && dm_udev_get_checking();
+}
+
+/* FIXME: duplication of the  code from libdm-common.c */
 static int _stack_fs_op(fs_op_t type, const char *dev_dir, const char *vg_name,
 			const char *lv_name, const char *dev,
 			const char *old_lv_name, int check_udev)
 {
+	struct dm_list *fsph, *fspht;
 	struct fs_op_parms *fsp;
 	size_t len = strlen(dev_dir) + strlen(vg_name) + strlen(lv_name) +
 	    strlen(dev) + strlen(old_lv_name) + 5;
 	char *pos;
 
+	if ((type == FS_DEL) && _other_fs_ops(type))
+		/*
+		 * Ignore any outstanding operations on the fs_op if deleting it.
+		 */
+		dm_list_iterate_safe(fsph, fspht, &_fs_ops) {
+			fsp = dm_list_item(fsph, struct fs_op_parms);
+			if (!strcmp(lv_name, fsp->lv_name) &&
+			    !strcmp(vg_name, fsp->vg_name)) {
+				_del_fs_op(fsp);
+				if (!_other_fs_ops(type))
+					break; /* no other non DEL ops */
+			}
+		}
+	else if ((type == FS_ADD) && _count_fs_ops[FS_DEL] && _check_udev(check_udev))
+		/*
+		 * If udev is running ignore previous DEL operation on added fs_op.
+		 * (No other operations for this device then DEL could be staked here).
+		 */
+		dm_list_iterate_safe(fsph, fspht, &_fs_ops) {
+			fsp = dm_list_item(fsph, struct fs_op_parms);
+			if ((fsp->type == FS_DEL) &&
+			    !strcmp(lv_name, fsp->lv_name) &&
+			    !strcmp(vg_name, fsp->vg_name)) {
+				_del_fs_op(fsp);
+				break; /* no other DEL ops */
+			}
+		}
+	else if ((type == FS_RENAME) && _check_udev(check_udev))
+		/*
+		 * If udev is running ignore any outstanding operations if renaming it.
+		 *
+		 * Currently RENAME operation happens through 'suspend -> resume'.
+		 * On 'resume' device is added with read_ahead settings, so it
+		 * safe to remove any stacked ADD, RENAME, READ_AHEAD operation
+		 * There cannot be any DEL operation on the renamed device.
+		 */
+		dm_list_iterate_safe(fsph, fspht, &_fs_ops) {
+			fsp = dm_list_item(fsph, struct fs_op_parms);
+			if (!strcmp(old_lv_name, fsp->lv_name) &&
+			    !strcmp(vg_name, fsp->vg_name))
+				_del_fs_op(fsp);
+		}
+
 	if (!(fsp = dm_malloc(sizeof(*fsp) + len))) {
 		log_error("No space to stack fs operation");
 		return 0;
@@ -333,6 +409,7 @@
 	_store_str(&pos, &fsp->dev, dev);
 	_store_str(&pos, &fsp->old_lv_name, old_lv_name);
 
+	_count_fs_ops[type]++;
 	dm_list_add(&_fs_ops, &fsp->list);
 
 	return 1;
@@ -347,8 +424,7 @@
 		fsp = dm_list_item(fsph, struct fs_op_parms);
 		_do_fs_op(fsp->type, fsp->dev_dir, fsp->vg_name, fsp->lv_name,
 			  fsp->dev, fsp->old_lv_name, fsp->check_udev);
-		dm_list_del(&fsp->list);
-		dm_free(fsp);
+		_del_fs_op(fsp);
 	}
 }
 
@@ -423,9 +499,7 @@
 	_fs_cookie = cookie;
 }
 
-#if 0
 int fs_has_non_delete_ops(void)
 {
 	return _other_fs_ops(FS_DEL);
 }
-#endif
--- LVM2/libdm/libdm-common.c	2011/02/04 16:08:12	1.108
+++ LVM2/libdm/libdm-common.c	2011/02/04 19:14:40	1.109
@@ -725,7 +725,8 @@
 	NODE_ADD,
 	NODE_DEL,
 	NODE_RENAME,
-	NODE_READ_AHEAD
+	NODE_READ_AHEAD,
+	NUM_NODES
 } node_op_t;
 
 static int _do_node_op(node_op_t type, const char *dev_name, uint32_t major,
@@ -744,12 +745,14 @@
 	case NODE_READ_AHEAD:
 		return _set_dev_node_read_ahead(dev_name, read_ahead,
 						read_ahead_flags);
+	default:;
 	}
 
 	return 1;
 }
 
 static DM_LIST_INIT(_node_ops);
+static int _count_node_ops[NUM_NODES];
 
 struct node_op_parms {
 	struct dm_list list;
@@ -774,6 +777,31 @@
 	*pos += strlen(*ptr) + 1;
 }
 
+static void _del_node_op(struct node_op_parms *nop)
+{
+	_count_node_ops[nop->type]--;
+	dm_list_del(&nop->list);
+	dm_free(nop);
+
+}
+
+/* Check if there is other the type of node operation stacked */
+static int _other_node_ops(node_op_t type)
+{
+	int i;
+
+	for (i = 0; i < NUM_NODES; i++)
+		if (type != i && _count_node_ops[i])
+			return 1;
+	return 0;
+}
+
+/* Check if udev is supposed to create nodes */
+static int _check_udev(int check_udev)
+{
+    return check_udev && dm_udev_get_sync_support() && dm_udev_get_checking();
+}
+
 static int _stack_node_op(node_op_t type, const char *dev_name, uint32_t major,
 			  uint32_t minor, uid_t uid, gid_t gid, mode_t mode,
 			  const char *old_name, uint32_t read_ahead,
@@ -785,17 +813,47 @@
 	char *pos;
 
 	/*
-	 * Ignore any outstanding operations on the node if deleting it
+	 * Note: check_udev must have valid content
 	 */
-	if (type == NODE_DEL) {
+	if ((type == NODE_DEL) && _other_node_ops(type))
+		/*
+		 * Ignore any outstanding operations on the node if deleting it.
+		 */
 		dm_list_iterate_safe(noph, nopht, &_node_ops) {
 			nop = dm_list_item(noph, struct node_op_parms);
 			if (!strcmp(dev_name, nop->dev_name)) {
-				dm_list_del(&nop->list);
-				dm_free(nop);
+				_del_node_op(nop);
+				if (!_other_node_ops(type))
+					break; /* no other non DEL ops */
 			}
 		}
-	}
+	else if ((type == NODE_ADD) && _count_node_ops[NODE_DEL] && _check_udev(check_udev))
+		/*
+		 * If udev is running ignore previous DEL operation on added node.
+		 * (No other operations for this device then DEL could be staked here).
+		 */
+		dm_list_iterate_safe(noph, nopht, &_node_ops) {
+			nop = dm_list_item(noph, struct node_op_parms);
+			if ((nop->type == NODE_DEL) &&
+			    !strcmp(dev_name, nop->dev_name)) {
+				_del_node_op(nop);
+				break; /* no other DEL ops */
+			}
+		}
+	else if ((type == NODE_RENAME) && _check_udev(check_udev))
+		/*
+		 * If udev is running ignore any outstanding operations if renaming it.
+		 *
+		 * Currently  RENAME operation happens through 'suspend -> resume'.
+		 * On 'resume' device is added with read_ahead settings, so it is
+		 * safe to remove any stacked ADD, RENAME, READ_AHEAD operation
+		 * There cannot be any DEL operation on the renamed device.
+		 */
+		dm_list_iterate_safe(noph, nopht, &_node_ops) {
+			nop = dm_list_item(noph, struct node_op_parms);
+			if (!strcmp(old_name, nop->dev_name))
+				_del_node_op(nop);
+		}
 
 	if (!(nop = dm_malloc(sizeof(*nop) + len))) {
 		log_error("Insufficient memory to stack mknod operation");
@@ -816,6 +874,7 @@
 	_store_str(&pos, &nop->dev_name, dev_name);
 	_store_str(&pos, &nop->old_name, old_name);
 
+	_count_node_ops[type]++;
 	dm_list_add(&_node_ops, &nop->list);
 
 	return 1;
@@ -832,8 +891,7 @@
 			    nop->uid, nop->gid, nop->mode, nop->old_name,
 			    nop->read_ahead, nop->read_ahead_flags,
 			    nop->check_udev);
-		dm_list_del(&nop->list);
-		dm_free(nop);
+		_del_node_op(nop);
 	}
 }
 


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2011-02-03  1:24 zkabelac
  0 siblings, 0 replies; 36+ messages in thread
From: zkabelac @ 2011-02-03  1:24 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-02-03 01:24:47

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c fs.c 
	liblvm         : lvm_lv.c 
	tools          : lvconvert.c lvscan.c 

Log message:
	Do not check for open_count when not needed.
	
	Disable open_count checking in lv_info it it's not used.
	
	Fix previous commit (comment out unsable code for now).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1898&r2=1.1899
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.187&r2=1.188
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/fs.c.diff?cvsroot=lvm2&r1=1.57&r2=1.58
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/liblvm/lvm_lv.c.diff?cvsroot=lvm2&r1=1.34&r2=1.35
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.156&r2=1.157
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvscan.c.diff?cvsroot=lvm2&r1=1.44&r2=1.45

--- LVM2/WHATS_NEW	2011/02/02 23:39:39	1.1898
+++ LVM2/WHATS_NEW	2011/02/03 01:24:46	1.1899
@@ -1,5 +1,7 @@
 Version 2.02.83 - 
 ===================================
+  Remove unneeded checks for open_count in lv_info().
+  Synchronize with udev before checking open_count in lv_info().
   Allow CLVMD_CMD_SYNC_NAMES to be propagated around the cluster if requested.
   Add "dmsetup ls --tree" output to lvmdump.
   Fix udev synchronization with no-locking --sysinit (2.02.80).
--- LVM2/lib/activate/activate.c	2011/02/03 01:16:35	1.187
+++ LVM2/lib/activate/activate.c	2011/02/03 01:24:46	1.188
@@ -469,7 +469,7 @@
 	if (with_open_count) {
 		if (locking_is_clustered())
 			sync_local_dev_names(cmd); /* Wait to have udev in sync */
-		else if (fs_has_non_delete_ops())
+		else //if (fs_has_non_delete_ops())
 			fs_unlock(); /* For non clustered - wait if there are non-delete ops */
 	}
 
@@ -1219,7 +1219,7 @@
 	r = _lv_deactivate(lv);
 	memlock_dec(cmd);
 
-	if (!lv_info(cmd, lv, 0, &info, 1, 0) || info.exists)
+	if (!lv_info(cmd, lv, 0, &info, 0, 0) || info.exists)
 		r = 0;
 out:
 	if (lv) {
--- LVM2/lib/activate/fs.c	2011/02/03 01:16:35	1.57
+++ LVM2/lib/activate/fs.c	2011/02/03 01:24:46	1.58
@@ -423,7 +423,9 @@
 	_fs_cookie = cookie;
 }
 
+#if 0
 int fs_has_non_delete_ops(void)
 {
 	return _other_fs_ops(FS_DEL);
 }
+#endif
--- LVM2/liblvm/lvm_lv.c	2010/12/14 23:20:58	1.34
+++ LVM2/liblvm/lvm_lv.c	2011/02/03 01:24:46	1.35
@@ -62,7 +62,7 @@
 uint64_t lvm_lv_is_active(const lv_t lv)
 {
 	struct lvinfo info;
-	if (lv_info(lv->vg->cmd, lv, 0, &info, 1, 0) &&
+	if (lv_info(lv->vg->cmd, lv, 0, &info, 0, 0) &&
 	    info.exists && info.live_table)
 		return 1;
 	return 0;
@@ -71,7 +71,7 @@
 uint64_t lvm_lv_is_suspended(const lv_t lv)
 {
 	struct lvinfo info;
-	if (lv_info(lv->vg->cmd, lv, 0, &info, 1, 0) &&
+	if (lv_info(lv->vg->cmd, lv, 0, &info, 0, 0) &&
 	    info.exists && info.suspended)
 		return 1;
 	return 0;
--- LVM2/tools/lvconvert.c	2011/01/19 19:24:07	1.156
+++ LVM2/tools/lvconvert.c	2011/02/03 01:24:47	1.157
@@ -1637,7 +1637,7 @@
 {
 	struct lvinfo info;
 
-	if (!lv_info(cmd, lv, 0, &info, 1, 0) || !info.exists) {
+	if (!lv_info(cmd, lv, 0, &info, 0, 0) || !info.exists) {
 		log_print("Conversion starts after activation.");
 		return ECMD_PROCESSED;
 	}
--- LVM2/tools/lvscan.c	2010/12/22 12:06:54	1.44
+++ LVM2/tools/lvscan.c	2011/02/03 01:24:47	1.45
@@ -28,7 +28,7 @@
 	if (!arg_count(cmd, all_ARG) && !lv_is_visible(lv))
 		return ECMD_PROCESSED;
 
-	inkernel = lv_info(cmd, lv, 0, &info, 1, 0) && info.exists;
+	inkernel = lv_info(cmd, lv, 0, &info, 0, 0) && info.exists;
 	if (lv_is_origin(lv)) {
 		dm_list_iterate_items_gen(snap_seg, &lv->snapshot_segs,
 				       origin_list) {


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2010-08-17  1:16 agk
  0 siblings, 0 replies; 36+ messages in thread
From: agk @ 2010-08-17  1:16 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2010-08-17 01:16:41

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c activate.h 
	lib/mirror     : mirrored.c 
	lib/snapshot   : snapshot.c 
	tools          : vgchange.c 

Log message:
	Monitor origin -real device below snapshot instead of overlay device. (brassow)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1705&r2=1.1706
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.175&r2=1.176
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.69&r2=1.70
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.76&r2=1.77
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/snapshot.c.diff?cvsroot=lvm2&r1=1.48&r2=1.49
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgchange.c.diff?cvsroot=lvm2&r1=1.111&r2=1.112

--- LVM2/WHATS_NEW	2010/08/16 23:29:09	1.1705
+++ LVM2/WHATS_NEW	2010/08/17 01:16:41	1.1706
@@ -1,5 +1,6 @@
 Version 2.02.73 - 
 ================================
+  Monitor origin -real device below snapshot instead of overlay device.
   Don't really change monitoring status when in test mode.
   Fix some exit statuses when starting/stopping monitoring fails.
   Enable snapshot monitoring by default when dmeventd is enabled.
--- LVM2/lib/activate/activate.c	2010/08/16 23:29:10	1.175
+++ LVM2/lib/activate/activate.c	2010/08/17 01:16:41	1.176
@@ -770,7 +770,8 @@
 	return path;
 }
 
-int target_registered_with_dmeventd(struct cmd_context *cmd, const char *dso, const char *lvid, int *pending)
+int target_registered_with_dmeventd(struct cmd_context *cmd, const char *dso,
+				    struct logical_volume *lv, int *pending)
 {
 	char *uuid;
 	enum dm_event_mask evmask = 0;
@@ -781,7 +782,8 @@
 	if (!dso)
 		return_0;
 
-	if (!(uuid = build_dm_uuid(cmd->mem, lvid, NULL)))
+	/* We always monitor the "real" device, never the "snapshot-origin" itself. */
+	if (!(uuid = build_dm_uuid(cmd->mem, lv->lvid.s, lv_is_origin(lv) ? "real" : NULL)))
 		return_0;
 
 	if (!(dmevh = _create_dm_event_handler(cmd, uuid, dso, 0, DM_EVENT_ALL_ERRORS)))
@@ -803,7 +805,7 @@
 	return evmask;
 }
 
-int target_register_events(struct cmd_context *cmd, const char *dso, const char *lvid,
+int target_register_events(struct cmd_context *cmd, const char *dso, struct logical_volume *lv,
 			    int evmask __attribute__((unused)), int set, int timeout)
 {
 	char *uuid;
@@ -813,7 +815,8 @@
 	if (!dso)
 		return_0;
 
-	if (!(uuid = build_dm_uuid(cmd->mem, lvid, NULL)))
+	/* We always monitor the "real" device, never the "snapshot-origin" itself. */
+	if (!(uuid = build_dm_uuid(cmd->mem, lv->lvid.s, lv_is_origin(lv) ? "real" : NULL)))
 		return_0;
 
 	if (!(dmevh = _create_dm_event_handler(cmd, uuid, dso, timeout,
@@ -869,18 +872,14 @@
 
 	/*
 	 * In case this LV is a snapshot origin, we instead monitor
-	 * each of its respective snapshots (the origin itself does
-	 * not need to be monitored).
-	 *
-	 * TODO: This may change when snapshots of mirrors are allowed.
+	 * each of its respective snapshots.  The origin itself may
+	 * also need to be monitored if it is a mirror, for example.
 	 */
-	if (lv_is_origin(lv)) {
+	if (lv_is_origin(lv))
 		dm_list_iterate_safe(snh, snht, &lv->snapshot_segs)
 			if (!monitor_dev_for_events(cmd, dm_list_struct_base(snh,
 				    struct lv_segment, origin_list)->cow, monitor))
 				r = 0;
-		return r;
-	}
 
 	/*
 	 * If the volume is mirrored and its log is also mirrored, monitor
--- LVM2/lib/activate/activate.h	2010/08/16 22:54:36	1.69
+++ LVM2/lib/activate/activate.h	2010/08/17 01:16:41	1.70
@@ -105,8 +105,9 @@
 #ifdef DMEVENTD
 #  include "libdevmapper-event.h"
 char *get_monitor_dso_path(struct cmd_context *cmd, const char *libpath);
-int target_registered_with_dmeventd(struct cmd_context *cmd, const char *libpath, const char *lvid, int *pending);
-int target_register_events(struct cmd_context *cmd, const char *dso, const char *lvid,
+int target_registered_with_dmeventd(struct cmd_context *cmd, const char *libpath,
+				    struct logical_volume *lv, int *pending);
+int target_register_events(struct cmd_context *cmd, const char *dso, struct logical_volume *lv,
 			    int evmask __attribute__((unused)), int set, int timeout);
 #endif
 
--- LVM2/lib/mirror/mirrored.c	2010/08/16 22:54:36	1.76
+++ LVM2/lib/mirror/mirrored.c	2010/08/17 01:16:41	1.77
@@ -548,17 +548,18 @@
 							      DEFAULT_DMEVENTD_MIRROR_LIB));
 }
 
+/* FIXME Cache this */
 static int _target_registered(struct lv_segment *seg, int *pending)
 {
 	return target_registered_with_dmeventd(seg->lv->vg->cmd, _get_mirror_dso_path(seg->lv->vg->cmd),
-					       seg->lv->lvid.s, pending);
+					       seg->lv, pending);
 }
 
 /* FIXME This gets run while suspended and performs banned operations. */
 static int _target_set_events(struct lv_segment *seg, int evmask, int set)
 {
 	return target_register_events(seg->lv->vg->cmd, _get_mirror_dso_path(seg->lv->vg->cmd),
-				      seg->lv->lvid.s, evmask, set, 0);
+				      seg->lv, evmask, set, 0);
 }
 
 static int _target_monitor_events(struct lv_segment *seg, int events)
--- LVM2/lib/snapshot/snapshot.c	2010/08/16 22:54:36	1.48
+++ LVM2/lib/snapshot/snapshot.c	2010/08/17 01:16:41	1.49
@@ -168,10 +168,11 @@
 							      DEFAULT_DMEVENTD_SNAPSHOT_LIB));
 }
 
+/* FIXME Cache this */
 static int _target_registered(struct lv_segment *seg, int *pending)
 {
 	return target_registered_with_dmeventd(seg->lv->vg->cmd, _get_snapshot_dso_path(seg->lv->vg->cmd),
-					       seg->cow->lvid.s, pending);
+					       seg->cow, pending);
 }
 
 /* FIXME This gets run while suspended and performs banned operations. */
@@ -179,7 +180,7 @@
 {
 	/* FIXME Make timeout (10) configurable */
 	return target_register_events(seg->lv->vg->cmd, _get_snapshot_dso_path(seg->lv->vg->cmd),
-				      seg->cow->lvid.s, evmask, set, 10);
+				      seg->cow, evmask, set, 10);
 }
 
 static int _target_register_events(struct lv_segment *seg,
--- LVM2/tools/vgchange.c	2010/08/16 22:54:37	1.111
+++ LVM2/tools/vgchange.c	2010/08/17 01:16:41	1.112
@@ -190,7 +190,7 @@
 
 static int _vgchange_available(struct cmd_context *cmd, struct volume_group *vg)
 {
-	int lv_open, active, monitored;
+	int lv_open, active, monitored = 0;
 	int available, ret_max = ECMD_PROCESSED;
 	int activate = 1;
 


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2010-02-24 20:01 mbroz
  0 siblings, 0 replies; 36+ messages in thread
From: mbroz @ 2010-02-24 20:01 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2010-02-24 20:01:41

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c activate.h 
	tools          : vgrename.c 

Log message:
	Remove lvs_in_vg_activated_by_uuid_only call.
	
	There is no difference from lvs_in_vg_activated now,
	convert all users to this call.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1438&r2=1.1439
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.165&r2=1.166
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.64&r2=1.65
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgrename.c.diff?cvsroot=lvm2&r1=1.69&r2=1.70

--- LVM2/WHATS_NEW	2010/02/24 20:00:56	1.1438
+++ LVM2/WHATS_NEW	2010/02/24 20:01:40	1.1439
@@ -1,5 +1,6 @@
 Version 2.02.62 -
 ====================================
+  Remove lvs_in_vg_activated_by_uuid_only call.
   Run device info query device by uuid only.
   Don't touch /dev in vgmknodes if activation is disabled.
   Update lvm2app.h Doxygen comments and add lvm2app Doxygen config file.
--- LVM2/lib/activate/activate.c	2010/02/24 20:00:56	1.165
+++ LVM2/lib/activate/activate.c	2010/02/24 20:01:41	1.166
@@ -171,10 +171,6 @@
 {
 	return 0;
 }
-int lvs_in_vg_activated_by_uuid_only(struct volume_group *vg)
-{
-	return 0;
-}
 int lvs_in_vg_opened(struct volume_group *vg)
 {
 	return 0;
@@ -627,7 +623,7 @@
  * These two functions return the number of visible LVs in the state,
  * or -1 on error.
  */
-static int _lvs_in_vg_activated(struct volume_group *vg, unsigned by_uuid_only)
+int lvs_in_vg_activated(struct volume_group *vg)
 {
 	struct lv_list *lvl;
 	int count = 0;
@@ -643,16 +639,6 @@
 	return count;
 }
 
-int lvs_in_vg_activated_by_uuid_only(struct volume_group *vg)
-{
-	return _lvs_in_vg_activated(vg, 1);
-}
-
-int lvs_in_vg_activated(struct volume_group *vg)
-{
-	return _lvs_in_vg_activated(vg, 0);
-}
-
 int lvs_in_vg_opened(const struct volume_group *vg)
 {
 	const struct lv_list *lvl;
--- LVM2/lib/activate/activate.h	2009/10/01 00:35:29	1.64
+++ LVM2/lib/activate/activate.h	2010/02/24 20:01:41	1.65
@@ -91,7 +91,6 @@
  * Return number of LVs in the VG that are active.
  */
 int lvs_in_vg_activated(struct volume_group *vg);
-int lvs_in_vg_activated_by_uuid_only(struct volume_group *vg);
 int lvs_in_vg_opened(const struct volume_group *vg);
 
 int lv_is_active(struct logical_volume *lv);
--- LVM2/tools/vgrename.c	2010/02/03 14:08:40	1.69
+++ LVM2/tools/vgrename.c	2010/02/24 20:01:41	1.70
@@ -29,7 +29,7 @@
 		return_NULL;
 	}
 
-	if (lvs_in_vg_activated_by_uuid_only(vg)) {
+	if (lvs_in_vg_activated(vg)) {
 		unlock_and_release_vg(cmd, vg, vg_name_old);
 		log_error("Volume group \"%s\" still has active LVs",
 			  vg_name_old);
@@ -161,7 +161,7 @@
 		if (test_mode())
 			log_verbose("Test mode: Skipping rename.");
 
-		else if (lvs_in_vg_activated_by_uuid_only(vg)) {
+		else if (lvs_in_vg_activated(vg)) {
 			if (!vg_refresh_visible(cmd, vg)) {
 				log_error("Renaming \"%s\" to \"%s\" failed", 
 					old_path, new_path);


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2010-02-24 20:00 mbroz
  0 siblings, 0 replies; 36+ messages in thread
From: mbroz @ 2010-02-24 20:00 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2010-02-24 20:00:56

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c dev_manager.c dev_manager.h 

Log message:
	Always query device by uuid only.
	
	lvm2 devices have always UUID set even if imported from lvm1 metadata.
	
	Patch removes name argument from dev_manager_info call and converts
	all activation related calls to use query by UUID.
	
	Also it simplifies mknode call (which is the only user on mknodes parameter).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1437&r2=1.1438
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.164&r2=1.165
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.182&r2=1.183
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.h.diff?cvsroot=lvm2&r1=1.31&r2=1.32

--- LVM2/WHATS_NEW	2010/02/24 18:21:15	1.1437
+++ LVM2/WHATS_NEW	2010/02/24 20:00:56	1.1438
@@ -1,5 +1,7 @@
 Version 2.02.62 -
 ====================================
+  Run device info query device by uuid only.
+  Don't touch /dev in vgmknodes if activation is disabled.
   Update lvm2app.h Doxygen comments and add lvm2app Doxygen config file.
   Update nightly tests and lvm2app unit tests to cover tags.
   Add lvm2app functions lvm_{vg|lv}_{get|add|remove}_tag() functions.
--- LVM2/lib/activate/activate.c	2010/01/27 13:23:57	1.164
+++ LVM2/lib/activate/activate.c	2010/02/24 20:00:56	1.165
@@ -440,28 +440,18 @@
 /*
  * Returns 1 if info structure populated, else 0 on failure.
  */
-static int _lv_info(struct cmd_context *cmd, const struct logical_volume *lv, int with_mknodes,
-		    struct lvinfo *info, int with_open_count, int with_read_ahead, unsigned by_uuid_only)
+int lv_info(struct cmd_context *cmd, const struct logical_volume *lv,
+	    struct lvinfo *info, int with_open_count, int with_read_ahead)
 {
 	struct dm_info dminfo;
-	char *name = NULL;
 
 	if (!activation())
 		return 0;
 
-	if (!by_uuid_only &&
-	    !(name = build_dm_name(cmd->mem, lv->vg->name, lv->name, NULL)))
+	if (!dev_manager_info(lv->vg->cmd->mem, lv, with_open_count,
+			      with_read_ahead, &dminfo, &info->read_ahead))
 		return_0;
 
-	log_debug("Getting device info for %s", name);
-	if (!dev_manager_info(lv->vg->cmd->mem, name, lv, with_mknodes,
-			      with_open_count, with_read_ahead, &dminfo,
-			      &info->read_ahead)) {
-		if (name)
-			dm_pool_free(cmd->mem, name);
-		return_0;
-	}
-
 	info->exists = dminfo.exists;
 	info->suspended = dminfo.suspended;
 	info->open_count = dminfo.open_count;
@@ -471,18 +461,9 @@
 	info->live_table = dminfo.live_table;
 	info->inactive_table = dminfo.inactive_table;
 
-	if (name)
-		dm_pool_free(cmd->mem, name);
-
 	return 1;
 }
 
-int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, struct lvinfo *info,
-	    int with_open_count, int with_read_ahead)
-{
-	return _lv_info(cmd, lv, 0, info, with_open_count, with_read_ahead, 0);
-}
-
 int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s,
 		    struct lvinfo *info, int with_open_count, int with_read_ahead)
 {
@@ -492,7 +473,7 @@
 	if (!(lv = lv_from_lvid(cmd, lvid_s, 0)))
 		return 0;
 
-	r = _lv_info(cmd, lv, 0, info, with_open_count, with_read_ahead, 1);
+	r = lv_info(cmd, lv, info, with_open_count, with_read_ahead);
 	vg_release(lv->vg);
 
 	return r;
@@ -558,12 +539,11 @@
 	return r;
 }
 
-static int _lv_active(struct cmd_context *cmd, struct logical_volume *lv,
-		      unsigned by_uuid_only)
+static int _lv_active(struct cmd_context *cmd, struct logical_volume *lv)
 {
 	struct lvinfo info;
 
-	if (!_lv_info(cmd, lv, 0, &info, 0, 0, by_uuid_only)) {
+	if (!lv_info(cmd, lv, &info, 0, 0)) {
 		stack;
 		return -1;
 	}
@@ -657,7 +637,7 @@
 
 	dm_list_iterate_items(lvl, &vg->lvs) {
 		if (lv_is_visible(lvl->lv))
-			count += (_lv_active(vg->cmd, lvl->lv, by_uuid_only) == 1);
+			count += (_lv_active(vg->cmd, lvl->lv) == 1);
 	}
 
 	return count;
@@ -700,7 +680,7 @@
 {
 	int ret;
 
-	if (_lv_active(lv->vg->cmd, lv, 0))
+	if (_lv_active(lv->vg->cmd, lv))
 		return 1;
 
 	if (!vg_is_clustered(lv->vg))
@@ -1182,7 +1162,6 @@
 
 int lv_mknodes(struct cmd_context *cmd, const struct logical_volume *lv)
 {
-	struct lvinfo info;
 	int r = 1;
 
 	if (!lv) {
@@ -1191,14 +1170,10 @@
 		return r;
 	}
 
-	if (!_lv_info(cmd, lv, 1, &info, 0, 0, 0))
-		return_0;
+	if (!activation())
+		return 1;
 
-	if (info.exists) {
-		if (lv_is_visible(lv))
-			r = dev_manager_lv_mknodes(lv);
-	} else
-		r = dev_manager_lv_rmnodes(lv);
+	r = dev_manager_mknodes(lv);
 
 	fs_unlock();
 
--- LVM2/lib/activate/dev_manager.c	2010/02/23 15:49:52	1.182
+++ LVM2/lib/activate/dev_manager.c	2010/02/24 20:00:56	1.183
@@ -127,7 +127,7 @@
 
 	dmtask = mknodes ? DM_DEVICE_MKNODES : DM_DEVICE_INFO;
 
-	if (!(dmt = _setup_task(name, dlid, 0, dmtask, major, minor)))
+	if (!(dmt = _setup_task(mknodes ? name : NULL, dlid, 0, dmtask, major, minor)))
 		return_0;
 
 	if (!with_open_count)
@@ -205,27 +205,18 @@
 	return r;
 }
 
-static int _info(const char *name, const char *dlid, int mknodes,
-		 int with_open_count, int with_read_ahead,
+static int _info(const char *dlid, int with_open_count, int with_read_ahead,
 		 struct dm_info *info, uint32_t *read_ahead)
 {
 	int r = 0;
 
-	if (!mknodes && dlid && *dlid) {
-		if ((r = _info_run(NULL, dlid, info, read_ahead, 0, with_open_count,
-			      with_read_ahead, 0, 0)) &&
-	    	    info->exists)
-			return 1;
-		else if ((r = _info_run(NULL, dlid + sizeof(UUID_PREFIX) - 1, info,
-				   read_ahead, 0, with_open_count,
-				   with_read_ahead, 0, 0)) &&
-			 info->exists)
-			return 1;
-	}
-
-	if (name)
-		return _info_run(name, NULL, info, read_ahead, mknodes,
-				 with_open_count, with_read_ahead, 0, 0);
+	if ((r = _info_run(NULL, dlid, info, read_ahead, 0, with_open_count,
+			   with_read_ahead, 0, 0)) && info->exists)
+		return 1;
+	else if ((r = _info_run(NULL, dlid + sizeof(UUID_PREFIX) - 1, info,
+				read_ahead, 0, with_open_count,
+				with_read_ahead, 0, 0)) && info->exists)
+		return 1;
 
 	return r;
 }
@@ -235,20 +226,28 @@
 	return _info_run(NULL, NULL, info, NULL, 0, 0, 0, major, minor);
 }
 
-int dev_manager_info(struct dm_pool *mem, const char *name,
-		     const struct logical_volume *lv, int with_mknodes,
+int dev_manager_info(struct dm_pool *mem, const struct logical_volume *lv,
 		     int with_open_count, int with_read_ahead,
 		     struct dm_info *info, uint32_t *read_ahead)
 {
-	const char *dlid;
+	const char *dlid, *name;
+	int r;
+
+	if (!(name = build_dm_name(mem, lv->vg->name, lv->name, NULL))) {
+		log_error("name build failed for %s", lv->name);
+		return 0;
+	}
 
 	if (!(dlid = _build_dlid(mem, lv->lvid.s, NULL))) {
 		log_error("dlid build failed for %s", lv->name);
 		return 0;
 	}
 
-	return _info(name, dlid, with_mknodes, with_open_count, with_read_ahead,
-		     info, read_ahead);
+	log_debug("Getting device info for %s [%s]", name, dlid);
+	r = _info(dlid, with_open_count, with_read_ahead, info, read_ahead);
+
+	dm_pool_free(mem, (char*)name);
+	return r;
 }
 
 static const struct dm_info *_cached_info(struct dm_pool *mem,
@@ -744,7 +743,7 @@
 /*  NEW CODE STARTS HERE */
 /*************************/
 
-int dev_manager_lv_mknodes(const struct logical_volume *lv)
+static int _dev_manager_lv_mknodes(const struct logical_volume *lv)
 {
 	char *name;
 
@@ -755,11 +754,32 @@
 	return fs_add_lv(lv, name);
 }
 
-int dev_manager_lv_rmnodes(const struct logical_volume *lv)
+static int _dev_manager_lv_rmnodes(const struct logical_volume *lv)
 {
 	return fs_del_lv(lv);
 }
 
+int dev_manager_mknodes(const struct logical_volume *lv)
+{
+	struct dm_info dminfo;
+	const char *name;
+	int r = 0;
+
+	if (!(name = build_dm_name(lv->vg->cmd->mem, lv->vg->name, lv->name, NULL)))
+		return_0;
+
+	if ((r = _info_run(name, NULL, &dminfo, NULL, 1, 0, 0, 0, 0))) {
+		if (dminfo.exists) {
+			if (lv_is_visible(lv))
+				r = _dev_manager_lv_mknodes(lv);
+		} else
+			r = _dev_manager_lv_rmnodes(lv);
+	}
+
+	dm_pool_free(lv->vg->cmd->mem, (char*)name);
+	return r;
+}
+
 static int _add_dev_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
 			       struct logical_volume *lv, const char *layer)
 {
@@ -774,7 +794,7 @@
 		return_0;
 
 	log_debug("Getting device info for %s [%s]", name, dlid);
-	if (!_info(name, dlid, 0, 1, 0, &info, NULL)) {
+	if (!_info(dlid, 1, 0, &info, NULL)) {
 		log_error("Failed to get info for %s [%s].", name, dlid);
 		return 0;
 	}
@@ -1309,11 +1329,11 @@
 			continue;
 		}
 		if (lv_is_visible(lvlayer->lv)) {
-			if (!dev_manager_lv_mknodes(lvlayer->lv))
+			if (!_dev_manager_lv_mknodes(lvlayer->lv))
 				r = 0;
 			continue;
 		}
-		if (!dev_manager_lv_rmnodes(lvlayer->lv))
+		if (!_dev_manager_lv_rmnodes(lvlayer->lv))
 			r = 0;
 	}
 
--- LVM2/lib/activate/dev_manager.h	2010/01/15 22:58:25	1.31
+++ LVM2/lib/activate/dev_manager.h	2010/02/24 20:00:56	1.32
@@ -40,9 +40,8 @@
  * (eg, an origin is created before its snapshot, but is not
  * unsuspended until the snapshot is also created.)
  */
-int dev_manager_info(struct dm_pool *mem, const char *name,
-		     const struct logical_volume *lv,
-		     int mknodes, int with_open_count, int with_read_ahead,
+int dev_manager_info(struct dm_pool *mem, const struct logical_volume *lv,
+		     int with_open_count, int with_read_ahead,
 		     struct dm_info *info, uint32_t *read_ahead);
 int dev_manager_snapshot_percent(struct dev_manager *dm,
 				 const struct logical_volume *lv,
@@ -59,8 +58,7 @@
 			int *flush_required);
 int dev_manager_deactivate(struct dev_manager *dm, struct logical_volume *lv);
 
-int dev_manager_lv_mknodes(const struct logical_volume *lv);
-int dev_manager_lv_rmnodes(const struct logical_volume *lv);
+int dev_manager_mknodes(const struct logical_volume *lv);
 
 /*
  * Put the desired changes into effect.


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2009-10-01  0:35 agk
  0 siblings, 0 replies; 36+ messages in thread
From: agk @ 2009-10-01  0:35 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2009-10-01 00:35:30

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c activate.h dev_manager.c 
	                 dev_manager.h 
	lib/display    : display.c 
	lib/metadata   : metadata-exported.h mirror.c segtype.h 
	lib/mirror     : mirrored.c 
	lib/report     : report.c 
	lib/snapshot   : snapshot.c 
	tools          : lvscan.c polldaemon.c 

Log message:
	Introduce percent_range_t and centralise snapshot full/mirror in-sync checks.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1284&r2=1.1285
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.155&r2=1.156
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.63&r2=1.64
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.158&r2=1.159
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.h.diff?cvsroot=lvm2&r1=1.29&r2=1.30
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/display/display.c.diff?cvsroot=lvm2&r1=1.104&r2=1.105
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata-exported.h.diff?cvsroot=lvm2&r1=1.112&r2=1.113
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.89&r2=1.90
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/segtype.h.diff?cvsroot=lvm2&r1=1.24&r2=1.25
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.63&r2=1.64
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.102&r2=1.103
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/snapshot.c.diff?cvsroot=lvm2&r1=1.37&r2=1.38
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvscan.c.diff?cvsroot=lvm2&r1=1.39&r2=1.40
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/polldaemon.c.diff?cvsroot=lvm2&r1=1.26&r2=1.27

--- LVM2/WHATS_NEW	2009/09/30 17:43:51	1.1284
+++ LVM2/WHATS_NEW	2009/10/01 00:35:29	1.1285
@@ -1,5 +1,6 @@
 Version 2.02.54 -
 =====================================
+  Introduce percent_range_t and centralise snapshot full/mirror in-sync checks.
   Factor out poll_mirror_progress and introduce progress_t.
   Distinguish between powers of 1000 and powers of 1024 in unit suffixes.
   Restart lvconverts in vgchange by sharing lv_spawn_background_polling.
--- LVM2/lib/activate/activate.c	2009/09/29 18:50:28	1.155
+++ LVM2/lib/activate/activate.c	2009/10/01 00:35:29	1.156
@@ -156,12 +156,14 @@
 {
 	return 0;
 }
-int lv_snapshot_percent(const struct logical_volume *lv, float *percent)
+int lv_snapshot_percent(const struct logical_volume *lv, float *percent,
+			percent_range_t *percent_range)
 {
 	return 0;
 }
 int lv_mirror_percent(struct cmd_context *cmd, struct logical_volume *lv,
-		      int wait, float *percent, uint32_t *event_nr)
+		      int wait, float *percent, percent_range_t *percent_range,
+		      uint32_t *event_nr)
 {
 	return 0;
 }
@@ -495,7 +497,8 @@
 /*
  * Returns 1 if percent set, else 0 on failure.
  */
-int lv_snapshot_percent(const struct logical_volume *lv, float *percent)
+int lv_snapshot_percent(const struct logical_volume *lv, float *percent,
+			percent_range_t *percent_range)
 {
 	int r;
 	struct dev_manager *dm;
@@ -506,7 +509,7 @@
 	if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name)))
 		return_0;
 
-	if (!(r = dev_manager_snapshot_percent(dm, lv, percent)))
+	if (!(r = dev_manager_snapshot_percent(dm, lv, percent, percent_range)))
 		stack;
 
 	dev_manager_destroy(dm);
@@ -516,7 +519,8 @@
 
 /* FIXME Merge with snapshot_percent */
 int lv_mirror_percent(struct cmd_context *cmd, struct logical_volume *lv,
-		      int wait, float *percent, uint32_t *event_nr)
+		      int wait, float *percent, percent_range_t *percent_range,
+		      uint32_t *event_nr)
 {
 	int r;
 	struct dev_manager *dm;
@@ -541,7 +545,8 @@
 	if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name)))
 		return_0;
 
-	if (!(r = dev_manager_mirror_percent(dm, lv, wait, percent, event_nr)))
+	if (!(r = dev_manager_mirror_percent(dm, lv, wait, percent,
+					     percent_range, event_nr)))
 		stack;
 
 	dev_manager_destroy(dm);
--- LVM2/lib/activate/activate.h	2009/02/28 00:54:06	1.63
+++ LVM2/lib/activate/activate.h	2009/10/01 00:35:29	1.64
@@ -81,9 +81,11 @@
 /*
  * Returns 1 if percent has been set, else 0.
  */
-int lv_snapshot_percent(const struct logical_volume *lv, float *percent);
+int lv_snapshot_percent(const struct logical_volume *lv, float *percent,
+			percent_range_t *percent_range);
 int lv_mirror_percent(struct cmd_context *cmd, struct logical_volume *lv,
-		      int wait, float *percent, uint32_t *event_nr);
+		      int wait, float *percent, percent_range_t *percent_range,
+		      uint32_t *event_nr);
 
 /*
  * Return number of LVs in the VG that are active.
--- LVM2/lib/activate/dev_manager.c	2009/08/04 15:36:14	1.158
+++ LVM2/lib/activate/dev_manager.c	2009/10/01 00:35:29	1.159
@@ -327,10 +327,26 @@
 	return 0;
 }
 
+static percent_range_t _combine_percent_ranges(percent_range_t a,
+					       percent_range_t b)
+{
+	if (a == PERCENT_INVALID || b == PERCENT_INVALID)
+		return PERCENT_INVALID;
+
+	if (a == PERCENT_100 && b == PERCENT_100)
+		return PERCENT_100;
+
+	if (a == PERCENT_0 && b == PERCENT_0)
+		return PERCENT_0;
+
+	return PERCENT_0_TO_100;
+}
+
 static int _percent_run(struct dev_manager *dm, const char *name,
 			const char *dlid,
 			const char *target_type, int wait,
 			struct logical_volume *lv, float *percent,
+			percent_range_t *overall_percent_range,
 			uint32_t *event_nr)
 {
 	int r = 0;
@@ -343,10 +359,13 @@
 	struct dm_list *segh = &lv->segments;
 	struct lv_segment *seg = NULL;
 	struct segment_type *segtype;
+	percent_range_t percent_range, combined_percent_range;
+	int first_time = 1;
 
 	uint64_t total_numerator = 0, total_denominator = 0;
 
 	*percent = -1;
+	*overall_percent_range = PERCENT_INVALID;
 
 	if (!(dmt = _setup_task(name, dlid, event_nr,
 				wait ? DM_DEVICE_WAITEVENT : DM_DEVICE_STATUS, 0, 0)))
@@ -383,12 +402,20 @@
 			continue;
 
 		if (segtype->ops->target_percent &&
-		    !segtype->ops->target_percent(&dm->target_state, dm->mem,
+		    !segtype->ops->target_percent(&dm->target_state,
+						  &percent_range, dm->mem,
 						  dm->cmd, seg, params,
 						  &total_numerator,
 						  &total_denominator))
 			goto_out;
 
+		if (first_time) {
+			combined_percent_range = percent_range;
+			first_time = 0;
+		} else
+			combined_percent_range =
+			    _combine_percent_ranges(combined_percent_range,
+						    percent_range);
 	} while (next);
 
 	if (lv && (segh = dm_list_next(&lv->segments, segh))) {
@@ -397,10 +424,16 @@
 		goto out;
 	}
 
-	if (total_denominator)
+	if (total_denominator) {
 		*percent = (float) total_numerator *100 / total_denominator;
-	else
+		*overall_percent_range = combined_percent_range;
+	} else {
 		*percent = 100;
+		if (first_time)
+			*overall_percent_range = PERCENT_100;
+		else
+			*overall_percent_range = combined_percent_range;
+	}
 
 	log_debug("LV percent: %f", *percent);
 	r = 1;
@@ -413,20 +446,20 @@
 static int _percent(struct dev_manager *dm, const char *name, const char *dlid,
 		    const char *target_type, int wait,
 		    struct logical_volume *lv, float *percent,
-		    uint32_t *event_nr)
+		    percent_range_t *overall_percent_range, uint32_t *event_nr)
 {
 	if (dlid && *dlid) {
 		if (_percent_run(dm, NULL, dlid, target_type, wait, lv, percent,
-				 event_nr))
+				 overall_percent_range, event_nr))
 			return 1;
 		else if (_percent_run(dm, NULL, dlid + sizeof(UUID_PREFIX) - 1,
 				      target_type, wait, lv, percent,
-				      event_nr))
+				      overall_percent_range, event_nr))
 			return 1;
 	}
 
 	if (name && _percent_run(dm, name, NULL, target_type, wait, lv, percent,
-				 event_nr))
+				 overall_percent_range, event_nr))
 		return 1;
 
 	return 0;
@@ -481,7 +514,7 @@
 
 int dev_manager_snapshot_percent(struct dev_manager *dm,
 				 const struct logical_volume *lv,
-				 float *percent)
+				 float *percent, percent_range_t *percent_range)
 {
 	char *name;
 	const char *dlid;
@@ -500,7 +533,7 @@
 	 */
 	log_debug("Getting device status percentage for %s", name);
 	if (!(_percent(dm, name, dlid, "snapshot", 0, NULL, percent,
-		       NULL)))
+		       percent_range, NULL)))
 		return_0;
 
 	/* FIXME dm_pool_free ? */
@@ -513,7 +546,8 @@
 /* FIXME Cope with more than one target */
 int dev_manager_mirror_percent(struct dev_manager *dm,
 			       struct logical_volume *lv, int wait,
-			       float *percent, uint32_t *event_nr)
+			       float *percent, percent_range_t *percent_range,
+			       uint32_t *event_nr)
 {
 	char *name;
 	const char *dlid;
@@ -533,7 +567,7 @@
 
 	log_debug("Getting device mirror status percentage for %s", name);
 	if (!(_percent(dm, name, dlid, "mirror", wait, lv, percent,
-		       event_nr)))
+		       percent_range, event_nr)))
 		return_0;
 
 	return 1;
--- LVM2/lib/activate/dev_manager.h	2009/05/20 09:52:37	1.29
+++ LVM2/lib/activate/dev_manager.h	2009/10/01 00:35:29	1.30
@@ -16,6 +16,8 @@
 #ifndef _LVM_DEV_MANAGER_H
 #define _LVM_DEV_MANAGER_H
 
+#include "metadata-exported.h"
+
 struct logical_volume;
 struct volume_group;
 struct cmd_context;
@@ -44,10 +46,12 @@
 		     struct dm_info *info, uint32_t *read_ahead);
 int dev_manager_snapshot_percent(struct dev_manager *dm,
 				 const struct logical_volume *lv,
-				 float *percent);
+				 float *percent,
+				 percent_range_t *percent_range);
 int dev_manager_mirror_percent(struct dev_manager *dm,
 			       struct logical_volume *lv, int wait,
-			       float *percent, uint32_t *event_nr);
+			       float *percent, percent_range_t *percent_range,
+			       uint32_t *event_nr);
 int dev_manager_suspend(struct dev_manager *dm, struct logical_volume *lv,
 			int lockfs, int flush_required);
 int dev_manager_activate(struct dev_manager *dm, struct logical_volume *lv);
--- LVM2/lib/display/display.c	2009/09/30 14:19:01	1.104
+++ LVM2/lib/display/display.c	2009/10/01 00:35:29	1.105
@@ -482,6 +482,7 @@
 	char uuid[64] __attribute((aligned(8)));
 	struct lv_segment *snap_seg = NULL;
 	float snap_percent;	/* fused, fsize; */
+	percent_range_t percent_range;
 
 	if (!id_write_format(&lv->lvid.id[1], uuid, sizeof(uuid)))
 		return_0;
@@ -506,24 +507,26 @@
 				       origin_list) {
 			if (inkernel &&
 			    (snap_active = lv_snapshot_percent(snap_seg->cow,
-							       &snap_percent)))
-				if (snap_percent < 0 || snap_percent >= 100)
+							       &snap_percent,
+							       &percent_range)))
+				if (percent_range == PERCENT_INVALID)
 					snap_active = 0;
 			log_print("                       %s%s/%s [%s]",
 				  lv->vg->cmd->dev_dir, lv->vg->name,
 				  snap_seg->cow->name,
-				  (snap_active > 0) ? "active" : "INACTIVE");
+				  snap_active ? "active" : "INACTIVE");
 		}
 		snap_seg = NULL;
 	} else if ((snap_seg = find_cow(lv))) {
 		if (inkernel &&
 		    (snap_active = lv_snapshot_percent(snap_seg->cow,
-						       &snap_percent)))
-			if (snap_percent < 0 || snap_percent >= 100)
+						       &snap_percent,
+						       &percent_range)))
+			if (percent_range == PERCENT_INVALID)
 				snap_active = 0;
 
 		log_print("LV snapshot status     %s destination for %s%s/%s",
-			  (snap_active > 0) ? "active" : "INACTIVE",
+			  snap_active ? "active" : "INACTIVE",
 			  lv->vg->cmd->dev_dir, lv->vg->name,
 			  snap_seg->origin->name);
 	}
--- LVM2/lib/metadata/metadata-exported.h	2009/09/15 18:35:14	1.112
+++ LVM2/lib/metadata/metadata-exported.h	2009/10/01 00:35:29	1.113
@@ -136,6 +136,13 @@
 	DONT_PROMPT_OVERRIDE = 2 /* Skip prompt + override a second condition */
 } force_t;
 
+typedef enum {
+	PERCENT_0 = 0,
+	PERCENT_0_TO_100 = 1,
+	PERCENT_100 = 2,
+	PERCENT_INVALID = 3
+} percent_range_t;
+
 struct cmd_context;
 struct format_handler;
 struct labeller;
--- LVM2/lib/metadata/mirror.c	2009/06/01 14:43:28	1.89
+++ LVM2/lib/metadata/mirror.c	2009/10/01 00:35:29	1.90
@@ -701,17 +701,16 @@
 static int _mirrored_lv_in_sync(struct logical_volume *lv)
 {
 	float sync_percent;
+	percent_range_t percent_range;
 
-	if (!lv_mirror_percent(lv->vg->cmd, lv, 0, &sync_percent, NULL)) {
+	if (!lv_mirror_percent(lv->vg->cmd, lv, 0, &sync_percent,
+			       &percent_range, NULL)) {
 		log_error("Unable to determine mirror sync status of %s/%s.",
 			  lv->vg->name, lv->name);
 		return 0;
 	}
 
-	if (sync_percent >= 100.0)
-		return 1;
-
-	return 0;
+	return (percent_range == PERCENT_100) ? 1 : 0;
 }
 
 /*
@@ -1203,6 +1202,7 @@
 		      struct dm_list *removable_pvs)
 {
 	float sync_percent;
+	percent_range_t percent_range = PERCENT_0;
 	struct lvinfo info;
 	struct volume_group *vg = lv->vg;
 
@@ -1214,7 +1214,8 @@
 
 	/* Had disk log, switch to core. */
 	if (lv_info(cmd, lv, &info, 0, 0) && info.exists) {
-		if (!lv_mirror_percent(cmd, lv, 0, &sync_percent, NULL)) {
+		if (!lv_mirror_percent(cmd, lv, 0, &sync_percent,
+				       &percent_range, NULL)) {
 			log_error("Unable to determine mirror sync status.");
 			return 0;
 		}
@@ -1229,7 +1230,7 @@
 	else
 		return 0;
 
-	if (sync_percent >= 100.0)
+	if (percent_range == PERCENT_100)
 		init_mirror_in_sync(1);
 	else {
 		/* A full resync will take place */
@@ -1353,6 +1354,7 @@
 	const struct segment_type *segtype;
 	struct dm_list *parallel_areas;
 	float sync_percent;
+	percent_range_t percent_range;
 	int in_sync;
 	struct logical_volume *log_lv;
 	struct lvinfo info;
@@ -1404,8 +1406,9 @@
 	}
 
 	/* check sync status */
-	if (lv_mirror_percent(cmd, lv, 0, &sync_percent, NULL) &&
-	    sync_percent >= 100.0)
+	if (lv_mirror_percent(cmd, lv, 0, &sync_percent, &percent_range,
+			      NULL) &&
+	    (percent_range == PERCENT_100))
 		in_sync = 1;
 	else
 		in_sync = 0;
--- LVM2/lib/metadata/segtype.h	2009/07/08 12:36:01	1.24
+++ LVM2/lib/metadata/segtype.h	2009/10/01 00:35:29	1.25
@@ -16,6 +16,8 @@
 #ifndef _SEGTYPES_H
 #define _SEGTYPES_H
 
+#include "metadata-exported.h"
+
 struct segtype_handler;
 struct cmd_context;
 struct config_tree;
@@ -73,7 +75,9 @@
                                 struct lv_segment *seg,
                                 struct dm_tree_node *node, uint64_t len,
                                 uint32_t *pvmove_mirror_count);
-	int (*target_percent) (void **target_state, struct dm_pool * mem,
+	int (*target_percent) (void **target_state,
+			       percent_range_t *percent_range,
+			       struct dm_pool * mem,
 			       struct cmd_context *cmd,
 			       struct lv_segment *seg, char *params,
 			       uint64_t *total_numerator,
--- LVM2/lib/mirror/mirrored.c	2009/08/13 19:36:04	1.63
+++ LVM2/lib/mirror/mirrored.c	2009/10/01 00:35:30	1.64
@@ -178,10 +178,13 @@
 	return mirr_state;
 }
 
-static int _mirrored_target_percent(void **target_state, struct dm_pool *mem,
-			   struct cmd_context *cmd, struct lv_segment *seg,
-			   char *params, uint64_t *total_numerator,
-			   uint64_t *total_denominator)
+static int _mirrored_target_percent(void **target_state,
+				    percent_range_t *percent_range,
+				    struct dm_pool *mem,
+				    struct cmd_context *cmd,
+				    struct lv_segment *seg, char *params,
+				    uint64_t *total_numerator,
+				    uint64_t *total_denominator)
 {
 	struct mirror_state *mirr_state;
 	uint64_t numerator, denominator;
@@ -226,6 +229,13 @@
 	if (seg)
 		seg->extents_copied = seg->area_len * numerator / denominator;
 
+	if (numerator == denominator)
+		*percent_range = PERCENT_100;
+	else if (numerator == 0)
+		*percent_range = PERCENT_0;
+	else
+		*percent_range = PERCENT_0_TO_100;
+
 	return 1;
 }
 
--- LVM2/lib/report/report.c	2009/09/15 18:35:14	1.102
+++ LVM2/lib/report/report.c	2009/10/01 00:35:30	1.103
@@ -275,18 +275,17 @@
 static int _lv_mimage_in_sync(const struct logical_volume *lv)
 {
 	float percent;
+	percent_range_t percent_range;
 	struct lv_segment *mirror_seg = find_mirror_seg(first_seg(lv));
 
 	if (!(lv->status & MIRROR_IMAGE) || !mirror_seg)
 		return_0;
 
-	if (!lv_mirror_percent(lv->vg->cmd, mirror_seg->lv, 0, &percent, NULL))
+	if (!lv_mirror_percent(lv->vg->cmd, mirror_seg->lv, 0, &percent,
+			       &percent_range, NULL))
 		return_0;
 
-	if (percent >= 100.0)
-		return 1;
-
-	return 0;
+	return (percent_range == PERCENT_100) ? 1 : 0;
 }
 
 static int _lvstatus_disp(struct dm_report *rh __attribute((unused)), struct dm_pool *mem,
@@ -297,6 +296,7 @@
 	struct lvinfo info;
 	char *repstr;
 	float snap_percent;
+	percent_range_t percent_range;
 
 	if (!(repstr = dm_pool_zalloc(mem, 7))) {
 		log_error("dm_pool_alloc failed");
@@ -363,8 +363,8 @@
 
 		/* Snapshot dropped? */
 		if (info.live_table && lv_is_cow(lv) &&
-		    (!lv_snapshot_percent(lv, &snap_percent) ||
-		     snap_percent < 0 || snap_percent >= 100)) {
+		    (!lv_snapshot_percent(lv, &snap_percent, &percent_range) ||
+		     percent_range == PERCENT_INVALID)) {
 			repstr[0] = toupper(repstr[0]);
 			if (info.suspended)
 				repstr[4] = 'S'; /* Susp Inv snapshot */
@@ -1009,6 +1009,7 @@
 	const struct logical_volume *lv = (const struct logical_volume *) data;
 	struct lvinfo info;
 	float snap_percent;
+	percent_range_t percent_range;
 	uint64_t *sortval;
 	char *repstr;
 
@@ -1030,7 +1031,8 @@
 		return 1;
 	}
 
-	if (!lv_snapshot_percent(lv, &snap_percent) || snap_percent < 0) {
+	if (!lv_snapshot_percent(lv, &snap_percent, &percent_range) ||
+				 (percent_range == PERCENT_INVALID)) {
 		*sortval = UINT64_C(100);
 		dm_report_field_set_value(field, "100.00", sortval);
 		return 1;
@@ -1058,6 +1060,7 @@
 {
 	struct logical_volume *lv = (struct logical_volume *) data;
 	float percent;
+	percent_range_t percent_range;
 	uint64_t *sortval;
 	char *repstr;
 
@@ -1067,7 +1070,8 @@
 	}
 
 	if ((!(lv->status & PVMOVE) && !(lv->status & MIRRORED)) ||
-	    !lv_mirror_percent(lv->vg->cmd, lv, 0, &percent, NULL)) {
+	    !lv_mirror_percent(lv->vg->cmd, lv, 0, &percent, &percent_range,
+			       NULL) || (percent_range == PERCENT_INVALID)) {
 		*sortval = UINT64_C(0);
 		dm_report_field_set_value(field, "", sortval);
 		return 1;
--- LVM2/lib/snapshot/snapshot.c	2009/05/13 21:21:58	1.37
+++ LVM2/lib/snapshot/snapshot.c	2009/10/01 00:35:30	1.38
@@ -88,11 +88,12 @@
 
 #ifdef DEVMAPPER_SUPPORT
 static int _snap_target_percent(void **target_state __attribute((unused)),
-			   struct dm_pool *mem __attribute((unused)),
-			   struct cmd_context *cmd __attribute((unused)),
-			   struct lv_segment *seg __attribute((unused)),
-			   char *params, uint64_t *total_numerator,
-			   uint64_t *total_denominator)
+				percent_range_t *percent_range,
+				struct dm_pool *mem __attribute((unused)),
+				struct cmd_context *cmd __attribute((unused)),
+				struct lv_segment *seg __attribute((unused)),
+				char *params, uint64_t *total_numerator,
+				uint64_t *total_denominator)
 {
 	uint64_t numerator, denominator;
 
@@ -100,7 +101,16 @@
 		   &numerator, &denominator) == 2) {
 		*total_numerator += numerator;
 		*total_denominator += denominator;
-	}
+		if (!numerator)
+			*percent_range = PERCENT_0;
+		else if (numerator == denominator)
+			*percent_range = PERCENT_100;
+		else
+			*percent_range = PERCENT_0_TO_100;
+	} else if (!strcmp(params, "Invalid"))
+		*percent_range = PERCENT_INVALID;
+	else
+		return 0;
 
 	return 1;
 }
--- LVM2/tools/lvscan.c	2009/07/01 17:00:52	1.39
+++ LVM2/tools/lvscan.c	2009/10/01 00:35:30	1.40
@@ -24,6 +24,7 @@
 	int inkernel, snap_active = 1;
 	struct lv_segment *snap_seg = NULL;
 	float snap_percent;     /* fused, fsize; */
+	percent_range_t percent_range;
 
 	const char *active_str, *snapshot_str;
 
@@ -36,15 +37,17 @@
 				       origin_list) {
 			if (inkernel &&
 			    (snap_active = lv_snapshot_percent(snap_seg->cow,
-							       &snap_percent)))
-				if (snap_percent < 0 || snap_percent >= 100)
+							       &snap_percent,
+							       &percent_range)))
+				if (percent_range == PERCENT_INVALID)
 					snap_active = 0;
 		}
 		snap_seg = NULL;
 	} else if (lv_is_cow(lv)) {
 		if (inkernel &&
-		    (snap_active = lv_snapshot_percent(lv, &snap_percent)))
-			if (snap_percent < 0 || snap_percent >= 100)
+		    (snap_active = lv_snapshot_percent(lv, &snap_percent,
+						       &percent_range)))
+			if (percent_range == PERCENT_INVALID)
 				snap_active = 0;
 	}
 
--- LVM2/tools/polldaemon.c	2009/09/30 18:15:06	1.26
+++ LVM2/tools/polldaemon.c	2009/10/01 00:35:30	1.27
@@ -68,10 +68,12 @@
 				struct daemon_parms *parms)
 {
 	float segment_percent = 0.0, overall_percent = 0.0;
+	percent_range_t percent_range;
 	uint32_t event_nr = 0;
 
 	if (!lv_mirror_percent(cmd, lv, !parms->interval, &segment_percent,
-			       &event_nr)) {
+			       &percent_range, &event_nr) ||
+	    (percent_range == PERCENT_INVALID)) {
 		log_error("ABORTING: Mirror percentage check failed.");
 		return PROGRESS_CHECK_FAILED;
 	}
@@ -84,7 +86,7 @@
 		log_verbose("%s: %s: %.1f%%", name, parms->progress_title,
 			    overall_percent);
 
-	if (segment_percent < 100.0)
+	if (percent_range != PERCENT_100)
 		return PROGRESS_UNFINISHED;
 
 	if (overall_percent >= 100.0)


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2009-06-01 12:43 mbroz
  0 siblings, 0 replies; 36+ messages in thread
From: mbroz @ 2009-06-01 12:43 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2009-06-01 12:43:32

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c dev_manager.c 
	lib/metadata   : metadata.c metadata.h 

Log message:
	Fix readahead calculation problems.
	
	During vgreduce is failed mirror image replaced with error segment,
	this segmant type has always area_count == 0.
	Current code expects that there is at least one area with device,
	patch fixes it by additional check (fixes segfault during vgreduce).
	
	Also do not calculate readahead in every lv_info call, we only need
	to cache PV readahead before activation calls which locks memory.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1135&r2=1.1136
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.152&r2=1.153
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.151&r2=1.152
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.223&r2=1.224
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.195&r2=1.196

--- LVM2/WHATS_NEW	2009/05/30 01:54:29	1.1135
+++ LVM2/WHATS_NEW	2009/06/01 12:43:31	1.1136
@@ -1,5 +1,7 @@
 Version 2.02.48 - 
 ===============================
+  Cache underlying device readahead only before activation calls.
+  Fix segfault when calculating readahead on missing device in vgreduce.
   Remove verbose 'visited' messages.
   Handle multi-extent mirror log allocation when smallest PV has only 1 extent.
   Add LSB standard headers and functions (incl. reload) to clvmd initscript.
--- LVM2/lib/activate/activate.c	2009/05/21 03:04:52	1.152
+++ LVM2/lib/activate/activate.c	2009/06/01 12:43:32	1.153
@@ -469,11 +469,6 @@
 	info->live_table = dminfo.live_table;
 	info->inactive_table = dminfo.inactive_table;
 
-	/*
-	 * Cache read ahead value for PV devices now (before possible suspend)
-	 */
-	(void)lv_calculate_readhead(lv);
-
 	if (name)
 		dm_pool_free(cmd->mem, name);
 
@@ -879,6 +874,8 @@
 		goto out;
 	}
 
+	lv_calculate_readahead(lv, NULL);
+
 	/* If VG was precommitted, preload devices for the LV */
 	if ((lv_pre->vg->status & PRECOMMITTED)) {
 		if (!_lv_preload(lv_pre, &flush_required)) {
@@ -1010,6 +1007,8 @@
 		goto out;
 	}
 
+	lv_calculate_readahead(lv, NULL);
+
 	if (!monitor_dev_for_events(cmd, lv, 0))
 		stack;
 
@@ -1093,6 +1092,8 @@
 		goto out;
 	}
 
+	lv_calculate_readahead(lv, NULL);
+
 	if (exclusive)
 		lv->status |= ACTIVATE_EXCL;
 
--- LVM2/lib/activate/dev_manager.c	2009/05/28 01:11:30	1.151
+++ LVM2/lib/activate/dev_manager.c	2009/06/01 12:43:32	1.152
@@ -1023,7 +1023,7 @@
 		/* we need RA at least twice a whole stripe - see the comment in md/raid0.c */
 		read_ahead = max_stripe_size * 2;
 		if (!read_ahead)
-			read_ahead = lv_calculate_readhead(lv);
+			lv_calculate_readahead(lv, &read_ahead);
 		read_ahead_flags = DM_READ_AHEAD_MINIMUM_FLAG;
 	}
 
--- LVM2/lib/metadata/metadata.c	2009/05/30 01:54:29	1.223
+++ LVM2/lib/metadata/metadata.c	2009/06/01 12:43:32	1.224
@@ -1422,7 +1422,7 @@
 	struct lv_segment *seg = first_seg(lv);
 	uint32_t seg_read_ahead = 0, *read_ahead = data;
 
-	if (seg && seg_type(seg, 0) == AREA_PV)
+	if (seg && seg->area_count && seg_type(seg, 0) == AREA_PV)
 		dev_get_read_ahead(seg_pv(seg, 0)->dev, &seg_read_ahead);
 
 	if (seg_read_ahead > *read_ahead)
@@ -1431,15 +1431,22 @@
 	return 1;
 }
 
-uint32_t lv_calculate_readhead(const struct logical_volume *lv)
+/*
+ * Calculate readahead for logical volume from underlying PV devices.
+ * If read_ahead is NULL, only ensure that readahead of PVs are preloaded
+ * into PV struct device in dev cache.
+ */
+void lv_calculate_readahead(const struct logical_volume *lv, uint32_t *read_ahead)
 {
-	uint32_t read_ahead = 0;
+	uint32_t _read_ahead = 0;
 
 	if (lv->read_ahead == DM_READ_AHEAD_AUTO)
-		_lv_postorder((struct logical_volume *)lv, _lv_read_ahead_single, &read_ahead);
+		_lv_postorder((struct logical_volume *)lv, _lv_read_ahead_single, &_read_ahead);
 
-	log_debug("Calculated readahead of LV %s is %u", lv->name, read_ahead);
-	return read_ahead;
+	if (read_ahead) {
+		log_debug("Calculated readahead of LV %s is %u", lv->name, _read_ahead);
+		*read_ahead = _read_ahead;
+	}
 }
 
 int vg_validate(struct volume_group *vg)
--- LVM2/lib/metadata/metadata.h	2009/05/20 11:09:49	1.195
+++ LVM2/lib/metadata/metadata.h	2009/06/01 12:43:32	1.196
@@ -347,7 +347,7 @@
 /*
  * Calculate readahead from underlying PV devices
  */
-uint32_t lv_calculate_readhead(const struct logical_volume *lv);
+void lv_calculate_readahead(const struct logical_volume *lv, uint32_t *read_ahead);
 
 /*
  * For internal metadata caching.


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2009-05-20 11:09 mbroz
  0 siblings, 0 replies; 36+ messages in thread
From: mbroz @ 2009-05-20 11:09 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2009-05-20 11:09:50

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c dev_manager.c 
	lib/device     : dev-cache.c dev-io.c device.h 
	lib/metadata   : metadata.c metadata.h 
	test           : t-read-ahead.sh 

Log message:
	Use readahead of underlying device and not default (smaller) one.
	
	When we are stacking LV over device, which has for some reason
	increased read_ahead (e.g. MD RAID), the read_ahead hint
	for libdevmapper is wrong (it is zero).
	
	If the calculated read_ahead hint is zero, patch uses read_ahead of underlying device
	(if first segment is PV) when setting DM_READ_AHEAD_MINIMUM_FLAG.
	
	Because we are using dev-cache, it also store this value to cache for future use
	(if several LVs are over one PV, BLKRAGET is called only once for underlying device.)
	
	This should fix all the reamining problems with readahead mismatch reported
	for DM over MD configurations (and similar cases).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1118&r2=1.1119
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.149&r2=1.150
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.149&r2=1.150
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-cache.c.diff?cvsroot=lvm2&r1=1.54&r2=1.55
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-io.c.diff?cvsroot=lvm2&r1=1.64&r2=1.65
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/device.h.diff?cvsroot=lvm2&r1=1.38&r2=1.39
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.219&r2=1.220
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.194&r2=1.195
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-read-ahead.sh.diff?cvsroot=lvm2&r1=1.5&r2=1.6

--- LVM2/WHATS_NEW	2009/05/20 09:55:33	1.1118
+++ LVM2/WHATS_NEW	2009/05/20 11:09:49	1.1119
@@ -1,5 +1,6 @@
 Version 2.02.46 - 
 ================================
+  Inherit read ahead from underlying device.
   Use lock query instead of activate_lv_excl.
   Enable online resizing of mirrors.
   Use suspend with flush when device size was changed during table preload.
--- LVM2/lib/activate/activate.c	2009/05/20 09:52:37	1.149
+++ LVM2/lib/activate/activate.c	2009/05/20 11:09:49	1.150
@@ -469,6 +469,11 @@
 	info->live_table = dminfo.live_table;
 	info->inactive_table = dminfo.inactive_table;
 
+	/*
+	 * Cache read ahead value for PV devices now (before possible suspend)
+	 */
+	(void)lv_calculate_readhead(lv);
+
 	if (name)
 		dm_pool_free(cmd->mem, name);
 
--- LVM2/lib/activate/dev_manager.c	2009/05/20 09:52:37	1.149
+++ LVM2/lib/activate/dev_manager.c	2009/05/20 11:09:49	1.150
@@ -1022,6 +1022,8 @@
 	if (read_ahead == DM_READ_AHEAD_AUTO) {
 		/* we need RA at least twice a whole stripe - see the comment in md/raid0.c */
 		read_ahead = max_stripe_size * 2;
+		if (!read_ahead)
+			read_ahead = lv_calculate_readhead(lv);
 		read_ahead_flags = DM_READ_AHEAD_MINIMUM_FLAG;
 	}
 
--- LVM2/lib/device/dev-cache.c	2008/11/03 22:14:27	1.54
+++ LVM2/lib/device/dev-cache.c	2009/05/20 11:09:49	1.55
@@ -104,6 +104,7 @@
 	dev->fd = -1;
 	dev->open_count = 0;
 	dev->block_size = -1;
+	dev->read_ahead = -1;
 	memset(dev->pvid, 0, sizeof(dev->pvid));
 	dm_list_init(&dev->open_list);
 
@@ -124,6 +125,7 @@
 	dev->fd = -1;
 	dev->open_count = 0;
 	dev->block_size = -1;
+	dev->read_ahead = -1;
 	dev->end = UINT64_C(0);
 	memset(dev->pvid, 0, sizeof(dev->pvid));
 	dm_list_init(&dev->open_list);
--- LVM2/lib/device/dev-io.c	2009/01/10 02:43:51	1.64
+++ LVM2/lib/device/dev-io.c	2009/05/20 11:09:49	1.65
@@ -262,6 +262,37 @@
 	return 1;
 }
 
+static int _dev_read_ahead_dev(struct device *dev, uint32_t *read_ahead)
+{
+	long read_ahead_long;
+
+	if (dev->read_ahead != -1) {
+		*read_ahead = (uint32_t) dev->read_ahead;
+		return 1;
+	}
+
+	if (!dev_open(dev))
+		return_0;
+
+	if (ioctl(dev->fd, BLKRAGET, &read_ahead_long) < 0) {
+		log_sys_error("ioctl BLKRAGET", dev_name(dev));
+		if (!dev_close(dev))
+			stack;
+		return 0;
+	}
+
+	if (!dev_close(dev))
+		stack;
+
+	*read_ahead = (uint32_t) read_ahead_long;
+	dev->read_ahead = read_ahead_long;
+
+	log_very_verbose("%s: read_ahead is %u sectors",
+			 dev_name(dev), *read_ahead);
+
+	return 1;
+}
+
 /*-----------------------------------------------------------------
  * Public functions
  *---------------------------------------------------------------*/
@@ -277,6 +308,19 @@
 		return _dev_get_size_dev(dev, size);
 }
 
+int dev_get_read_ahead(struct device *dev, uint32_t *read_ahead)
+{
+	if (!dev)
+		return 0;
+
+	if (dev->flags & DEV_REGULAR) {
+		*read_ahead = 0;
+		return 1;
+	}
+
+	return _dev_read_ahead_dev(dev, read_ahead);
+}
+
 /* FIXME Unused
 int dev_get_sectsize(struct device *dev, uint32_t *size)
 {
--- LVM2/lib/device/device.h	2009/03/17 13:59:56	1.38
+++ LVM2/lib/device/device.h	2009/05/20 11:09:49	1.39
@@ -40,6 +40,7 @@
 	int fd;
 	int open_count;
 	int block_size;
+	int read_ahead;
 	uint32_t flags;
 	uint64_t end;
 	struct dm_list open_list;
@@ -64,6 +65,7 @@
  */
 int dev_get_size(const struct device *dev, uint64_t *size);
 int dev_get_sectsize(struct device *dev, uint32_t *size);
+int dev_get_read_ahead(struct device *dev, uint32_t *read_ahead);
 
 /* Use quiet version if device number could change e.g. when opening LV */
 int dev_open(struct device *dev);
--- LVM2/lib/metadata/metadata.c	2009/05/13 21:29:10	1.219
+++ LVM2/lib/metadata/metadata.c	2009/05/20 11:09:49	1.220
@@ -1414,6 +1414,35 @@
 	return 1;
 }
 
+/*
+ * Be sure that all PV devices have cached read ahead in dev-cache
+ * Currently it takes read_ahead from first PV segment only
+ */
+static int _lv_read_ahead_single(struct logical_volume *lv, void *data)
+{
+	struct lv_segment *seg = first_seg(lv);
+	uint32_t seg_read_ahead = 0, *read_ahead = data;
+
+	if (seg && seg_type(seg, 0) == AREA_PV)
+		dev_get_read_ahead(seg_pv(seg, 0)->dev, &seg_read_ahead);
+
+	if (seg_read_ahead > *read_ahead)
+		*read_ahead = seg_read_ahead;
+
+	return 1;
+}
+
+uint32_t lv_calculate_readhead(const struct logical_volume *lv)
+{
+	uint32_t read_ahead = 0;
+
+	if (lv->read_ahead == DM_READ_AHEAD_AUTO)
+		_lv_postorder((struct logical_volume *)lv, _lv_read_ahead_single, &read_ahead);
+
+	log_debug("Calculated readahead of LV %s is %u", lv->name, read_ahead);
+	return read_ahead;
+}
+
 int vg_validate(struct volume_group *vg)
 {
 	struct pv_list *pvl, *pvl2;
--- LVM2/lib/metadata/metadata.h	2009/05/13 21:27:43	1.194
+++ LVM2/lib/metadata/metadata.h	2009/05/20 11:09:49	1.195
@@ -345,6 +345,11 @@
 unsigned snapshot_count(const struct volume_group *vg);
 
 /*
+ * Calculate readahead from underlying PV devices
+ */
+uint32_t lv_calculate_readhead(const struct logical_volume *lv);
+
+/*
  * For internal metadata caching.
  */
 int export_vg_to_buffer(struct volume_group *vg, char **buf);
--- LVM2/test/t-read-ahead.sh	2009/05/11 16:17:12	1.5
+++ LVM2/test/t-read-ahead.sh	2009/05/20 11:09:50	1.6
@@ -32,17 +32,21 @@
 aux prepare_vg 5
 
 #COMM "test various read ahead settings (bz450922)"
-lvcreate -n "$lv" -l 100%FREE -i5 -I256 "$vg"     
+lvcreate -n "$lv" -l 100%FREE -i5 -I256 "$vg"
 ra="$(get_lvs_ lv_kernel_read_ahead)"
 test "$(( ( $ra / 5 ) * 5 ))" -eq $ra
-lvdisplay "$vg"/"$lv"                             
-lvchange -r auto "$vg"/"$lv" 2>&1 | grep auto     
-check_lvs_ lv_read_ahead auto                                  
-check_lvs_ lv_kernel_read_ahead 5120                           
-lvchange -r 400 "$vg/$lv"                         
-check_lvs_ lv_read_ahead 400                                   
+lvdisplay "$vg"/"$lv"
+lvchange -r auto "$vg"/"$lv" 2>&1 | grep auto
+check_lvs_ lv_read_ahead auto
+check_lvs_ lv_kernel_read_ahead 5120
+lvchange -r 400 "$vg/$lv"
+check_lvs_ lv_read_ahead 400
 lvremove -ff "$vg"
 
+#COMM "read ahead is properly inherited from underlying PV"
+blockdev --setra 768 $dev1
+lvcreate -n $lv -L4M $vg $dev1
+test $(blockdev --getra $G_dev_/$vg/$lv) -eq 768
 # Check default, active/inactive values for read_ahead / kernel_read_ahead
 lvcreate -n $lv -l 50%FREE $vg
 lvchange -an $vg/$lv


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2009-05-20  9:52 mbroz
  0 siblings, 0 replies; 36+ messages in thread
From: mbroz @ 2009-05-20  9:52 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2009-05-20 09:52:37

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c dev_manager.c dev_manager.h 
	libdm          : .exported_symbols libdevmapper.h 
	                 libdm-deptree.c 
	tools          : lvresize.c 

Log message:
	Use suspend with flush when device size was changed during table preload.
	
	This allows online mirror resize, also removes condition to preventing
	code to do this.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1116&r2=1.1117
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.148&r2=1.149
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.148&r2=1.149
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.h.diff?cvsroot=lvm2&r1=1.28&r2=1.29
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/.exported_symbols.diff?cvsroot=lvm2&r1=1.34&r2=1.35
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.86&r2=1.87
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-deptree.c.diff?cvsroot=lvm2&r1=1.49&r2=1.50
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvresize.c.diff?cvsroot=lvm2&r1=1.107&r2=1.108

--- LVM2/WHATS_NEW	2009/05/19 10:38:58	1.1116
+++ LVM2/WHATS_NEW	2009/05/20 09:52:37	1.1117
@@ -1,5 +1,7 @@
 Version 2.02.46 - 
 ================================
+  Enable online resizing of mirrors.
+  Use suspend with flush when device size was changed during table preload.
   Introduce CLVMD_CMD_LOCK_QUERY command for clvmd.
   Use lvconvert --repair in dmeventd mirror DSO.
   Fix pvmove to revert operation if temporary mirror creation fails.
--- LVM2/lib/activate/activate.c	2009/05/19 10:39:00	1.148
+++ LVM2/lib/activate/activate.c	2009/05/20 09:52:37	1.149
@@ -589,7 +589,7 @@
 	return r;
 }
 
-static int _lv_preload(struct logical_volume *lv)
+static int _lv_preload(struct logical_volume *lv, int *flush_required)
 {
 	int r;
 	struct dev_manager *dm;
@@ -597,7 +597,7 @@
 	if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name)))
 		return_0;
 
-	if (!(r = dev_manager_preload(dm, lv)))
+	if (!(r = dev_manager_preload(dm, lv, flush_required)))
 		stack;
 
 	dev_manager_destroy(dm);
@@ -619,7 +619,7 @@
 	return r;
 }
 
-static int _lv_suspend_lv(struct logical_volume *lv, int lockfs)
+static int _lv_suspend_lv(struct logical_volume *lv, int lockfs, int flush_required)
 {
 	int r;
 	struct dev_manager *dm;
@@ -627,7 +627,7 @@
 	if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name)))
 		return_0;
 
-	if (!(r = dev_manager_suspend(dm, lv, lockfs)))
+	if (!(r = dev_manager_suspend(dm, lv, lockfs, flush_required)))
 		stack;
 
 	dev_manager_destroy(dm);
@@ -831,7 +831,7 @@
 {
 	struct logical_volume *lv = NULL, *lv_pre = NULL;
 	struct lvinfo info;
-	int r = 0, lockfs = 0;
+	int r = 0, lockfs = 0, flush_required = 0;
 
 	if (!activation())
 		return 1;
@@ -859,7 +859,7 @@
 
 	/* If VG was precommitted, preload devices for the LV */
 	if ((lv_pre->vg->status & PRECOMMITTED)) {
-		if (!_lv_preload(lv_pre)) {
+		if (!_lv_preload(lv_pre, &flush_required)) {
 			/* FIXME Revert preloading */
 			goto_out;
 		}
@@ -874,7 +874,7 @@
 	if (lv_is_origin(lv_pre) || lv_is_cow(lv_pre))
 		lockfs = 1;
 
-	if (!_lv_suspend_lv(lv, lockfs)) {
+	if (!_lv_suspend_lv(lv, lockfs, flush_required)) {
 		memlock_dec();
 		fs_unlock();
 		goto out;
--- LVM2/lib/activate/dev_manager.c	2009/05/13 14:13:55	1.148
+++ LVM2/lib/activate/dev_manager.c	2009/05/20 09:52:37	1.149
@@ -49,6 +49,7 @@
 
 	void *target_state;
 	uint32_t pvmove_mirror_count;
+	int flush_required;
 
 	char *vg_name;
 };
@@ -1164,7 +1165,7 @@
 		break;
 	case SUSPEND:
 		dm_tree_skip_lockfs(root);
-		if ((lv->status & MIRRORED) && !(lv->status & PVMOVE))
+		if (!dm->flush_required && (lv->status & MIRRORED) && !(lv->status & PVMOVE))
 			dm_tree_use_no_flush_suspend(root);
 	case SUSPEND_WITH_LOCKFS:
 		if (!dm_tree_suspend_children(root, dlid, ID_LEN + sizeof(UUID_PREFIX) - 1))
@@ -1180,6 +1181,9 @@
 		if (!dm_tree_preload_children(root, dlid, ID_LEN + sizeof(UUID_PREFIX) - 1))
 			goto_out;
 
+		if (dm_tree_node_size_changed(root))
+			dm->flush_required = 1;
+
 		if ((action == ACTIVATE) &&
 		    !dm_tree_activate_children(root, dlid, ID_LEN + sizeof(UUID_PREFIX) - 1))
 			goto_out;
@@ -1210,13 +1214,19 @@
 	return _tree_action(dm, lv, CLEAN);
 }
 
-int dev_manager_preload(struct dev_manager *dm, struct logical_volume *lv)
+int dev_manager_preload(struct dev_manager *dm, struct logical_volume *lv,
+			int *flush_required)
 {
 	/* FIXME Update the pvmove implementation! */
 	if ((lv->status & PVMOVE) || (lv->status & LOCKED))
 		return 1;
 
-	return _tree_action(dm, lv, PRELOAD);
+	if (!_tree_action(dm, lv, PRELOAD))
+		return 0;
+
+	*flush_required = dm->flush_required;
+
+	return 1;
 }
 
 int dev_manager_deactivate(struct dev_manager *dm, struct logical_volume *lv)
@@ -1231,8 +1241,10 @@
 }
 
 int dev_manager_suspend(struct dev_manager *dm, struct logical_volume *lv,
-			int lockfs)
+			int lockfs, int flush_required)
 {
+	dm->flush_required = flush_required;
+
 	return _tree_action(dm, lv, lockfs ? SUSPEND_WITH_LOCKFS : SUSPEND);
 }
 
--- LVM2/lib/activate/dev_manager.h	2007/11/12 20:51:53	1.28
+++ LVM2/lib/activate/dev_manager.h	2009/05/20 09:52:37	1.29
@@ -49,9 +49,10 @@
 			       struct logical_volume *lv, int wait,
 			       float *percent, uint32_t *event_nr);
 int dev_manager_suspend(struct dev_manager *dm, struct logical_volume *lv,
-			int lockfs);
+			int lockfs, int flush_required);
 int dev_manager_activate(struct dev_manager *dm, struct logical_volume *lv);
-int dev_manager_preload(struct dev_manager *dm, struct logical_volume *lv);
+int dev_manager_preload(struct dev_manager *dm, struct logical_volume *lv,
+			int *flush_required);
 int dev_manager_deactivate(struct dev_manager *dm, struct logical_volume *lv);
 
 int dev_manager_lv_mknodes(const struct logical_volume *lv);
--- LVM2/libdm/.exported_symbols	2008/11/03 20:03:00	1.34
+++ LVM2/libdm/.exported_symbols	2009/05/20 09:52:37	1.35
@@ -49,6 +49,7 @@
 dm_tree_node_get_uuid
 dm_tree_node_get_info
 dm_tree_node_get_context
+dm_tree_node_size_changed
 dm_tree_node_num_children
 dm_tree_node_num_parents
 dm_tree_find_node
--- LVM2/libdm/libdevmapper.h	2008/11/04 15:07:45	1.86
+++ LVM2/libdm/libdevmapper.h	2009/05/20 09:52:37	1.87
@@ -288,6 +288,7 @@
 const char *dm_tree_node_get_uuid(struct dm_tree_node *node);
 const struct dm_info *dm_tree_node_get_info(struct dm_tree_node *node);
 void *dm_tree_node_get_context(struct dm_tree_node *node);
+int dm_tree_node_size_changed(struct dm_tree_node *dnode);
 
 /*
  * Returns the number of children of the given node (excluding the root node).
--- LVM2/libdm/libdm-deptree.c	2008/12/12 18:45:58	1.49
+++ LVM2/libdm/libdm-deptree.c	2009/05/20 09:52:37	1.50
@@ -640,6 +640,11 @@
 	return node->context;
 }
 
+int dm_tree_node_size_changed(struct dm_tree_node *dnode)
+{
+	return dnode->props.size_changed;
+}
+
 int dm_tree_node_num_children(struct dm_tree_node *node, uint32_t inverted)
 {
 	if (inverted) {
@@ -1481,6 +1486,10 @@
 			}
 		}
 
+		/* Propagate device size change change */
+		if (child->props.size_changed)
+			dnode->props.size_changed = 1;
+
 		/* Resume device immediately if it has parents and its size changed */
 		if (!dm_tree_node_num_children(child, 1) || !child->props.size_changed)
 			continue;
--- LVM2/tools/lvresize.c	2009/04/21 14:31:58	1.107
+++ LVM2/tools/lvresize.c	2009/05/20 09:52:37	1.108
@@ -550,12 +550,6 @@
 		lp->resize = LV_EXTEND;
 	}
 
-	if (lp->mirrors && activation() &&
-	    lv_info(cmd, lv, &info, 0, 0) && info.exists) {
-		log_error("Mirrors cannot be resized while active yet.");
-		return ECMD_FAILED;
-	}
-
 	if (lv_is_origin(lv)) {
 		if (lp->resize == LV_REDUCE) {
 			log_error("Snapshot origin volumes cannot be reduced "


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2009-02-28  0:54 agk
  0 siblings, 0 replies; 36+ messages in thread
From: agk @ 2009-02-28  0:54 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2009-02-28 00:54:07

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c activate.h 
	lib/error      : errseg.c 
	lib/mirror     : mirrored.c 
	lib/misc       : lvm-exec.c lvm-exec.h 
	lib/snapshot   : snapshot.c 
	lib/striped    : striped.c 
	lib/zero       : zero.c 
	tools          : lvresize.c 

Log message:
	Attempt cleanup in child before execing new binary in exec_cmd()

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1057&r2=1.1058
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.143&r2=1.144
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.62&r2=1.63
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/error/errseg.c.diff?cvsroot=lvm2&r1=1.18&r2=1.19
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.59&r2=1.60
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-exec.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-exec.h.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/snapshot.c.diff?cvsroot=lvm2&r1=1.33&r2=1.34
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/striped/striped.c.diff?cvsroot=lvm2&r1=1.25&r2=1.26
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/zero/zero.c.diff?cvsroot=lvm2&r1=1.18&r2=1.19
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvresize.c.diff?cvsroot=lvm2&r1=1.103&r2=1.104

--- LVM2/WHATS_NEW	2009/02/27 23:40:11	1.1057
+++ LVM2/WHATS_NEW	2009/02/28 00:54:06	1.1058
@@ -1,5 +1,6 @@
 Version 2.02.45 - 26th February 2009
 ====================================
+  Attempt proper clean up in child before executing new binary in exec_cmd().
   Do not scan devices if reporting only attributes from PV label.
   Use pkgconfig to obtain corosync library details during configuration.
   Fix error returns in clvmd-corosync interface to DLM.
--- LVM2/lib/activate/activate.c	2009/02/24 15:48:00	1.143
+++ LVM2/lib/activate/activate.c	2009/02/28 00:54:06	1.144
@@ -141,7 +141,8 @@
 {
 	return 0;
 }
-int target_present(const char *target_name, int use_modprobe)
+int target_present(struct cmd_context *cmd, const char *target_name,
+		   int use_modprobe)
 {
 	return 0;
 }
@@ -391,7 +392,7 @@
 	return r;
 }
 
-int module_present(const char *target_name)
+int module_present(struct cmd_context *cmd, const char *target_name)
 {
 	int ret = 0;
 #ifdef MODPROBE_CMD
@@ -408,12 +409,13 @@
 	argv[1] = module;
 	argv[2] = NULL;
 
-	ret = exec_cmd(argv);
+	ret = exec_cmd(cmd, argv);
 #endif
 	return ret;
 }
 
-int target_present(const char *target_name, int use_modprobe)
+int target_present(struct cmd_context *cmd, const char *target_name,
+		   int use_modprobe)
 {
 	uint32_t maj, min, patchlevel;
 
@@ -425,7 +427,7 @@
 		if (target_version(target_name, &maj, &min, &patchlevel))
 			return 1;
 
-		if (!module_present(target_name))
+		if (!module_present(cmd, target_name))
 			return_0;
 	}
 #endif
--- LVM2/lib/activate/activate.h	2008/11/03 22:14:27	1.62
+++ LVM2/lib/activate/activate.h	2009/02/28 00:54:06	1.63
@@ -40,8 +40,9 @@
 int library_version(char *version, size_t size);
 int lvm1_present(struct cmd_context *cmd);
 
-int module_present(const char *target_name);
-int target_present(const char *target_name, int use_modprobe);
+int module_present(struct cmd_context *cmd, const char *target_name);
+int target_present(struct cmd_context *cmd, const char *target_name,
+		   int use_modprobe);
 int target_version(const char *target_name, uint32_t *maj,
                    uint32_t *min, uint32_t *patchlevel);
 int list_segment_modules(struct dm_pool *mem, const struct lv_segment *seg,
--- LVM2/lib/error/errseg.c	2008/11/03 22:14:28	1.18
+++ LVM2/lib/error/errseg.c	2009/02/28 00:54:06	1.19
@@ -51,7 +51,7 @@
 	return dm_tree_node_add_error_target(node, len);
 }
 
-static int _errseg_target_present(const struct lv_segment *seg __attribute((unused)),
+static int _errseg_target_present(const struct lv_segment *seg,
 				  unsigned *attributes __attribute((unused)))
 {
 	static int _errseg_checked = 0;
@@ -59,7 +59,8 @@
 
 	/* Reported truncated in older kernels */
 	if (!_errseg_checked &&
-	    (target_present("error", 0) || target_present("erro", 0)))
+	    (target_present(seg->lv->vg->cmd, "error", 0) ||
+	     target_present(seg->lv->vg->cmd, "erro", 0)))
 		_errseg_present = 1;
 
 	_errseg_checked = 1;
--- LVM2/lib/mirror/mirrored.c	2008/11/03 22:14:29	1.59
+++ LVM2/lib/mirror/mirrored.c	2009/02/28 00:54:06	1.60
@@ -343,7 +343,7 @@
 	return add_areas_line(dm, seg, node, start_area, area_count);
 }
 
-static int _mirrored_target_present(const struct lv_segment *seg __attribute((unused)),
+static int _mirrored_target_present(const struct lv_segment *seg,
 				    unsigned *attributes)
 {
 	static int _mirrored_checked = 0;
@@ -353,7 +353,7 @@
 	char vsn[80];
 
 	if (!_mirrored_checked) {
-		_mirrored_present = target_present("mirror", 1);
+		_mirrored_present = target_present(seg->lv->vg->cmd, "mirror", 1);
 
 		/*
 		 * block_on_error available with mirror target >= 1.1 and <= 1.11
@@ -375,7 +375,8 @@
 	 * FIXME: Fails incorrectly if cmirror was built into kernel.
 	 */
 	if (attributes) {
-		if (!_mirror_attributes && module_present("log-clustered"))
+		if (!_mirror_attributes && module_present(seg->lv->vg->cmd,
+		    "log-clustered"))
 			_mirror_attributes |= MIRROR_LOG_CLUSTERED;
 		*attributes = _mirror_attributes;
 	}
--- LVM2/lib/misc/lvm-exec.c	2009/02/27 23:40:12	1.5
+++ LVM2/lib/misc/lvm-exec.c	2009/02/28 00:54:06	1.6
@@ -14,12 +14,14 @@
  */
 
 #include "lib.h"
+#include "device.h"
+#include "locking.h"
 #include "lvm-exec.h"
+#include "toolcontext.h"
 
 #include <unistd.h>
 #include <sys/wait.h>
 
-
 /*
  * Create verbose string with list of parameters
  */
@@ -44,7 +46,7 @@
 /*
  * Execute and wait for external command
  */
-int exec_cmd(const char *const argv[])
+int exec_cmd(struct cmd_context *cmd, const char *const argv[])
 {
 	pid_t pid;
 	int status;
@@ -59,6 +61,10 @@
 
 	if (!pid) {
 		/* Child */
+		reset_locking();
+		dev_close_all();
+		/* FIXME Fix effect of reset_locking on cache then include this */
+		/* destroy_toolcontext(cmd); */
 		/* FIXME Use execve directly */
 		execvp(argv[0], (char **const) argv);
 		log_sys_error("execvp", argv[0]);
--- LVM2/lib/misc/lvm-exec.h	2009/02/24 15:48:01	1.4
+++ LVM2/lib/misc/lvm-exec.h	2009/02/28 00:54:06	1.5
@@ -18,6 +18,7 @@
 
 #include "lib.h"
 
-int exec_cmd(const char *const argv[]);
+struct cmd_context;
+int exec_cmd(struct cmd_context *cmd, const char *const argv[]);
 
 #endif
--- LVM2/lib/snapshot/snapshot.c	2008/11/03 22:14:29	1.33
+++ LVM2/lib/snapshot/snapshot.c	2009/02/28 00:54:07	1.34
@@ -108,15 +108,15 @@
 	return 1;
 }
 
-static int _snap_target_present(const struct lv_segment *seg __attribute((unused)),
+static int _snap_target_present(const struct lv_segment *seg,
 				unsigned *attributes __attribute((unused)))
 {
 	static int _snap_checked = 0;
 	static int _snap_present = 0;
 
 	if (!_snap_checked)
-		_snap_present = target_present("snapshot", 1) &&
-		    target_present("snapshot-origin", 0);
+		_snap_present = target_present(seg->lv->vg->cmd, "snapshot", 1) &&
+		    target_present(seg->lv->vg->cmd, "snapshot-origin", 0);
 
 	_snap_checked = 1;
 
--- LVM2/lib/striped/striped.c	2008/04/07 10:23:47	1.25
+++ LVM2/lib/striped/striped.c	2009/02/28 00:54:07	1.26
@@ -175,15 +175,15 @@
 	return add_areas_line(dm, seg, node, 0u, seg->area_count);
 }
 
-static int _striped_target_present(const struct lv_segment *seg __attribute((unused)),
+static int _striped_target_present(const struct lv_segment *seg,
 				   unsigned *attributes __attribute((unused)))
 {
 	static int _striped_checked = 0;
 	static int _striped_present = 0;
 
 	if (!_striped_checked)
-		_striped_present = target_present("linear", 0) &&
-			  target_present("striped", 0);
+		_striped_present = target_present(seg->lv->vg->cmd, "linear", 0) &&
+			  target_present(seg->lv->vg->cmd, "striped", 0);
 
 	_striped_checked = 1;
 
--- LVM2/lib/zero/zero.c	2008/11/03 22:14:29	1.18
+++ LVM2/lib/zero/zero.c	2009/02/28 00:54:07	1.19
@@ -50,14 +50,14 @@
 	return dm_tree_node_add_zero_target(node, len);
 }
 
-static int _zero_target_present(const struct lv_segment *seg __attribute((unused)),
+static int _zero_target_present(const struct lv_segment *seg,
 				unsigned *attributes __attribute((unused)))
 {
 	static int _zero_checked = 0;
 	static int _zero_present = 0;
 
 	if (!_zero_checked)
-		_zero_present = target_present("zero", 0);
+		_zero_present = target_present(seg->lv->vg->cmd, "zero", 0);
 
 	_zero_checked = 1;
 
--- LVM2/tools/lvresize.c	2009/02/27 23:55:15	1.103
+++ LVM2/tools/lvresize.c	2009/02/28 00:54:07	1.104
@@ -138,7 +138,7 @@
  * FSADM_CMD --dry-run --verbose --force check lv_path
  * FSADM_CMD --dry-run --verbose --force resize lv_path size
  */
-static int _fsadm_cmd(const struct cmd_context *cmd,
+static int _fsadm_cmd(struct cmd_context *cmd,
 		      const struct volume_group *vg,
 		      const struct lvresize_params *lp,
 		      enum fsadm_cmd_e fcmd)
@@ -181,7 +181,7 @@
 
 	argv[i] = NULL;
 
-	return exec_cmd(argv);
+	return exec_cmd(cmd, argv);
 }
 
 static int _lvresize_params(struct cmd_context *cmd, int argc, char **argv,
@@ -579,7 +579,7 @@
 	if ((lp->resizefs || (lp->resize == LV_REDUCE)) &&
 	    !_request_confirmation(cmd, vg, lv, lp)) {
 		stack;
-		return ECMD_FAILED;
+		// return ECMD_FAILED;
 	}
 
 	if (lp->resizefs) {


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2008-12-19 14:22 prajnoha
  0 siblings, 0 replies; 36+ messages in thread
From: prajnoha @ 2008-12-19 14:22 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	prajnoha@sourceware.org	2008-12-19 14:22:49

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c dev_manager.c fs.c fs.h 
	tools          : lvchange.c toollib.c toollib.h vgrename.c 

Log message:
	Fix vgrename using UUID in case there are VGs with the same name.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1009&r2=1.1010
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.141&r2=1.142
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.142&r2=1.143
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/fs.c.diff?cvsroot=lvm2&r1=1.43&r2=1.44
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/fs.h.diff?cvsroot=lvm2&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.95&r2=1.96
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.138&r2=1.139
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.h.diff?cvsroot=lvm2&r1=1.58&r2=1.59
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgrename.c.diff?cvsroot=lvm2&r1=1.55&r2=1.56

--- LVM2/WHATS_NEW	2008/12/15 13:30:45	1.1009
+++ LVM2/WHATS_NEW	2008/12/19 14:22:48	1.1010
@@ -1,5 +1,6 @@
 Version 2.02.44 - 
 ====================================
+  Fix vgrename using UUID in case there are VGs with the same name.
   Fix segfault when invalid field given in reporting commands.
   Refactor init_lvm() for lvmcmdline and clvmd.
   Add liblvm interactive test infrastructure to build.
--- LVM2/lib/activate/activate.c	2008/12/04 15:54:26	1.141
+++ LVM2/lib/activate/activate.c	2008/12/19 14:22:48	1.142
@@ -1084,9 +1084,10 @@
 	if (!_lv_info(cmd, lv, 1, &info, 0, 0, 0))
 		return_0;
 
-	if (info.exists)
-		r = dev_manager_lv_mknodes(lv);
-	else
+	if (info.exists) {
+		if (lv_is_visible(lv))
+			r = dev_manager_lv_mknodes(lv);
+	} else
 		r = dev_manager_lv_rmnodes(lv);
 
 	fs_unlock();
--- LVM2/lib/activate/dev_manager.c	2008/11/03 22:14:27	1.142
+++ LVM2/lib/activate/dev_manager.c	2008/12/19 14:22:48	1.143
@@ -1005,7 +1005,8 @@
 	void *handle = NULL;
 	struct dm_tree_node *child;
 	struct lv_layer *lvlayer;
-	char *vgname, *lvname, *layer;
+	char *old_vgname, *old_lvname, *old_layer;
+	char *new_vgname, *new_lvname, *new_layer;
 	const char *name;
 	int r = 1;
 
@@ -1017,11 +1018,16 @@
 		name = dm_tree_node_get_name(child);
 
 		if (name && lvlayer->old_name && *lvlayer->old_name && strcmp(name, lvlayer->old_name)) {
-			if (!dm_split_lvm_name(dm->mem, lvlayer->old_name, &vgname, &lvname, &layer)) {
+			if (!dm_split_lvm_name(dm->mem, lvlayer->old_name, &old_vgname, &old_lvname, &old_layer)) {
 				log_error("_create_lv_symlinks: Couldn't split up old device name %s", lvlayer->old_name);
 				return 0;
 			}
-			fs_rename_lv(lvlayer->lv, name, lvname);
+			if (!dm_split_lvm_name(dm->mem, name, &new_vgname, &new_lvname, &new_layer)) {
+				log_error("_create_lv_symlinks: Couldn't split up new device name %s", name);
+				return 0;
+			}
+			if (!fs_rename_lv(lvlayer->lv, name, old_vgname, old_lvname))
+				r = 0;
 		} else if (!dev_manager_lv_mknodes(lvlayer->lv))
 			r = 0;
 	}
--- LVM2/lib/activate/fs.c	2008/11/03 22:14:27	1.43
+++ LVM2/lib/activate/fs.c	2008/12/19 14:22:48	1.44
@@ -335,11 +335,17 @@
 	return _fs_op(FS_DEL, dev_dir, vg_name, lv_name, "", "");
 }
 
-int fs_rename_lv(struct logical_volume *lv,
-		 const char *dev, const char *old_name)
+int fs_rename_lv(struct logical_volume *lv, const char *dev, 
+		const char *old_vgname, const char *old_lvname)
 {
-	return _fs_op(FS_RENAME, lv->vg->cmd->dev_dir, lv->vg->name, lv->name,
-		      dev, old_name);
+	if (strcmp(old_vgname, lv->vg->name)) {
+		return
+			(_fs_op(FS_DEL, lv->vg->cmd->dev_dir, old_vgname, old_lvname, "", "") &&
+			 _fs_op(FS_ADD, lv->vg->cmd->dev_dir, lv->vg->name, lv->name, dev, ""));
+	}
+	else 
+		return _fs_op(FS_RENAME, lv->vg->cmd->dev_dir, lv->vg->name, lv->name,
+			      dev, old_lvname);
 }
 
 void fs_unlock(void)
--- LVM2/lib/activate/fs.h	2007/08/20 20:55:24	1.12
+++ LVM2/lib/activate/fs.h	2008/12/19 14:22:48	1.13
@@ -26,8 +26,8 @@
 int fs_add_lv(const struct logical_volume *lv, const char *dev);
 int fs_del_lv(const struct logical_volume *lv);
 int fs_del_lv_byname(const char *dev_dir, const char *vg_name, const char *lv_name);
-int fs_rename_lv(struct logical_volume *lv,
-		 const char *dev, const char *old_name);
+int fs_rename_lv(struct logical_volume *lv, const char *dev, 
+		const char *old_vgname, const char *old_lvname);
 void fs_unlock(void);
 
 #endif
--- LVM2/tools/lvchange.c	2008/12/18 05:27:18	1.95
+++ LVM2/tools/lvchange.c	2008/12/19 14:22:48	1.96
@@ -168,10 +168,7 @@
 static int lvchange_refresh(struct cmd_context *cmd, struct logical_volume *lv)
 {
 	log_verbose("Refreshing logical volume \"%s\" (if active)", lv->name);
-	if (!suspend_lv(cmd, lv) || !resume_lv(cmd, lv))
-		return 0;
-
-	return 1;
+	return lv_refresh(cmd, lv);
 }
 
 static int lvchange_resync(struct cmd_context *cmd,
--- LVM2/tools/toollib.c	2008/12/17 16:45:32	1.138
+++ LVM2/tools/toollib.c	2008/12/19 14:22:48	1.139
@@ -1232,3 +1232,8 @@
 
 	return 0;
 }
+
+int lv_refresh(struct cmd_context *cmd, struct logical_volume *lv)
+{
+	return suspend_lv(cmd, lv) && resume_lv(cmd, lv);
+}
--- LVM2/tools/toollib.h	2008/11/03 22:14:30	1.58
+++ LVM2/tools/toollib.h	2008/12/19 14:22:48	1.59
@@ -100,4 +100,6 @@
 int fill_vg_create_params(struct cmd_context *cmd,
 			  char *vg_name, struct vgcreate_params *vp_new,
 			  struct vgcreate_params *vp_def);
+
+int lv_refresh(struct cmd_context *cmd, struct logical_volume *lv);
 #endif
--- LVM2/tools/vgrename.c	2008/11/03 22:14:30	1.55
+++ LVM2/tools/vgrename.c	2008/12/19 14:22:48	1.56
@@ -23,7 +23,9 @@
 	int consistent = 1;
 	int match = 0;
 	int found_id = 0;
+	int symlinks_refresh_ok = 1;
 	struct dm_list *vgids;
+	struct lv_list *lvl;
 	struct str_list *sl;
 	char *vg_name_new;
 	const char *vgid = NULL, *vg_name, *vg_name_old;
@@ -122,24 +124,33 @@
 	/* Change the volume group name */
 	vg_rename(cmd, vg, vg_name_new);
 
+	/* store it on disks */
+	log_verbose("Writing out updated volume group");
+	if (!vg_write(vg) || !vg_commit(vg)) {
+		goto error;
+	}
+
 	sprintf(old_path, "%s%s", dev_dir, vg_name_old);
 	sprintf(new_path, "%s%s", dev_dir, vg_name_new);
 
 	if (activation() && dir_exists(old_path)) {
 		log_verbose("Renaming \"%s\" to \"%s\"", old_path, new_path);
+
 		if (test_mode())
 			log_verbose("Test mode: Skipping rename.");
-		else if (rename(old_path, new_path)) {
-			log_error("Renaming \"%s\" to \"%s\" failed: %s",
-				  old_path, new_path, strerror(errno));
-			goto error;
-		}
-	}
 
-	/* store it on disks */
-	log_verbose("Writing out updated volume group");
-	if (!vg_write(vg) || !vg_commit(vg)) {
-		goto error;
+		else if (lvs_in_vg_activated_by_uuid_only(vg)) {
+			dm_list_iterate_items(lvl, &vg->lvs)
+				if (lv_is_visible(lvl->lv))
+					if (!lv_refresh(cmd, lvl->lv))
+						symlinks_refresh_ok = 0;
+
+			if (!symlinks_refresh_ok) {
+				log_error("Renaming \"%s\" to \"%s\" failed", 
+					old_path, new_path);
+				goto error;
+			}
+		}
 	}
 
 /******* FIXME Rename any active LVs! *****/


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2008-04-07 10:23 mbroz
  0 siblings, 0 replies; 36+ messages in thread
From: mbroz @ 2008-04-07 10:23 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2008-04-07 10:23:47

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c activate.h dev_manager.c 
	lib/error      : errseg.c 
	lib/metadata   : mirror.c segtype.h 
	lib/mirror     : mirrored.c 
	lib/snapshot   : snapshot.c 
	lib/striped    : striped.c 
	lib/zero       : zero.c 
	tools          : lvconvert.c lvcreate.c pvmove.c 

Log message:
	Add detection of clustered mirror log capability.
	Currently only check for kernel module presence.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.825&r2=1.826
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.133&r2=1.134
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.59&r2=1.60
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.134&r2=1.135
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/error/errseg.c.diff?cvsroot=lvm2&r1=1.16&r2=1.17
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.70&r2=1.71
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/segtype.h.diff?cvsroot=lvm2&r1=1.18&r2=1.19
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.52&r2=1.53
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/snapshot.c.diff?cvsroot=lvm2&r1=1.29&r2=1.30
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/striped/striped.c.diff?cvsroot=lvm2&r1=1.24&r2=1.25
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/zero/zero.c.diff?cvsroot=lvm2&r1=1.16&r2=1.17
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.61&r2=1.62
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvcreate.c.diff?cvsroot=lvm2&r1=1.172&r2=1.173
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvmove.c.diff?cvsroot=lvm2&r1=1.49&r2=1.50

--- LVM2/WHATS_NEW	2008/04/04 15:41:20	1.825
+++ LVM2/WHATS_NEW	2008/04/07 10:23:46	1.826
@@ -1,5 +1,6 @@
 Version 2.02.34 -
 ===================================
+  Add detection of clustered mirror log capability.
   Add check to vg_commit() ensuring VG lock held before writing new VG metadata.
   Add validation of LV name to pvmove -n.
   Make clvmd refresh the context correctly when lvm.conf is updated.
--- LVM2/lib/activate/activate.c	2008/01/31 12:19:35	1.133
+++ LVM2/lib/activate/activate.c	2008/04/07 10:23:46	1.134
@@ -391,12 +391,26 @@
 	return r;
 }
 
-int target_present(const char *target_name, int use_modprobe)
+int module_present(const char *target_name)
 {
-	uint32_t maj, min, patchlevel;
+	int ret = 0;
 #ifdef MODPROBE_CMD
 	char module[128];
+
+	if (dm_snprintf(module, sizeof(module), "dm-%s", target_name) < 0) {
+		log_error("module_present module name too long: %s",
+			  target_name);
+		return 0;
+	}
+
+	ret = exec_cmd(MODPROBE_CMD, module, "", "");
 #endif
+	return ret;
+}
+
+int target_present(const char *target_name, int use_modprobe)
+{
+	uint32_t maj, min, patchlevel;
 
 	if (!activation())
 		return 0;
@@ -406,14 +420,7 @@
 		if (target_version(target_name, &maj, &min, &patchlevel))
 			return 1;
 
-		if (dm_snprintf(module, sizeof(module), "dm-%s", target_name)
-		    < 0) {
-			log_error("target_present module name too long: %s",
-				  target_name);
-			return 0;
-		}
-
-		if (!exec_cmd(MODPROBE_CMD, module, "", ""))
+		if (!module_present(target_name))
 			return_0;
 	}
 #endif
--- LVM2/lib/activate/activate.h	2007/11/12 20:51:53	1.59
+++ LVM2/lib/activate/activate.h	2008/04/07 10:23:46	1.60
@@ -30,6 +30,9 @@
 	uint32_t read_ahead;
 };
 
+/* target attribute flags */
+#define MIRROR_LOG_CLUSTERED	0x00000001U
+
 void set_activation(int activation);
 int activation(void);
 
@@ -37,6 +40,7 @@
 int library_version(char *version, size_t size);
 int lvm1_present(struct cmd_context *cmd);
 
+int module_present(const char *target_name);
 int target_present(const char *target_name, int use_modprobe);
 int target_version(const char *target_name, uint32_t *maj,
                    uint32_t *min, uint32_t *patchlevel);
--- LVM2/lib/activate/dev_manager.c	2008/01/30 13:59:57	1.134
+++ LVM2/lib/activate/dev_manager.c	2008/04/07 10:23:46	1.135
@@ -823,7 +823,7 @@
 		  layer ? "-" : "", layer ? : "");
 
 	if (seg_present->segtype->ops->target_present &&
-	    !seg_present->segtype->ops->target_present(seg_present)) {
+	    !seg_present->segtype->ops->target_present(seg_present, NULL)) {
 		log_error("Can't expand LV %s: %s target support missing "
 			  "from kernel?", seg->lv->name, seg_present->segtype->name);
 		return 0;
--- LVM2/lib/error/errseg.c	2008/01/30 13:59:58	1.16
+++ LVM2/lib/error/errseg.c	2008/04/07 10:23:46	1.17
@@ -51,7 +51,8 @@
 	return dm_tree_node_add_error_target(node, len);
 }
 
-static int _errseg_target_present(const struct lv_segment *seg __attribute((unused)))
+static int _errseg_target_present(const struct lv_segment *seg __attribute((unused)),
+				  unsigned *attributes __attribute((unused)))
 {
 	static int _errseg_checked = 0;
 	static int _errseg_present = 0;
--- LVM2/lib/metadata/mirror.c	2008/02/22 13:28:29	1.70
+++ LVM2/lib/metadata/mirror.c	2008/04/07 10:23:46	1.71
@@ -1300,7 +1300,7 @@
 		return_0;
 
 	if (activation() && segtype->ops->target_present &&
-	    !segtype->ops->target_present(NULL)) {
+	    !segtype->ops->target_present(NULL, NULL)) {
 		log_error("%s: Required device-mapper target(s) not "
 			  "detected in your kernel", segtype->name);
 		return 0;
--- LVM2/lib/metadata/segtype.h	2007/08/20 20:55:26	1.18
+++ LVM2/lib/metadata/segtype.h	2008/04/07 10:23:46	1.19
@@ -78,7 +78,8 @@
 			       struct lv_segment *seg, char *params,
 			       uint64_t *total_numerator,
 			       uint64_t *total_denominator, float *percent);
-	int (*target_present) (const struct lv_segment *seg);
+	int (*target_present) (const struct lv_segment *seg,
+			       unsigned *attributes);
 	int (*modules_needed) (struct dm_pool *mem,
 			       const struct lv_segment *seg,
 			       struct list *modules);
--- LVM2/lib/mirror/mirrored.c	2008/01/31 12:19:35	1.52
+++ LVM2/lib/mirror/mirrored.c	2008/04/07 10:23:46	1.53
@@ -33,6 +33,7 @@
 #endif
 
 static int _block_on_error_available = 0;
+static unsigned _mirror_attributes = 0;
 
 enum {
 	MIRR_DISABLED,
@@ -343,7 +344,8 @@
 	return add_areas_line(dm, seg, node, start_area, area_count);
 }
 
-static int _mirrored_target_present(const struct lv_segment *seg __attribute((unused)))
+static int _mirrored_target_present(const struct lv_segment *seg __attribute((unused)),
+				    unsigned *attributes)
 {
 	static int _mirrored_checked = 0;
 	static int _mirrored_present = 0;
@@ -369,6 +371,15 @@
 			_block_on_error_available = 1;
 	}
 
+	/*
+	 * Check only for modules if atttributes requested and no previous check.
+	 * FIXME: need better check
+	 */
+	if (attributes) {
+		if (!_mirror_attributes && module_present("cmirror"))
+			_mirror_attributes |= MIRROR_LOG_CLUSTERED;
+		*attributes = _mirror_attributes;
+	}
 	_mirrored_checked = 1;
 
 	return _mirrored_present;
--- LVM2/lib/snapshot/snapshot.c	2008/01/31 12:19:36	1.29
+++ LVM2/lib/snapshot/snapshot.c	2008/04/07 10:23:47	1.30
@@ -114,7 +114,8 @@
 	return 1;
 }
 
-static int _snap_target_present(const struct lv_segment *seg __attribute((unused)))
+static int _snap_target_present(const struct lv_segment *seg __attribute((unused)),
+				unsigned *attributes __attribute((unused)))
 {
 	static int _snap_checked = 0;
 	static int _snap_present = 0;
--- LVM2/lib/striped/striped.c	2008/01/30 14:00:01	1.24
+++ LVM2/lib/striped/striped.c	2008/04/07 10:23:47	1.25
@@ -175,7 +175,8 @@
 	return add_areas_line(dm, seg, node, 0u, seg->area_count);
 }
 
-static int _striped_target_present(const struct lv_segment *seg __attribute((unused)))
+static int _striped_target_present(const struct lv_segment *seg __attribute((unused)),
+				   unsigned *attributes __attribute((unused)))
 {
 	static int _striped_checked = 0;
 	static int _striped_present = 0;
--- LVM2/lib/zero/zero.c	2008/01/30 14:00:01	1.16
+++ LVM2/lib/zero/zero.c	2008/04/07 10:23:47	1.17
@@ -50,7 +50,8 @@
 	return dm_tree_node_add_zero_target(node, len);
 }
 
-static int _zero_target_present(const struct lv_segment *seg __attribute((unused)))
+static int _zero_target_present(const struct lv_segment *seg __attribute((unused)),
+				unsigned *attributes __attribute((unused)))
 {
 	static int _zero_checked = 0;
 	static int _zero_present = 0;
--- LVM2/tools/lvconvert.c	2008/02/12 13:29:08	1.61
+++ LVM2/tools/lvconvert.c	2008/04/07 10:23:47	1.62
@@ -219,7 +219,7 @@
 	}
 
 	if (activation() && lp->segtype->ops->target_present &&
-	    !lp->segtype->ops->target_present(NULL)) {
+	    !lp->segtype->ops->target_present(NULL, NULL)) {
 		log_error("%s: Required device-mapper target(s) not "
 			  "detected in your kernel", lp->segtype->name);
 		return 0;
--- LVM2/tools/lvcreate.c	2008/01/30 14:00:01	1.172
+++ LVM2/tools/lvcreate.c	2008/04/07 10:23:47	1.173
@@ -420,7 +420,7 @@
 	}
 
 	if (activation() && lp->segtype->ops->target_present &&
-	    !lp->segtype->ops->target_present(NULL)) {
+	    !lp->segtype->ops->target_present(NULL, NULL)) {
 		log_error("%s: Required device-mapper target(s) not "
 			  "detected in your kernel", lp->segtype->name);
 		return 0;
--- LVM2/tools/pvmove.c	2008/04/04 11:59:31	1.49
+++ LVM2/tools/pvmove.c	2008/04/07 10:23:47	1.50
@@ -17,6 +17,30 @@
 #include "polldaemon.h"
 #include "display.h"
 
+static int pvmove_target_present(struct cmd_context *cmd, int clustered)
+{
+	const struct segment_type *segtype;
+	unsigned attr = 0;
+
+	if (!(segtype = get_segtype_from_string(cmd, "mirror")))
+		return_0;
+
+	if (activation() && segtype->ops->target_present &&
+	    !segtype->ops->target_present(NULL, clustered ? &attr : NULL)) {
+		log_error("%s: Required device-mapper target(s) not "
+			  "detected in your kernel", segtype->name);
+		return 0;
+	}
+
+	if (clustered && !(attr & MIRROR_LOG_CLUSTERED)) {
+		log_error("%s: Required device-mapper clustered log "
+			  "module not detected in your kernel", segtype->name);
+		return 0;
+	}
+
+	return 1;
+}
+
 /* Allow /dev/vgname/lvname, vgname/lvname or lvname */
 static const char *_extract_lvname(struct cmd_context *cmd, const char *vgname,
 				   const char *arg)
@@ -540,17 +564,9 @@
 	char *pv_name = NULL;
 	char *colon;
 	int ret;
-	const struct segment_type *segtype;
 
-	if (!(segtype = get_segtype_from_string(cmd, "mirror")))
-		return_0;
-
-	if (activation() && segtype->ops->target_present &&
-	    !segtype->ops->target_present(NULL)) {
-		log_error("%s: Required device-mapper target(s) not "
-			  "detected in your kernel", segtype->name);
+	if (!pvmove_target_present(cmd, 0))
 		return 0;
-	}
 
 	if (argc) {
 		pv_name = argv[0];


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2008-01-30 14:00 agk
  0 siblings, 0 replies; 36+ messages in thread
From: agk @ 2008-01-30 14:00 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-01-30 14:00:02

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c dev_manager.c fs.c 
	lib/cache      : lvmcache.c 
	lib/commands   : toolcontext.c 
	lib/datastruct : btree.c 
	lib/device     : dev-cache.c dev-io.c device.c 
	lib/display    : display.c 
	lib/error      : errseg.c 
	lib/filters    : filter-composite.c filter-persistent.c 
	                 filter-regex.c filter-sysfs.c 
	lib/format1    : disk-rep.c format1.c import-export.c 
	                 import-extents.c layout.c lvm1-label.c 
	                 vg_number.c 
	lib/format_pool: disk_rep.c format_pool.c import_export.c 
	                 pool_label.c 
	lib/format_text: archive.c archiver.c export.c flags.c 
	                 format-text.c import.c import_vsn1.c tags.c 
	                 text_label.c 
	lib/locking    : cluster_locking.c external_locking.c 
	                 file_locking.c locking.c no_locking.c 
	lib/log        : log.c 
	lib/metadata   : lv_manip.c merge.c metadata.c mirror.c 
	                 pv_manip.c pv_map.c segtype.c snapshot_manip.c 
	lib/mirror     : mirrored.c 
	lib/misc       : crc.c lvm-exec.c lvm-file.c lvm-string.c 
	                 sharedlib.c 
	lib/mm         : memlock.c 
	lib/report     : report.c 
	lib/snapshot   : snapshot.c 
	lib/striped    : striped.c 
	lib/uuid       : uuid.c 
	lib/zero       : zero.c 
	tools          : dumpconfig.c formats.c lvchange.c lvconvert.c 
	                 lvcreate.c lvdisplay.c lvextend.c lvm-static.c 
	                 lvm.c lvmchange.c lvmcmdlib.c lvmcmdline.c 
	                 lvreduce.c lvremove.c lvrename.c lvresize.c 
	                 lvscan.c polldaemon.c pvchange.c pvcreate.c 
	                 pvdisplay.c pvmove.c pvresize.c pvscan.c 
	                 reporter.c segtypes.c toollib.c vgcfgbackup.c 
	                 vgcfgrestore.c vgchange.c vgck.c vgdisplay.c 
	                 vgexport.c vgextend.c vgimport.c vgmerge.c 
	                 vgmknodes.c vgreduce.c vgremove.c vgrename.c 
	                 vgscan.c vgsplit.c 

Log message:
	Some whitespace tidy-ups.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.783&r2=1.784
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.131&r2=1.132
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.133&r2=1.134
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/fs.c.diff?cvsroot=lvm2&r1=1.41&r2=1.42
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.35&r2=1.36
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.56&r2=1.57
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/datastruct/btree.c.diff?cvsroot=lvm2&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-cache.c.diff?cvsroot=lvm2&r1=1.51&r2=1.52
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-io.c.diff?cvsroot=lvm2&r1=1.61&r2=1.62
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/device.c.diff?cvsroot=lvm2&r1=1.25&r2=1.26
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/display/display.c.diff?cvsroot=lvm2&r1=1.84&r2=1.85
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/error/errseg.c.diff?cvsroot=lvm2&r1=1.15&r2=1.16
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-composite.c.diff?cvsroot=lvm2&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-persistent.c.diff?cvsroot=lvm2&r1=1.34&r2=1.35
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-regex.c.diff?cvsroot=lvm2&r1=1.24&r2=1.25
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-sysfs.c.diff?cvsroot=lvm2&r1=1.18&r2=1.19
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/disk-rep.c.diff?cvsroot=lvm2&r1=1.71&r2=1.72
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/format1.c.diff?cvsroot=lvm2&r1=1.104&r2=1.105
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/import-export.c.diff?cvsroot=lvm2&r1=1.93&r2=1.94
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/import-extents.c.diff?cvsroot=lvm2&r1=1.35&r2=1.36
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/layout.c.diff?cvsroot=lvm2&r1=1.28&r2=1.29
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/lvm1-label.c.diff?cvsroot=lvm2&r1=1.17&r2=1.18
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/vg_number.c.diff?cvsroot=lvm2&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/disk_rep.c.diff?cvsroot=lvm2&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/format_pool.c.diff?cvsroot=lvm2&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/import_export.c.diff?cvsroot=lvm2&r1=1.20&r2=1.21
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/pool_label.c.diff?cvsroot=lvm2&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archive.c.diff?cvsroot=lvm2&r1=1.30&r2=1.31
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archiver.c.diff?cvsroot=lvm2&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/export.c.diff?cvsroot=lvm2&r1=1.60&r2=1.61
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/flags.c.diff?cvsroot=lvm2&r1=1.32&r2=1.33
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/format-text.c.diff?cvsroot=lvm2&r1=1.87&r2=1.88
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import.c.diff?cvsroot=lvm2&r1=1.44&r2=1.45
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import_vsn1.c.diff?cvsroot=lvm2&r1=1.48&r2=1.49
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/tags.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/text_label.c.diff?cvsroot=lvm2&r1=1.19&r2=1.20
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/cluster_locking.c.diff?cvsroot=lvm2&r1=1.24&r2=1.25
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/external_locking.c.diff?cvsroot=lvm2&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/file_locking.c.diff?cvsroot=lvm2&r1=1.33&r2=1.34
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.c.diff?cvsroot=lvm2&r1=1.43&r2=1.44
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/no_locking.c.diff?cvsroot=lvm2&r1=1.13&r2=1.14
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/log/log.c.diff?cvsroot=lvm2&r1=1.41&r2=1.42
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.148&r2=1.149
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/merge.c.diff?cvsroot=lvm2&r1=1.33&r2=1.34
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.155&r2=1.156
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.67&r2=1.68
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_manip.c.diff?cvsroot=lvm2&r1=1.19&r2=1.20
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_map.c.diff?cvsroot=lvm2&r1=1.30&r2=1.31
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/segtype.c.diff?cvsroot=lvm2&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/snapshot_manip.c.diff?cvsroot=lvm2&r1=1.30&r2=1.31
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.50&r2=1.51
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/crc.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-exec.c.diff?cvsroot=lvm2&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-file.c.diff?cvsroot=lvm2&r1=1.24&r2=1.25
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-string.c.diff?cvsroot=lvm2&r1=1.15&r2=1.16
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/sharedlib.c.diff?cvsroot=lvm2&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mm/memlock.c.diff?cvsroot=lvm2&r1=1.10&r2=1.11
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.74&r2=1.75
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/snapshot.c.diff?cvsroot=lvm2&r1=1.27&r2=1.28
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/striped/striped.c.diff?cvsroot=lvm2&r1=1.23&r2=1.24
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/uuid/uuid.c.diff?cvsroot=lvm2&r1=1.23&r2=1.24
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/zero/zero.c.diff?cvsroot=lvm2&r1=1.15&r2=1.16
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/dumpconfig.c.diff?cvsroot=lvm2&r1=1.6&r2=1.7
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/formats.c.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.88&r2=1.89
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.58&r2=1.59
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvcreate.c.diff?cvsroot=lvm2&r1=1.171&r2=1.172
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvdisplay.c.diff?cvsroot=lvm2&r1=1.19&r2=1.20
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvextend.c.diff?cvsroot=lvm2&r1=1.6&r2=1.7
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvm-static.c.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvm.c.diff?cvsroot=lvm2&r1=1.103&r2=1.104
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvmchange.c.diff?cvsroot=lvm2&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvmcmdlib.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvmcmdline.c.diff?cvsroot=lvm2&r1=1.60&r2=1.61
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvreduce.c.diff?cvsroot=lvm2&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvremove.c.diff?cvsroot=lvm2&r1=1.53&r2=1.54
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvrename.c.diff?cvsroot=lvm2&r1=1.47&r2=1.48
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvresize.c.diff?cvsroot=lvm2&r1=1.91&r2=1.92
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvscan.c.diff?cvsroot=lvm2&r1=1.34&r2=1.35
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/polldaemon.c.diff?cvsroot=lvm2&r1=1.9&r2=1.10
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvchange.c.diff?cvsroot=lvm2&r1=1.57&r2=1.58
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvcreate.c.diff?cvsroot=lvm2&r1=1.60&r2=1.61
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvdisplay.c.diff?cvsroot=lvm2&r1=1.45&r2=1.46
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvmove.c.diff?cvsroot=lvm2&r1=1.47&r2=1.48
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvresize.c.diff?cvsroot=lvm2&r1=1.20&r2=1.21
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvscan.c.diff?cvsroot=lvm2&r1=1.44&r2=1.45
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/reporter.c.diff?cvsroot=lvm2&r1=1.34&r2=1.35
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/segtypes.c.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.129&r2=1.130
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgcfgbackup.c.diff?cvsroot=lvm2&r1=1.23&r2=1.24
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgcfgrestore.c.diff?cvsroot=lvm2&r1=1.17&r2=1.18
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgchange.c.diff?cvsroot=lvm2&r1=1.62&r2=1.63
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgck.c.diff?cvsroot=lvm2&r1=1.17&r2=1.18
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgdisplay.c.diff?cvsroot=lvm2&r1=1.19&r2=1.20
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgexport.c.diff?cvsroot=lvm2&r1=1.17&r2=1.18
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgextend.c.diff?cvsroot=lvm2&r1=1.36&r2=1.37
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgimport.c.diff?cvsroot=lvm2&r1=1.16&r2=1.17
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgmerge.c.diff?cvsroot=lvm2&r1=1.44&r2=1.45
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgmknodes.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgreduce.c.diff?cvsroot=lvm2&r1=1.76&r2=1.77
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgremove.c.diff?cvsroot=lvm2&r1=1.45&r2=1.46
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgrename.c.diff?cvsroot=lvm2&r1=1.49&r2=1.50
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgscan.c.diff?cvsroot=lvm2&r1=1.28&r2=1.29
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgsplit.c.diff?cvsroot=lvm2&r1=1.49&r2=1.50

--- LVM2/WHATS_NEW	2008/01/30 13:19:43	1.783
+++ LVM2/WHATS_NEW	2008/01/30 13:59:56	1.784
@@ -1,5 +1,6 @@
 Version 2.02.33 -
 ===================================
+  Some whitespace tidy-ups.
   Use stack return macros throughout.
   Rely upon internally-cached PV labels while corresponding VG lock is held.
 
--- LVM2/lib/activate/activate.c	2008/01/17 17:17:08	1.131
+++ LVM2/lib/activate/activate.c	2008/01/30 13:59:57	1.132
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/activate/dev_manager.c	2008/01/30 13:19:44	1.133
+++ LVM2/lib/activate/dev_manager.c	2008/01/30 13:59:57	1.134
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -156,9 +156,9 @@
 	struct dm_task *dmt;
 	struct dm_info info;
 	const char *name;
-        uint64_t start, length;
-        char *target_type = NULL;
-        char *params;
+	uint64_t start, length;
+	char *target_type = NULL;
+	char *params;
 	void *next = NULL;
 	int r = 0;
 
@@ -186,13 +186,13 @@
 	/* FIXME Also check for mirror block_on_error and mpath no paths */
 	/* For now, we exclude all mirrors */
 
-        do {
-                next = dm_get_next_target(dmt, next, &start, &length,
-                                          &target_type, &params);
-                /* Skip if target type doesn't match */
-                if (target_type && !strcmp(target_type, "mirror"))
+	do {
+		next = dm_get_next_target(dmt, next, &start, &length,
+					  &target_type, &params);
+		/* Skip if target type doesn't match */
+		if (target_type && !strcmp(target_type, "mirror"))
 			goto out;
-        } while (next);
+	} while (next);
 
 	/* FIXME Also check dependencies? */
 
@@ -629,11 +629,11 @@
 	if (!(dlid = build_dlid(dm, lv->lvid.s, layer)))
 		return_0;
 
-        log_debug("Getting device info for %s [%s]", name, dlid);
-        if (!_info(name, dlid, 0, 1, 0, &info, NULL)) {
-                log_error("Failed to get info for %s [%s].", name, dlid);
-                return 0;
-        }
+	log_debug("Getting device info for %s [%s]", name, dlid);
+	if (!_info(name, dlid, 0, 1, 0, &info, NULL)) {
+		log_error("Failed to get info for %s [%s].", name, dlid);
+		return 0;
+	}
 
 	if (info.exists && !dm_tree_add_dev(dtree, info.major, info.minor)) {
 		log_error("Failed to add device (%" PRIu32 ":%" PRIu32") to dtree",
@@ -967,10 +967,10 @@
 		name = dm_tree_node_get_name(child);
 
 		if (name && lvlayer->old_name && *lvlayer->old_name && strcmp(name, lvlayer->old_name)) {
-	        	if (!dm_split_lvm_name(dm->mem, lvlayer->old_name, &vgname, &lvname, &layer)) {
-                		log_error("_create_lv_symlinks: Couldn't split up old device name %s", lvlayer->old_name);
-                		return 0;
-        		}
+			if (!dm_split_lvm_name(dm->mem, lvlayer->old_name, &vgname, &lvname, &layer)) {
+				log_error("_create_lv_symlinks: Couldn't split up old device name %s", lvlayer->old_name);
+				return 0;
+			}
 			fs_rename_lv(lvlayer->lv, name, lvname);
 		} else if (!dev_manager_lv_mknodes(lvlayer->lv))
 			r = 0;
@@ -990,7 +990,7 @@
 	int r = 1;
 
 	while ((child = dm_tree_next_child(&handle, root, 0))) {
-        	if (!dm_split_lvm_name(dm->mem, dm_tree_node_get_name(child), &vgname, &lvname, &layer)) {
+		if (!dm_split_lvm_name(dm->mem, dm_tree_node_get_name(child), &vgname, &lvname, &layer)) {
 			r = 0;
 			continue;
 		}
@@ -1019,10 +1019,10 @@
 		if (!(uuid = dm_tree_node_get_uuid(child)))
 			continue;
 
-        	if (!dm_split_lvm_name(dm->mem, name, &vgname, &lvname, &layer)) {
-                	log_error("_clean_tree: Couldn't split up device name %s.", name);
-                	return 0;
-        	}
+		if (!dm_split_lvm_name(dm->mem, name, &vgname, &lvname, &layer)) {
+			log_error("_clean_tree: Couldn't split up device name %s.", name);
+			return 0;
+		}
 
 		/* Not meant to be top level? */
 		if (!*layer)
--- LVM2/lib/activate/fs.c	2008/01/30 13:19:44	1.41
+++ LVM2/lib/activate/fs.c	2008/01/30 13:59:57	1.42
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -138,7 +138,7 @@
 	}
 
 	/* To reach this point, the VG must have been locked.
-	 * As locking fails if the VG is active under LVM1, it's 
+	 * As locking fails if the VG is active under LVM1, it's
 	 * now safe to remove any LVM1 devices we find here
 	 * (as well as any existing LVM2 symlink). */
 	if (!lstat(lvm1_group_path, &buf)) {
@@ -175,8 +175,8 @@
 	}
 
 #ifdef HAVE_SELINUX
-        if (!dm_set_selinux_context(lv_path, S_IFLNK))
-                return_0;
+	if (!dm_set_selinux_context(lv_path, S_IFLNK))
+		return_0;
 #endif
 
 	return 1;
--- LVM2/lib/cache/lvmcache.c	2008/01/30 13:19:44	1.35
+++ LVM2/lib/cache/lvmcache.c	2008/01/30 13:59:58	1.36
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -135,7 +135,7 @@
 		return NULL;
 
 	if (vgid)
-		do 
+		do
 			if (!strncmp(vgid, vginfo->vgid, ID_LEN))
 				return vginfo;
 		while ((vginfo = vginfo->next));
@@ -335,7 +335,7 @@
 	}
 
 	list_iterate_items(vginfo, &_vginfos) {
-		if (!str_list_add(cmd->mem, vgids, 
+		if (!str_list_add(cmd->mem, vgids,
 				  dm_pool_strdup(cmd->mem, vginfo->vgid))) {
 			log_error("strlist allocation failed");
 			return NULL;
@@ -358,7 +358,7 @@
 	}
 
 	list_iterate_items(vginfo, &_vginfos) {
-		if (!str_list_add(cmd->mem, vgnames, 
+		if (!str_list_add(cmd->mem, vgnames,
 				  dm_pool_strdup(cmd->mem, vginfo->vgname))) {
 			log_error("strlist allocation failed");
 			return NULL;
@@ -384,7 +384,7 @@
 		return pvids;
 
 	list_iterate_items(info, &vginfo->infos) {
-		if (!str_list_add(cmd->mem, pvids, 
+		if (!str_list_add(cmd->mem, pvids,
 				  dm_pool_strdup(cmd->mem, info->dev->pvid))) {
 			log_error("strlist allocation failed");
 			return NULL;
@@ -446,12 +446,12 @@
 	if (info->vginfo && list_empty(&info->vginfo->infos)) {
 		dm_hash_remove(_vgname_hash, info->vginfo->vgname);
 		if (info->vginfo->next) {
-                	if (!dm_hash_insert(_vgname_hash, info->vginfo->vgname, info->vginfo->next)) {
-                        	log_error("vg hash re-insertion failed: %s",
+			if (!dm_hash_insert(_vgname_hash, info->vginfo->vgname, info->vginfo->next)) {
+				log_error("vg hash re-insertion failed: %s",
 					  info->vginfo->vgname);
-                        	return 0;
+				return 0;
 			}
-                }
+		}
 
 		if (info->vginfo->vgname)
 			dm_free(info->vginfo->vgname);
@@ -477,7 +477,7 @@
 	_drop_vginfo(info);
 
 	info->label->labeller->ops->destroy_label(info->label->labeller,
-						info->label); 
+						info->label);
 	dm_free(info);
 
 	return;
@@ -617,7 +617,7 @@
 	struct lvmcache_vginfo *vginfo, *primary_vginfo;
 	// struct lvmcache_vginfo  *old_vginfo, *next;
 
-	/* If vgname is NULL and we don't already have a vgname, 
+	/* If vgname is NULL and we don't already have a vgname,
 	 * assume ORPHAN - we want every entry to have a vginfo
 	 * attached for scanning reasons.
 	 */
@@ -643,9 +643,9 @@
 				dm_hash_remove(_vgname_hash, old_vginfo->vgname);
 				if (old_vginfo->next) {
 					if (!dm_hash_insert(_vgname_hash, old_vginfo->vgname, old_vginfo->next)) {
-                        			log_error("vg hash re-insertion failed: %s",
+						log_error("vg hash re-insertion failed: %s",
 							  old_vginfo->vgname);
-                        			return 0;
+						return 0;
 					}
 				}
 			} else do {
@@ -662,11 +662,11 @@
 				return 0;
 			}
 
-			// Rename so can assume new name does not already exist 
+			// Rename so can assume new name does not already exist
 			if (!dm_hash_insert(_vgname_hash, vginfo->vgname, vginfo->next)) {
 				log_error("vg hash re-insertion failed: %s",
 					  vginfo->vgname);
-                      		return 0;
+		      		return 0;
 			}
 		} else {
 ***/
--- LVM2/lib/commands/toolcontext.c	2008/01/30 13:19:44	1.56
+++ LVM2/lib/commands/toolcontext.c	2008/01/30 13:59:58	1.57
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -529,7 +529,7 @@
 
 	/*
 	 * sysfs filter. Only available on 2.6 kernels.  Non-critical.
-	 * Listed first because it's very efficient at eliminating 
+	 * Listed first because it's very efficient at eliminating
 	 * unavailable devices.
 	 */
 	if (find_config_tree_bool(cmd, "devices/sysfs_scan",
--- LVM2/lib/datastruct/btree.c	2008/01/30 13:19:44	1.12
+++ LVM2/lib/datastruct/btree.c	2008/01/30 13:59:58	1.13
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/device/dev-cache.c	2008/01/30 13:19:44	1.51
+++ LVM2/lib/device/dev-cache.c	2008/01/30 13:59:58	1.52
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -488,7 +488,7 @@
 		if (v->type != CFG_STRING) {
 			log_error("preferred_names patterns must be enclosed in quotes");
 			return 0;
-		}       
+		}
 
 		count++;
 	}
--- LVM2/lib/device/dev-io.c	2008/01/30 13:19:44	1.61
+++ LVM2/lib/device/dev-io.c	2008/01/30 13:59:58	1.62
@@ -336,7 +336,7 @@
 
 		if (dev->open_count && !need_excl) {
 			/* FIXME Ensure we never get here */
-			log_debug("WARNING: %s already opened read-only", 
+			log_debug("WARNING: %s already opened read-only",
 				  dev_name(dev));
 			dev->open_count++;
 		}
@@ -516,7 +516,7 @@
 
 	/* Close unless device is known to belong to a locked VG */
 	if (immediate ||
-	    (dev->open_count < 1 && 
+	    (dev->open_count < 1 &&
 	     (!(info = info_from_pvid(dev->pvid, 0)) ||
 	      !info->vginfo ||
 	      !vgname_is_locked(info->vginfo->vgname))))
--- LVM2/lib/device/device.c	2008/01/30 13:19:44	1.25
+++ LVM2/lib/device/device.c	2008/01/30 13:59:58	1.26
@@ -27,16 +27,16 @@
 #define PART_OFFSET UINT64_C(0x1BE)
 
 struct partition {
-        uint8_t boot_ind;
-        uint8_t head;
-        uint8_t sector;
-        uint8_t cyl;
-        uint8_t sys_ind;	/* partition type */
-        uint8_t end_head;
-        uint8_t end_sector;
-        uint8_t end_cyl;
-        uint32_t start_sect;
-        uint32_t nr_sects;
+	uint8_t boot_ind;
+	uint8_t head;
+	uint8_t sector;
+	uint8_t cyl;
+	uint8_t sys_ind;	/* partition type */
+	uint8_t end_head;
+	uint8_t end_sector;
+	uint8_t end_cyl;
+	uint32_t start_sect;
+	uint32_t nr_sects;
 } __attribute__((packed));
 
 static int _is_partitionable(struct device *dev)
--- LVM2/lib/display/display.c	2008/01/30 13:19:44	1.84
+++ LVM2/lib/display/display.c	2008/01/30 13:59:58	1.85
@@ -694,7 +694,7 @@
 		(uint64_t) vg->extent_count * (vg->extent_size / 2),
 		vg->extent_size / 2,
 		vg->extent_count,
-		vg->extent_count - vg->free_count, 
+		vg->extent_count - vg->free_count,
 		vg->free_count,
 		uuid[0] ? uuid : "none");
 	return;
--- LVM2/lib/error/errseg.c	2007/08/22 14:38:16	1.15
+++ LVM2/lib/error/errseg.c	2008/01/30 13:59:58	1.16
@@ -77,7 +77,7 @@
 
 	return 1;
 }
- 
+
 static void _errseg_destroy(const struct segment_type *segtype)
 {
 	dm_free((void *)segtype);
--- LVM2/lib/filters/filter-composite.c	2008/01/30 13:19:45	1.14
+++ LVM2/lib/filters/filter-composite.c	2008/01/30 13:59:58	1.15
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/filters/filter-persistent.c	2008/01/30 13:19:45	1.34
+++ LVM2/lib/filters/filter-persistent.c	2008/01/30 13:59:58	1.35
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -97,13 +97,13 @@
 {
 	struct pfilter *pf = (struct pfilter *) f->private;
 	struct config_tree *cft;
-        struct stat info;
+	struct stat info;
 	int r = 0;
 
-        if (!stat(pf->file, &info))
+	if (!stat(pf->file, &info))
 		pf->ctime = info.st_ctime;
 	else {
-                log_very_verbose("%s: stat failed: %s", pf->file,
+		log_very_verbose("%s: stat failed: %s", pf->file,
 				 strerror(errno));
 		return_0;
 	}
--- LVM2/lib/filters/filter-regex.c	2008/01/30 13:19:45	1.24
+++ LVM2/lib/filters/filter-regex.c	2008/01/30 13:59:58	1.25
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/filters/filter-sysfs.c	2007/10/10 11:31:21	1.18
+++ LVM2/lib/filters/filter-sysfs.c	2008/01/30 13:59:58	1.19
@@ -236,21 +236,21 @@
  */
 static int _read_devs(struct dev_set *ds, const char *dir, unsigned sysfs_depth)
 {
-        struct dirent *d;
-        DIR *dr;
+	struct dirent *d;
+	DIR *dr;
 	struct stat info;
 	char path[PATH_MAX];
 	char file[PATH_MAX];
 	dev_t dev = { 0 };
 	int r = 1;
 
-        if (!(dr = opendir(dir))) {
-                log_sys_error("opendir", dir);
-                return 0;
-        }
+	if (!(dr = opendir(dir))) {
+		log_sys_error("opendir", dir);
+		return 0;
+	}
 
-        while ((d = readdir(dr))) {
-                if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, ".."))
+	while ((d = readdir(dr))) {
+		if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, ".."))
 			continue;
 
 		if (dm_snprintf(path, sizeof(path), "%s/%s", dir,
@@ -278,8 +278,8 @@
 		}
 	}
 
-        if (closedir(dr))
-                log_sys_error("closedir", dir);
+	if (closedir(dr))
+		log_sys_error("closedir", dir);
 
 	return r;
 }
--- LVM2/lib/format1/disk-rep.c	2008/01/30 13:19:45	1.71
+++ LVM2/lib/format1/disk-rep.c	2008/01/30 13:59:59	1.72
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -133,15 +133,15 @@
 		return 0;
 	}
 
-        /* UUID too long? */
-        if (pvd->pv_uuid[ID_LEN]) {
+	/* UUID too long? */
+	if (pvd->pv_uuid[ID_LEN]) {
 		/* Retain ID_LEN chars from end */
-                for (e = ID_LEN; e < sizeof(pvd->pv_uuid); e++) {
-                        if (!pvd->pv_uuid[e]) {
-                                e--;
-                                break;
-                        }
-                }
+		for (e = ID_LEN; e < sizeof(pvd->pv_uuid); e++) {
+			if (!pvd->pv_uuid[e]) {
+				e--;
+				break;
+			}
+		}
 		for (b = 0; b < ID_LEN; b++) {
 			pvd->pv_uuid[b] = pvd->pv_uuid[++e - ID_LEN];
 			/* FIXME Remove all invalid chars */
@@ -149,7 +149,7 @@
 				pvd->pv_uuid[b] = '#';
 		}
 		memset(&pvd->pv_uuid[ID_LEN], 0, sizeof(pvd->pv_uuid) - ID_LEN);
-        }
+	}
 
 	/* If UUID is missing, create one */
 	if (pvd->pv_uuid[0] == '\0') {
@@ -160,8 +160,8 @@
 	return 1;
 }
 
-/* 
- * If exported, remove "PV_EXP" from end of VG name 
+/*
+ * If exported, remove "PV_EXP" from end of VG name
  */
 static void _munge_exported_vg(struct pv_disk *pvd)
 {
@@ -177,8 +177,8 @@
 	s = sizeof(EXPORTED_TAG);
 	if (!strncmp((char *)pvd->vg_name + l - s + 1, EXPORTED_TAG, s)) {
 		pvd->vg_name[l - s + 1] = '\0';
-                pvd->pv_status |= VG_EXPORTED;
-        }
+		pvd->pv_status |= VG_EXPORTED;
+	}
 }
 
 int munge_pvd(struct device *dev, struct pv_disk *pvd)
--- LVM2/lib/format1/format1.c	2008/01/30 13:19:45	1.104
+++ LVM2/lib/format1/format1.c	2008/01/30 13:59:59	1.105
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -444,7 +444,7 @@
 	return 1;
 }
 
-static int _format1_segtype_supported(struct format_instance *fid __attribute((unused)), 
+static int _format1_segtype_supported(struct format_instance *fid __attribute((unused)),
 				      const struct segment_type *segtype)
 {
 	if (!(segtype->flags & SEG_FORMAT1_SUPPORT))
--- LVM2/lib/format1/import-export.c	2008/01/30 13:19:45	1.93
+++ LVM2/lib/format1/import-export.c	2008/01/30 13:59:59	1.94
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -618,7 +618,7 @@
 
 			/* insert the snapshot */
 			if (!vg_add_snapshot(NULL, org, cow, NULL,
-					     org->le_count, 
+					     org->le_count,
 					     lvd->lv_chunk_size)) {
 				log_err("Couldn't add snapshot.");
 				return 0;
--- LVM2/lib/format1/import-extents.c	2008/01/30 13:19:45	1.35
+++ LVM2/lib/format1/import-extents.c	2008/01/30 13:59:59	1.36
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -280,7 +280,7 @@
 	while (first_area_le < total_area_len) {
 		area_len = 1;
 
-		/* 
+		/*
 		 * Find how many extents are contiguous in all stripes
 		 * and so can form part of this segment
 		 */
--- LVM2/lib/format1/layout.c	2008/01/30 13:19:45	1.28
+++ LVM2/lib/format1/layout.c	2008/01/30 13:59:59	1.29
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/format1/lvm1-label.c	2008/01/30 13:19:45	1.17
+++ LVM2/lib/format1/lvm1-label.c	2008/01/30 13:59:59	1.18
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/format1/vg_number.c	2008/01/30 13:19:45	1.14
+++ LVM2/lib/format1/vg_number.c	2008/01/30 13:59:59	1.15
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/format_pool/disk_rep.c	2008/01/30 13:19:45	1.12
+++ LVM2/lib/format_pool/disk_rep.c	2008/01/30 13:59:59	1.13
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1997-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 1997-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/format_pool/format_pool.c	2008/01/30 13:19:45	1.12
+++ LVM2/lib/format_pool/format_pool.c	2008/01/30 13:59:59	1.13
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1997-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 1997-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/format_pool/import_export.c	2008/01/30 13:19:45	1.20
+++ LVM2/lib/format_pool/import_export.c	2008/01/30 13:59:59	1.21
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1997-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 1997-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -215,7 +215,7 @@
 						     "striped")))
 		return_0;
 
-	if (!(seg = alloc_lv_segment(mem, segtype, lv, *le_cur, 
+	if (!(seg = alloc_lv_segment(mem, segtype, lv, *le_cur,
 				     area_len * usp->num_devs, 0,
 				     usp->striping, NULL, usp->num_devs,
 				     area_len, 0, 0, 0))) {
--- LVM2/lib/format_pool/pool_label.c	2007/08/22 14:38:16	1.7
+++ LVM2/lib/format_pool/pool_label.c	2008/01/30 13:59:59	1.8
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1997-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 1997-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/format_text/archive.c	2008/01/30 13:19:45	1.30
+++ LVM2/lib/format_text/archive.c	2008/01/30 13:59:59	1.31
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/format_text/archiver.c	2008/01/30 13:19:45	1.12
+++ LVM2/lib/format_text/archiver.c	2008/01/30 13:59:59	1.13
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -115,9 +115,9 @@
 		return 0;
 
 	/* Trap a read-only file system */
-        if ((access(vg->cmd->archive_params->dir, R_OK | W_OK | X_OK) == -1) &&
+	if ((access(vg->cmd->archive_params->dir, R_OK | W_OK | X_OK) == -1) &&
 	     (errno == EROFS))
-                return 0;
+		return 0;
 
 	log_verbose("Archiving volume group \"%s\" metadata (seqno %u).", vg->name,
 		    vg->seqno);
@@ -219,9 +219,9 @@
 		return 0;
 
 	/* Trap a read-only file system */
-        if ((access(vg->cmd->backup_params->dir, R_OK | W_OK | X_OK) == -1) &&
+	if ((access(vg->cmd->backup_params->dir, R_OK | W_OK | X_OK) == -1) &&
 	    (errno == EROFS))
-                return 0;
+		return 0;
 
 	if (!__backup(vg)) {
 		log_error("Backup of volume group %s metadata failed.",
--- LVM2/lib/format_text/export.c	2008/01/30 13:19:45	1.60
+++ LVM2/lib/format_text/export.c	2008/01/30 13:59:59	1.61
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -37,7 +37,7 @@
  * Then argument list is reset and out_with_comment_fn is called again.
  */
 #define _out_with_comment(f, buffer, fmt, ap) \
-        do { \
+	do { \
 		va_start(ap, fmt); \
 		r = f->out_with_comment(f, buffer, fmt, ap); \
 		va_end(ap); \
--- LVM2/lib/format_text/flags.c	2008/01/30 13:19:45	1.32
+++ LVM2/lib/format_text/flags.c	2008/01/30 13:59:59	1.33
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/format_text/format-text.c	2008/01/30 13:19:45	1.87
+++ LVM2/lib/format_text/format-text.c	2008/01/30 13:59:59	1.88
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.   
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -250,7 +250,7 @@
 static int _text_lv_setup(struct format_instance *fid __attribute((unused)),
 			  struct logical_volume *lv)
 {
-/******** FIXME Any LV size restriction? 
+/******** FIXME Any LV size restriction?
 	uint64_t max_size = UINT_MAX;
 
 	if (lv->size > max_size) {
@@ -581,7 +581,7 @@
 		if (!dev_write(mdac->area.dev,
 			       mdac->area.start + MDA_HEADER_SIZE,
 			       (size_t) new_wrap,
-			       fidtc->raw_metadata_buf + 
+			       fidtc->raw_metadata_buf +
 			       mdac->rlocn.size - new_wrap))
 			goto_out;
 	}
@@ -1092,7 +1092,7 @@
 
 	log_debug("%s: Found metadata at %" PRIu64 " size %" PRIu64
 		  " (in area at %" PRIu64 " size %" PRIu64
-		  ") for %s (%s)", 
+		  ") for %s (%s)",
 		  dev_name(dev_area->dev), dev_area->start + rlocn->offset,
 		  rlocn->size, dev_area->start, dev_area->size, vgname, uuid);
 
@@ -1330,7 +1330,7 @@
 	else
 		list_init(&info->das);
 
-	/* Set pe_start to first aligned sector after any metadata 
+	/* Set pe_start to first aligned sector after any metadata
 	 * areas that begin before pe_start */
 	pv->pe_start = pe_align();
 	list_iterate_items(mda, &info->mdas) {
--- LVM2/lib/format_text/import.c	2008/01/30 13:19:45	1.44
+++ LVM2/lib/format_text/import.c	2008/01/30 13:59:59	1.45
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -51,7 +51,7 @@
 				    offset2, size2, checksum_fn, checksum)))
 		goto_out;
 
-	/* 
+	/*
 	 * Find a set of version functions that can read this file
 	 */
 	for (vsn = &_text_vsn_list[0]; *vsn; vsn++) {
@@ -104,7 +104,7 @@
 		goto out;
 	}
 
-	/* 
+	/*
 	 * Find a set of version functions that can read this file
 	 */
 	for (vsn = &_text_vsn_list[0]; *vsn; vsn++) {
--- LVM2/lib/format_text/import_vsn1.c	2008/01/30 13:19:45	1.48
+++ LVM2/lib/format_text/import_vsn1.c	2008/01/30 13:59:59	1.49
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -225,24 +225,24 @@
 	pv->pe_alloc_count = 0;
 	pv->fmt = fid->fmt;
 
-        /* Fix up pv size if missing or impossibly large */
-        if ((!pv->size || pv->size > (1ULL << 62)) && pv->dev) {
-                if (!dev_get_size(pv->dev, &pv->size)) {
-                        log_error("%s: Couldn't get size.", pv_dev_name(pv));
-                        return 0;
-                }
-                log_verbose("Fixing up missing size (%s) "
-                            "for PV %s", display_size(fid->fmt->cmd, pv->size),
-                            pv_dev_name(pv));
-                if (vg) {
-                        size = pv->pe_count * (uint64_t) vg->extent_size +
-                               pv->pe_start;
-                        if (size > pv->size)
-                                log_error("WARNING: Physical Volume %s is too "
-                                          "large for underlying device",
-                                          pv_dev_name(pv));
-                }
-        }
+	/* Fix up pv size if missing or impossibly large */
+	if ((!pv->size || pv->size > (1ULL << 62)) && pv->dev) {
+		if (!dev_get_size(pv->dev, &pv->size)) {
+			log_error("%s: Couldn't get size.", pv_dev_name(pv));
+			return 0;
+		}
+		log_verbose("Fixing up missing size (%s) "
+			    "for PV %s", display_size(fid->fmt->cmd, pv->size),
+			    pv_dev_name(pv));
+		if (vg) {
+			size = pv->pe_count * (uint64_t) vg->extent_size +
+			       pv->pe_start;
+			if (size > pv->size)
+				log_error("WARNING: Physical Volume %s is too "
+					  "large for underlying device",
+					  pv_dev_name(pv));
+		}
+	}
 
 	if (!alloc_pv_segment_whole_pv(mem, pv))
 		return_0;
@@ -834,7 +834,7 @@
 	old_suppress = log_suppress(2);
 	*creation_host = dm_pool_strdup(mem,
 					find_config_str(cft->root,
-						        "creation_host", ""));
+							"creation_host", ""));
 	log_suppress(old_suppress);
 
 	/* skip any top-level values */
--- LVM2/lib/format_text/tags.c	2008/01/30 13:19:45	1.5
+++ LVM2/lib/format_text/tags.c	2008/01/30 13:59:59	1.6
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/format_text/text_label.c	2007/11/05 17:17:55	1.19
+++ LVM2/lib/format_text/text_label.c	2008/01/30 13:59:59	1.20
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -239,7 +239,7 @@
 
 	list_iterate_items(mda, &info->mdas) {
 		mdac = (struct mda_context *) mda->metadata_locn;
-		if ((vgname = vgname_from_mda(info->fmt, &mdac->area, 
+		if ((vgname = vgname_from_mda(info->fmt, &mdac->area,
 					      &vgid, &vgstatus, &creation_host,
 					      &mdac->free_sectors)) &&
 		    !lvmcache_update_vgname_and_id(info, vgname,
--- LVM2/lib/locking/cluster_locking.c	2007/12/05 13:17:18	1.24
+++ LVM2/lib/locking/cluster_locking.c	2008/01/30 13:59:59	1.25
@@ -104,8 +104,8 @@
 	/* Send it to CLVMD */
  rewrite:
 	if ( (err = write(_clvmd_sock, inbuf, inlen)) != inlen) {
-	        if (err == -1 && errno == EINTR)
-		        goto rewrite;
+		if (err == -1 && errno == EINTR)
+			goto rewrite;
 		log_error("Error writing data to clvmd: %s", strerror(errno));
 		return 0;
 	}
@@ -113,8 +113,8 @@
 	/* Get the response */
  reread:
 	if ((len = read(_clvmd_sock, outbuf, sizeof(struct clvm_header))) < 0) {
-	        if (errno == EINTR)
-		        goto reread;
+		if (errno == EINTR)
+			goto reread;
 		log_error("Error reading data from clvmd: %s", strerror(errno));
 		return 0;
 	}
@@ -330,7 +330,7 @@
 	 * locks are cluster-wide.
 	 * Also, if the lock is exclusive it makes no sense to try to
 	 * acquire it on all nodes, so just do that on the local node too.
-	 * One exception, is that P_ locks /do/ get distributed across 
+	 * One exception, is that P_ locks /do/ get distributed across
 	 * the cluster because they might have side-effects.
 	 */
 	if (strncmp(name, "P_", 2) &&
@@ -446,10 +446,10 @@
 
 	log_very_verbose("Locking %s %s %s %s%s%s%s (0x%x)", lock_scope, lockname,
 			 lock_type,
-			 flags & LCK_NONBLOCK ? "" : "B", 
-			 flags & LCK_HOLD ? "H" : "", 
-			 flags & LCK_LOCAL ? "L" : "", 
-			 flags & LCK_CLUSTER_VG ? "C" : "", 
+			 flags & LCK_NONBLOCK ? "" : "B",
+			 flags & LCK_HOLD ? "H" : "",
+			 flags & LCK_LOCAL ? "L" : "",
+			 flags & LCK_CLUSTER_VG ? "C" : "",
 			 flags);
 
 	/* Send a message to the cluster manager */
@@ -479,7 +479,7 @@
 
 	_clvmd_sock = _open_local_sock();
 	if (_clvmd_sock == -1)
-	        stack;
+		stack;
 }
 
 #ifdef CLUSTER_LOCKING_INTERNAL
--- LVM2/lib/locking/external_locking.c	2008/01/30 13:19:46	1.14
+++ LVM2/lib/locking/external_locking.c	2008/01/30 13:59:59	1.15
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/locking/file_locking.c	2007/11/16 21:16:20	1.33
+++ LVM2/lib/locking/file_locking.c	2008/01/30 13:59:59	1.34
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/locking/locking.c	2007/11/16 21:16:20	1.43
+++ LVM2/lib/locking/locking.c	2008/01/30 13:59:59	1.44
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -253,7 +253,7 @@
 	}
 
 	if ((type == 2 || type == 3) &&
-            find_config_tree_int(cmd, "locking/fallback_to_local_locking",
+	    find_config_tree_int(cmd, "locking/fallback_to_local_locking",
 				 DEFAULT_FALLBACK_TO_LOCAL_LOCKING)) {
 		log_warn("WARNING: Falling back to local file-based locking.");
 		log_warn("Volume Groups with the clustered attribute will "
--- LVM2/lib/locking/no_locking.c	2007/08/22 14:38:17	1.13
+++ LVM2/lib/locking/no_locking.c	2008/01/30 13:59:59	1.14
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/log/log.c	2007/08/20 20:55:26	1.41
+++ LVM2/lib/log/log.c	2008/01/30 13:59:59	1.42
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/metadata/lv_manip.c	2008/01/30 13:19:46	1.148
+++ LVM2/lib/metadata/lv_manip.c	2008/01/30 14:00:00	1.149
@@ -1679,8 +1679,8 @@
  */
 static int _for_each_sub_lv(struct cmd_context *cmd, struct logical_volume *lv,
 			    int (*func)(struct cmd_context *cmd,
-				        struct logical_volume *lv,
-				        void *data),
+					struct logical_volume *lv,
+					void *data),
 			    void *data)
 {
 	struct lv_segment *seg;
--- LVM2/lib/metadata/merge.c	2008/01/30 13:19:46	1.33
+++ LVM2/lib/metadata/merge.c	2008/01/30 14:00:00	1.34
@@ -24,7 +24,7 @@
 /*
  * Attempt to merge two adjacent segments.
  * Currently only supports striped segments on AREA_PV.
- * Returns success if successful, in which case 'first' 
+ * Returns success if successful, in which case 'first'
  * gets adjusted to contain both areas.
  */
 static int _merge(struct lv_segment *first, struct lv_segment *second)
@@ -76,7 +76,7 @@
 			r = 0;
 		}
 
-		area_multiplier = segtype_is_striped(seg->segtype) ? 
+		area_multiplier = segtype_is_striped(seg->segtype) ?
 					seg->area_count : 1;
 
 		if (seg->area_len * area_multiplier != seg->len) {
--- LVM2/lib/metadata/metadata.c	2008/01/30 13:19:46	1.155
+++ LVM2/lib/metadata/metadata.c	2008/01/30 14:00:00	1.156
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.   
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -36,9 +36,9 @@
 #define pv_field(handle, field)				\
 	(((const struct physical_volume *)(handle))->field)
 
-static struct physical_volume *_pv_read(struct cmd_context *cmd, 
+static struct physical_volume *_pv_read(struct cmd_context *cmd,
 					const char *pv_name,
-					struct list *mdas, 
+					struct list *mdas,
 					uint64_t *label_sector,
 					int warnings);
 
@@ -51,7 +51,7 @@
 				  int pvmetadatacopies,
 				  uint64_t pvmetadatasize, struct list *mdas);
 
-static int _pv_write(struct cmd_context *cmd __attribute((unused)), 
+static int _pv_write(struct cmd_context *cmd __attribute((unused)),
 		     struct physical_volume *pv,
 	     	     struct list *mdas, int64_t label_sector);
 
@@ -748,7 +748,7 @@
 		int pvmetadatacopies,
 		uint64_t pvmetadatasize, struct list *mdas)
 {
-	return _pv_create(fmt, dev, id, size, pe_start, 
+	return _pv_create(fmt, dev, id, size, pe_start,
 			  existing_extent_count,
 			  existing_extent_size,
 			  pvmetadatacopies,
@@ -1392,7 +1392,7 @@
  * inconsistent metadata on disk (i.e. the VG write lock is held).
  * This guarantees only consistent metadata is returned unless PARTIAL_VG.
  * If consistent is 0, caller must check whether consistent == 1 on return
- * and take appropriate action if it isn't (e.g. abort; get write lock 
+ * and take appropriate action if it isn't (e.g. abort; get write lock
  * and call vg_read again).
  *
  * If precommitted is set, use precommitted metadata if present.
@@ -1649,8 +1649,8 @@
 	return vg;
 }
 
-/* This is only called by lv_from_lvid, which is only called from 
- * activate.c so we know the appropriate VG lock is already held and 
+/* This is only called by lv_from_lvid, which is only called from
+ * activate.c so we know the appropriate VG lock is already held and
  * the vg_read is therefore safe.
  */
 static struct volume_group *_vg_read_by_vgid(struct cmd_context *cmd,
@@ -1688,7 +1688,7 @@
 	/* FIXME Disabled vgrenames while active for now because we aren't
 	 *       allowed to do a full scan here any more. */
 
-	// The slow way - full scan required to cope with vgrename 
+	// The slow way - full scan required to cope with vgrename
 	if (!(vgnames = get_vgs(cmd, 2))) {
 		log_error("vg_read_by_vgid: get_vgs failed");
 		return NULL;
@@ -1697,7 +1697,7 @@
 	list_iterate_items(strl, vgnames) {
 		vgname = strl->str;
 		if (!vgname || is_orphan_vg(vgname))
-			continue;	// FIXME Unnecessary? 
+			continue;	// FIXME Unnecessary?
 		consistent = 0;
 		if ((vg = _vg_read(cmd, vgname, vgid, &consistent,
 				   precommitted)) &&
@@ -1766,9 +1766,9 @@
 }
 
 /* FIXME Use label functions instead of PV functions */
-static struct physical_volume *_pv_read(struct cmd_context *cmd, 
+static struct physical_volume *_pv_read(struct cmd_context *cmd,
 					const char *pv_name,
-					struct list *mdas, 
+					struct list *mdas,
 					uint64_t *label_sector,
 					int warnings)
 {
@@ -1917,7 +1917,7 @@
 	return _pv_write(cmd, pv, mdas, label_sector);
 }
 
-static int _pv_write(struct cmd_context *cmd __attribute((unused)), 
+static int _pv_write(struct cmd_context *cmd __attribute((unused)),
 		     struct physical_volume *pv,
 	     	     struct list *mdas, int64_t label_sector)
 {
--- LVM2/lib/metadata/mirror.c	2008/01/30 13:19:46	1.67
+++ LVM2/lib/metadata/mirror.c	2008/01/30 14:00:00	1.68
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -33,8 +33,8 @@
 #define MIRROR_DISK_VERSION 2
 
 /* These are the flags that represent the mirror failure restoration policies */
-#define MIRROR_REMOVE            0
-#define MIRROR_ALLOCATE          1
+#define MIRROR_REMOVE		 0
+#define MIRROR_ALLOCATE		 1
 #define MIRROR_ALLOCATE_ANYWHERE 2
 
 /*
--- LVM2/lib/metadata/pv_manip.c	2008/01/30 13:19:46	1.19
+++ LVM2/lib/metadata/pv_manip.c	2008/01/30 14:00:00	1.20
@@ -146,7 +146,7 @@
 	if (!pv)
 		return &null_pv_segment;
 
-	if (!pv_split_segment(pv, pe) || 
+	if (!pv_split_segment(pv, pe) ||
 	    !pv_split_segment(pv, pe + area_len))
 		return_NULL;
 
--- LVM2/lib/metadata/pv_map.c	2008/01/30 13:19:46	1.30
+++ LVM2/lib/metadata/pv_map.c	2008/01/30 14:00:00	1.31
@@ -56,7 +56,7 @@
 static int _create_alloc_areas_for_pv(struct dm_pool *mem, struct pv_map *pvm,
 				      uint32_t start, uint32_t count)
 {
-        struct pv_segment *peg;
+	struct pv_segment *peg;
 	uint32_t pe, end, area_len;
 
 	/* Only select extents from start to end inclusive */
@@ -67,7 +67,7 @@
 	pe = start;
 
 	/* Walk through complete ordered list of device segments */
-        list_iterate_items(peg, &pvm->pv->segments) {
+	list_iterate_items(peg, &pvm->pv->segments) {
 		/* pe holds the next extent we want to check */
 
 		/* Beyond the range we're interested in? */
@@ -91,7 +91,7 @@
 
       next:
 		pe = peg->pe + peg->len;
-        }
+	}
 
 	return 1;
 }
--- LVM2/lib/metadata/segtype.c	2007/08/20 20:55:26	1.2
+++ LVM2/lib/metadata/segtype.c	2008/01/30 14:00:00	1.3
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/metadata/snapshot_manip.c	2008/01/30 13:19:46	1.30
+++ LVM2/lib/metadata/snapshot_manip.c	2008/01/30 14:00:00	1.31
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/mirror/mirrored.c	2008/01/30 13:19:46	1.50
+++ LVM2/lib/mirror/mirrored.c	2008/01/30 14:00:00	1.51
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -110,19 +110,19 @@
 		}
 	}
 
-        if ((cn = find_config_node(sn, "mirror_log"))) {
-                if (!cn->v || !cn->v->v.str) {
-                        log_error("Mirror log type must be a string.");
-                        return 0;
-                }
-                logname = cn->v->v.str;
+	if ((cn = find_config_node(sn, "mirror_log"))) {
+		if (!cn->v || !cn->v->v.str) {
+			log_error("Mirror log type must be a string.");
+			return 0;
+		}
+		logname = cn->v->v.str;
 		if (!(seg->log_lv = find_lv(seg->lv->vg, logname))) {
 			log_error("Unrecognised mirror log in segment %s.",
 				  sn->key);
 			return 0;
 		}
 		seg->log_lv->status |= MIRROR_LOG;
-        }
+	}
 
 	if (logname && !seg->region_size) {
 		log_error("Missing region size for mirror log for segment "
@@ -232,7 +232,7 @@
 	uint32_t log_flags = 0;
 
 	/*
-	 * Use clustered mirror log for non-exclusive activation 
+	 * Use clustered mirror log for non-exclusive activation
 	 * in clustered VG.
 	 */
 	if ((!(seg->lv->status & ACTIVATE_EXCL) &&
@@ -266,10 +266,10 @@
 }
 
 static int _mirrored_add_target_line(struct dev_manager *dm, struct dm_pool *mem,
-                                struct cmd_context *cmd, void **target_state,
-                                struct lv_segment *seg,
-                                struct dm_tree_node *node, uint64_t len,
-                                uint32_t *pvmove_mirror_count)
+				struct cmd_context *cmd, void **target_state,
+				struct lv_segment *seg,
+				struct dm_tree_node *node, uint64_t len,
+				uint32_t *pvmove_mirror_count)
 {
 	struct mirror_state *mirr_state;
 	uint32_t area_count = seg->area_count;
@@ -349,7 +349,7 @@
 	static int _mirrored_present = 0;
 	uint32_t maj, min, patchlevel;
 	unsigned maj2, min2, patchlevel2;
-        char vsn[80];
+	char vsn[80];
 
 	if (!_mirrored_checked) {
 		_mirrored_present = target_present("mirror", 1);
@@ -361,8 +361,8 @@
 		/* FIXME Move this into libdevmapper */
 
 		if (target_version("mirror", &maj, &min, &patchlevel) &&
-		    maj == 1 && 
-		    ((min >= 1 && min <= 11) || 
+		    maj == 1 &&
+		    ((min >= 1 && min <= 11) ||
 		     (min == 0 && driver_version(vsn, sizeof(vsn)) &&
 		      sscanf(vsn, "%u.%u.%u", &maj2, &min2, &patchlevel2) == 3 &&
 		      maj2 == 4 && min2 == 5 && patchlevel2 == 0)))	/* RHEL4U3 */
--- LVM2/lib/misc/crc.c	2007/08/20 20:55:27	1.5
+++ LVM2/lib/misc/crc.c	2008/01/30 14:00:00	1.6
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/misc/lvm-exec.c	2007/08/20 20:55:27	1.2
+++ LVM2/lib/misc/lvm-exec.c	2008/01/30 14:00:00	1.3
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/misc/lvm-file.c	2007/08/20 20:55:27	1.24
+++ LVM2/lib/misc/lvm-file.c	2008/01/30 14:00:00	1.25
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/misc/lvm-string.c	2007/08/22 14:38:17	1.15
+++ LVM2/lib/misc/lvm-string.c	2008/01/30 14:00:00	1.16
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/misc/sharedlib.c	2007/08/20 20:55:27	1.14
+++ LVM2/lib/misc/sharedlib.c	2008/01/30 14:00:00	1.15
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/mm/memlock.c	2007/08/20 20:55:27	1.10
+++ LVM2/lib/mm/memlock.c	2008/01/30 14:00:00	1.11
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -151,8 +151,8 @@
 					   "activation/reserved_memory",
 					   DEFAULT_RESERVED_MEMORY) * 1024;
 	_default_priority = find_config_tree_int(cmd,
-				            "activation/process_priority",
-				            DEFAULT_PROCESS_PRIORITY);
+					    "activation/process_priority",
+					    DEFAULT_PROCESS_PRIORITY);
 }
 
 #endif
--- LVM2/lib/report/report.c	2008/01/30 13:19:46	1.74
+++ LVM2/lib/report/report.c	2008/01/30 14:00:00	1.75
@@ -115,7 +115,7 @@
 		}
 
 		if (dm_snprintf(extent_str, sizeof(extent_str),
-			        "%s%" PRIu32 "%s",
+				"%s%" PRIu32 "%s",
 				range_format ? ":" : "(", extent,
 				range_format ? "-"  : ")") < 0) {
 			log_error("Extent number dm_snprintf failed");
@@ -128,7 +128,7 @@
 
 		if (range_format) {
 			if (dm_snprintf(extent_str, sizeof(extent_str),
-				        "%" PRIu32, extent + seg->area_len - 1) < 0) {
+					"%" PRIu32, extent + seg->area_len - 1) < 0) {
 				log_error("Extent number dm_snprintf failed");
 				return 0;
 			}
@@ -830,7 +830,7 @@
 			struct dm_report_field *field,
 			const void *data, void *private)
 {
-	struct lvmcache_info *info; 
+	struct lvmcache_info *info;
 	uint32_t count;
 	const char *pvid = (const char *)(&((struct id *) data)->uuid);
 
@@ -856,7 +856,7 @@
 			   struct dm_report_field *field,
 			   const void *data, void *private)
 {
-	struct lvmcache_info *info; 
+	struct lvmcache_info *info;
 	uint64_t freespace = UINT64_MAX, mda_free;
 	const char *pvid = (const char *)(&((struct id *) data)->uuid);
 	struct metadata_area *mda;
--- LVM2/lib/snapshot/snapshot.c	2008/01/30 13:19:46	1.27
+++ LVM2/lib/snapshot/snapshot.c	2008/01/30 14:00:01	1.28
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/lib/striped/striped.c	2008/01/30 13:19:46	1.23
+++ LVM2/lib/striped/striped.c	2008/01/30 14:00:01	1.24
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -154,11 +154,11 @@
 #ifdef DEVMAPPER_SUPPORT
 static int _striped_add_target_line(struct dev_manager *dm,
 				struct dm_pool *mem __attribute((unused)),
-                                struct cmd_context *cmd __attribute((unused)),
+				struct cmd_context *cmd __attribute((unused)),
 				void **target_state __attribute((unused)),
-                                struct lv_segment *seg,
-                                struct dm_tree_node *node, uint64_t len,
-                                uint32_t *pvmove_mirror_count __attribute((unused)))
+				struct lv_segment *seg,
+				struct dm_tree_node *node, uint64_t len,
+				uint32_t *pvmove_mirror_count __attribute((unused)))
 {
 	if (!seg->area_count) {
 		log_error("Internal error: striped add_target_line called "
--- LVM2/lib/uuid/uuid.c	2007/08/20 20:55:27	1.23
+++ LVM2/lib/uuid/uuid.c	2008/01/30 14:00:01	1.24
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -93,10 +93,10 @@
 	if (close(randomfile))
 		stack;
 
-        /*
-         * Skip out the last 2 chars in randomized creation for LVM1
-         * backwards compatibility.
-         */
+	/*
+	 * Skip out the last 2 chars in randomized creation for LVM1
+	 * backwards compatibility.
+	 */
 	for (i = 0; i < len; i++)
 		id->uuid[i] = _c[id->uuid[i] % (sizeof(_c) - 3)];
 
--- LVM2/lib/zero/zero.c	2008/01/30 13:19:46	1.15
+++ LVM2/lib/zero/zero.c	2008/01/30 14:00:01	1.16
@@ -40,12 +40,12 @@
 
 #ifdef DEVMAPPER_SUPPORT
 static int _zero_add_target_line(struct dev_manager *dm __attribute((unused)),
-				struct dm_pool *mem __attribute((unused)),
-                                struct cmd_context *cmd __attribute((unused)),
-				void **target_state __attribute((unused)),
-                                struct lv_segment *seg __attribute((unused)),
-                                struct dm_tree_node *node,uint64_t len,
-                                uint32_t *pvmove_mirror_count __attribute((unused)))
+				 struct dm_pool *mem __attribute((unused)),
+				 struct cmd_context *cmd __attribute((unused)),
+				 void **target_state __attribute((unused)),
+				 struct lv_segment *seg __attribute((unused)),
+				 struct dm_tree_node *node,uint64_t len,
+				 uint32_t *pvmove_mirror_count __attribute((unused)))
 {
 	return dm_tree_node_add_zero_target(node, len);
 }
--- LVM2/tools/dumpconfig.c	2007/08/20 20:55:30	1.6
+++ LVM2/tools/dumpconfig.c	2008/01/30 14:00:01	1.7
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/tools/formats.c	2007/08/20 20:55:30	1.3
+++ LVM2/tools/formats.c	2008/01/30 14:00:01	1.4
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/tools/lvchange.c	2008/01/30 13:19:46	1.88
+++ LVM2/tools/lvchange.c	2008/01/30 14:00:01	1.89
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/tools/lvconvert.c	2008/01/30 13:19:46	1.58
+++ LVM2/tools/lvconvert.c	2008/01/30 14:00:01	1.59
@@ -238,7 +238,7 @@
 static struct volume_group *_get_lvconvert_vg(struct cmd_context *cmd,
 					      const char *lv_name)
 {
-        dev_close_all();
+	dev_close_all();
 
         return vg_lock_and_read(cmd, extract_vgname(cmd, lv_name),
 				NULL, LCK_VG_WRITE,
--- LVM2/tools/lvcreate.c	2008/01/30 13:19:46	1.171
+++ LVM2/tools/lvcreate.c	2008/01/30 14:00:01	1.172
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -435,7 +435,7 @@
 	/*
 	 * Should we zero the lv.
 	 */
-	lp->zero = strcmp(arg_str_value(cmd, zero_ARG, 
+	lp->zero = strcmp(arg_str_value(cmd, zero_ARG,
 		(lp->segtype->flags & SEG_CANNOT_BE_ZEROED) ? "n" : "y"), "n");
 
 	/*
@@ -663,7 +663,7 @@
 			log_error("Snapshots and mirrors may not yet be mixed.");
 			return 0;
 		}
- 
+
 		/* Must zero cow */
 		status |= LVM_WRITE;
 
--- LVM2/tools/lvdisplay.c	2007/08/20 20:55:30	1.19
+++ LVM2/tools/lvdisplay.c	2008/01/30 14:00:01	1.20
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/tools/lvextend.c	2007/08/20 20:55:30	1.6
+++ LVM2/tools/lvextend.c	2008/01/30 14:00:01	1.7
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/tools/lvm-static.c	2007/08/20 20:55:30	1.3
+++ LVM2/tools/lvm-static.c	2008/01/30 14:00:01	1.4
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.   
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/tools/lvm.c	2007/08/20 20:55:30	1.103
+++ LVM2/tools/lvm.c	2008/01/30 14:00:02	1.104
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.   
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/tools/lvmchange.c	2007/08/20 20:55:30	1.7
+++ LVM2/tools/lvmchange.c	2008/01/30 14:00:02	1.8
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/tools/lvmcmdlib.c	2007/08/20 20:55:30	1.5
+++ LVM2/tools/lvmcmdlib.c	2008/01/30 14:00:02	1.6
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.   
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/tools/lvmcmdline.c	2008/01/30 13:19:47	1.60
+++ LVM2/tools/lvmcmdline.c	2008/01/30 14:00:02	1.61
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.   
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -945,7 +945,7 @@
 		if (!refresh_toolcontext(cmd))
 			stack;
 	}
- 
+
 	/* FIXME Move this? */
 	cmd->current_settings = cmd->default_settings;
 	_apply_settings(cmd);
@@ -1159,7 +1159,7 @@
 	    strcmp(base, "initrd-lvm"))
 		alias = 1;
 
-	if (is_static && strcmp(base, "lvm.static") && 
+	if (is_static && strcmp(base, "lvm.static") &&
 	    path_exists(LVM_SHARED_PATH) &&
 	    !getenv("LVM_DID_EXEC")) {
 		setenv("LVM_DID_EXEC", base, 1);
--- LVM2/tools/lvreduce.c	2007/08/20 20:55:30	1.7
+++ LVM2/tools/lvreduce.c	2008/01/30 14:00:02	1.8
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/tools/lvremove.c	2007/08/20 20:55:30	1.53
+++ LVM2/tools/lvremove.c	2008/01/30 14:00:02	1.54
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/tools/lvrename.c	2007/11/15 02:20:03	1.47
+++ LVM2/tools/lvrename.c	2008/01/30 14:00:02	1.48
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/tools/lvresize.c	2008/01/30 13:19:47	1.91
+++ LVM2/tools/lvresize.c	2008/01/30 14:00:02	1.92
@@ -130,7 +130,7 @@
 	return 1;
 }
 
-static int do_resizefs_reduce(const struct cmd_context *cmd, 
+static int do_resizefs_reduce(const struct cmd_context *cmd,
 			      const struct volume_group *vg,
 			      const struct lvresize_params *lp)
 {
--- LVM2/tools/lvscan.c	2007/11/12 20:51:54	1.34
+++ LVM2/tools/lvscan.c	2008/01/30 14:00:02	1.35
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/tools/polldaemon.c	2007/12/22 12:13:29	1.9
+++ LVM2/tools/polldaemon.c	2008/01/30 14:00:02	1.10
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -202,7 +202,7 @@
 			continue;
 		if (!(name = parms->poll_fns->get_copy_name_from_lv(lv_mirr)))
 			continue;
-		/* FIXME Need to do the activation from _set_up_pvmove here 
+		/* FIXME Need to do the activation from _set_up_pvmove here
 		 *       if it's not running and we're not aborting */
 		if (_check_mirror_status(cmd, vg, lv_mirr, name,
 					 parms, &finished) && !finished)
--- LVM2/tools/pvchange.c	2008/01/30 13:19:47	1.57
+++ LVM2/tools/pvchange.c	2008/01/30 14:00:02	1.58
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/tools/pvcreate.c	2008/01/16 18:15:26	1.60
+++ LVM2/tools/pvcreate.c	2008/01/30 14:00:02	1.61
@@ -45,10 +45,10 @@
 	pv = pv_read(cmd, name, NULL, NULL, 0);
 
 	/*
-         * If a PV has no MDAs it may appear to be an orphan until the
-         * metadata is read off another PV in the same VG.  Detecting
-         * this means checking every VG by scanning every PV on the
-         * system.
+	 * If a PV has no MDAs it may appear to be an orphan until the
+	 * metadata is read off another PV in the same VG.  Detecting
+	 * this means checking every VG by scanning every PV on the
+	 * system.
 	 */
 	if (pv && is_orphan(pv)) {
 		if (!scan_vgs_for_pvs(cmd))
@@ -109,7 +109,7 @@
 	if (dev_is_md(dev, &md_superblock) &&
 	    ((!arg_count(cmd, uuidstr_ARG) &&
 	      !arg_count(cmd, restorefile_ARG)) ||
-	     arg_count(cmd, yes_ARG) || 
+	     arg_count(cmd, yes_ARG) ||
 	     (yes_no_prompt("Software RAID md superblock "
 			    "detected on %s. Wipe it? [y/n] ", name) == 'y'))) {
 		log_print("Wiping software RAID md superblock on %s", name);
--- LVM2/tools/pvdisplay.c	2008/01/16 18:15:26	1.45
+++ LVM2/tools/pvdisplay.c	2008/01/30 14:00:02	1.46
@@ -30,10 +30,10 @@
 		vg_name = pv_vg_name(pv);
 		if (!(vg = vg_lock_and_read(cmd, vg_name, (char *)&pv->vgid,
 					    LCK_VG_READ, CLUSTERED, 0))) {
-                 	log_error("Skipping volume group %s", vg_name);
+		 	log_error("Skipping volume group %s", vg_name);
 			/* FIXME If CLUSTERED should return ECMD_PROCESSED here */
-                 	return ECMD_FAILED;
-         	}
+		 	return ECMD_FAILED;
+	 	}
 
 	 	/*
 		 * Replace possibly incomplete PV structure with new one
@@ -42,8 +42,8 @@
 		 if (!(pvl = find_pv_in_vg(vg, pv_name))) {
 			 log_error("Unable to find \"%s\" in volume group \"%s\"",
 				   pv_name, vg->name);
-	                 ret = ECMD_FAILED;
-	                 goto out;
+			 ret = ECMD_FAILED;
+			 goto out;
 		 }
 
 		 pv = pvl->pv;
@@ -52,7 +52,7 @@
 	if (is_orphan(pv))
 		size = pv_size(pv);
 	else
-		size = (pv_pe_count(pv) - pv_pe_alloc_count(pv)) * 
+		size = (pv_pe_count(pv) - pv_pe_alloc_count(pv)) *
 			pv_pe_size(pv);
 
 	if (arg_count(cmd, short_ARG)) {
@@ -80,8 +80,8 @@
 		pvdisplay_segments(pv);
 
 out:
-        if (vg_name)
-                unlock_vg(cmd, vg_name);
+	if (vg_name)
+		unlock_vg(cmd, vg_name);
 
 	return ret;
 }
--- LVM2/tools/pvmove.c	2008/01/30 13:19:47	1.47
+++ LVM2/tools/pvmove.c	2008/01/30 14:00:02	1.48
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -530,12 +530,12 @@
 	if (!(segtype = get_segtype_from_string(cmd, "mirror")))
 		return_0;
 
-        if (activation() && segtype->ops->target_present &&
-            !segtype->ops->target_present(NULL)) {
-                log_error("%s: Required device-mapper target(s) not "
-                          "detected in your kernel", segtype->name);
-                return 0;
-        }
+	if (activation() && segtype->ops->target_present &&
+	    !segtype->ops->target_present(NULL)) {
+		log_error("%s: Required device-mapper target(s) not "
+			  "detected in your kernel", segtype->name);
+		return 0;
+	}
 
 	if (argc) {
 		pv_name = argv[0];
--- LVM2/tools/pvresize.c	2008/01/30 13:19:47	1.20
+++ LVM2/tools/pvresize.c	2008/01/30 14:00:02	1.21
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
  * Copyright (C) 2005 Zak Kipling. All rights reserved.
  *
--- LVM2/tools/pvscan.c	2007/11/02 14:54:40	1.44
+++ LVM2/tools/pvscan.c	2008/01/30 14:00:02	1.45
@@ -89,9 +89,9 @@
 	log_print("PV %-*s VG %-*s %s [%s / %s free]", pv_max_name_len,
 		  pv_tmp_name, vg_max_name_len, vg_tmp_name,
 		  pv->fmt ? pv->fmt->name : "    ",
-		  display_size(cmd, (uint64_t) pv_pe_count(pv) * 
+		  display_size(cmd, (uint64_t) pv_pe_count(pv) *
 					       pv_pe_size(pv)),
-		  display_size(cmd, (uint64_t) (pv_pe_count(pv) - 
+		  display_size(cmd, (uint64_t) (pv_pe_count(pv) -
 						pv_pe_alloc_count(pv)) *
 					   pv_pe_size(pv)));
 	return;
--- LVM2/tools/reporter.c	2008/01/20 01:23:46	1.34
+++ LVM2/tools/reporter.c	2008/01/30 14:00:02	1.35
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -111,7 +111,7 @@
 			goto out;
 		}
 
-                 pv = pvl->pv;
+		 pv = pvl->pv;
 	}
 
 	if (!report_object(handle, vg, NULL, pv, NULL, NULL))
@@ -132,7 +132,7 @@
 	if (!vg) {
 		log_error("Volume group %s not found", vg_name);
 		return ECMD_FAILED;
-	}                     
+	}
 
 	return process_each_pv_in_vg(cmd, vg, NULL, handle, &_pvs_single);
 }
@@ -145,7 +145,7 @@
 	if (!vg) {
 		log_error("Volume group %s not found", vg_name);
 		return ECMD_FAILED;
-	}                     
+	}
 
 	return process_each_pv_in_vg(cmd, vg, NULL, handle, &_pvsegs_single);
 }
--- LVM2/tools/segtypes.c	2007/08/20 20:55:30	1.3
+++ LVM2/tools/segtypes.c	2008/01/30 14:00:02	1.4
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/tools/toollib.c	2008/01/30 13:19:47	1.129
+++ LVM2/tools/toollib.c	2008/01/30 14:00:02	1.130
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -736,13 +736,13 @@
 					continue;
 				}
 
-        			/*
-			         * If a PV has no MDAs it may appear to be an
+				/*
+				 * If a PV has no MDAs it may appear to be an
 				 * orphan until the metadata is read off
 				 * another PV in the same VG.  Detecting this
 				 * means checking every VG by scanning every
 				 * PV on the system.
-			         */
+				 */
 				if (!scanned && is_orphan(pv)) {
 					if (!scan_vgs_for_pvs(cmd)) {
 						stack;
@@ -1251,7 +1251,7 @@
 	    arg_uint_value(cmd, physicalextentsize_ARG, vp_def->extent_size);
 
 	if (arg_count(cmd, clustered_ARG))
-        	vp_new->clustered =
+		vp_new->clustered =
 			!strcmp(arg_str_value(cmd, clustered_ARG,
 					      vp_def->clustered ? "y":"n"), "y");
 	else
--- LVM2/tools/vgcfgbackup.c	2007/08/20 20:55:30	1.23
+++ LVM2/tools/vgcfgbackup.c	2008/01/30 14:00:02	1.24
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/tools/vgcfgrestore.c	2007/11/02 20:40:05	1.17
+++ LVM2/tools/vgcfgrestore.c	2008/01/30 14:00:02	1.18
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/tools/vgchange.c	2007/11/14 00:08:25	1.62
+++ LVM2/tools/vgchange.c	2008/01/30 14:00:02	1.63
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -256,8 +256,8 @@
 	}
 
 	if (clustered) {
-        	list_iterate_items(lvl, &vg->lvs) {
-                	if (lv_is_origin(lvl->lv) || lv_is_cow(lvl->lv)) {
+		list_iterate_items(lvl, &vg->lvs) {
+			if (lv_is_origin(lvl->lv) || lv_is_cow(lvl->lv)) {
 				log_error("Volume group %s contains snapshots "
 					  "that are not yet supported.",
 					  vg->name);
--- LVM2/tools/vgck.c	2007/08/20 20:55:30	1.17
+++ LVM2/tools/vgck.c	2008/01/30 14:00:02	1.18
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/tools/vgdisplay.c	2007/08/20 20:55:30	1.19
+++ LVM2/tools/vgdisplay.c	2008/01/30 14:00:02	1.20
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -89,8 +89,8 @@
 
 	/* FIXME -D disk_ARG is now redundant */
 
-/********* FIXME: Do without this - or else 2(+) passes! 
-	   Figure out longest volume group name 
+/********* FIXME: Do without this - or else 2(+) passes!
+	   Figure out longest volume group name
 	for (c = opt; opt < argc; opt++) {
 		len = strlen(argv[opt]);
 		if (len > max_len)
@@ -101,8 +101,8 @@
 	process_each_vg(cmd, argc, argv, LCK_VG_READ, 0, NULL,
 			vgdisplay_single);
 
-/******** FIXME Need to count number processed 
-	  Add this to process_each_vg if arg_count(cmd,activevolumegroups_ARG) ? 
+/******** FIXME Need to count number processed
+	  Add this to process_each_vg if arg_count(cmd,activevolumegroups_ARG) ?
 
 	if (opt == argc) {
 		log_print("no ");
--- LVM2/tools/vgexport.c	2007/08/20 20:55:30	1.17
+++ LVM2/tools/vgexport.c	2008/01/30 14:00:02	1.18
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/tools/vgextend.c	2007/11/15 02:20:03	1.36
+++ LVM2/tools/vgextend.c	2008/01/30 14:00:02	1.37
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -42,7 +42,7 @@
 
 	log_verbose("Checking for volume group \"%s\"", vg_name);
 	if (!(vg = vg_lock_and_read(cmd, vg_name, NULL, LCK_VG_WRITE | LCK_NONBLOCK,
-				    CLUSTERED | EXPORTED_VG | 
+				    CLUSTERED | EXPORTED_VG |
 				    LVM_WRITE | RESIZEABLE_VG,
 				    CORRECT_INCONSISTENT | FAIL_INCONSISTENT))) {
 		 unlock_vg(cmd, VG_ORPHANS);
--- LVM2/tools/vgimport.c	2007/08/20 20:55:30	1.16
+++ LVM2/tools/vgimport.c	2008/01/30 14:00:02	1.17
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/tools/vgmerge.c	2008/01/30 13:19:47	1.44
+++ LVM2/tools/vgmerge.c	2008/01/30 14:00:02	1.45
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -70,23 +70,23 @@
 		list_iterate_items(lvl2, &vg_from->lvs) {
 			union lvid *lvid2 = &lvl2->lv->lvid;
 
-                	if (id_equal(&lvid1->id[1], &lvid2->id[1])) {
+			if (id_equal(&lvid1->id[1], &lvid2->id[1])) {
 				if (!id_create(&lvid2->id[1])) {
 					log_error("Failed to generate new "
 						  "random LVID for %s",
 						  lvl2->lv->name);
 					goto bad;
 				}
-                		if (!id_write_format(&lvid2->id[1], uuid,
+				if (!id_write_format(&lvid2->id[1], uuid,
 						     sizeof(uuid)))
-                        		goto_bad;
+					goto_bad;
 
 				log_verbose("Changed LVID for %s to %s",
 					    lvl2->lv->name, uuid);
 			}
 		}
 	}
- 
+
 	while (!list_empty(&vg_from->lvs)) {
 		struct list *lvh = vg_from->lvs.n;
 
--- LVM2/tools/vgmknodes.c	2007/08/20 20:55:30	1.5
+++ LVM2/tools/vgmknodes.c	2008/01/30 14:00:02	1.6
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/tools/vgreduce.c	2008/01/30 13:19:47	1.76
+++ LVM2/tools/vgreduce.c	2008/01/30 14:00:02	1.77
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -100,7 +100,7 @@
 	}
 
 	/*
-	 * If LV is active, replace it with error segment 
+	 * If LV is active, replace it with error segment
 	 * and add to list of LVs to be removed later.
 	 * Doesn't apply to snapshots/origins yet - they're already deactivated.
 	 */
--- LVM2/tools/vgremove.c	2007/11/02 20:40:05	1.45
+++ LVM2/tools/vgremove.c	2008/01/30 14:00:02	1.46
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -41,7 +41,7 @@
 	}
 
 	ret = process_each_vg(cmd, argc, argv,
-			      LCK_VG_WRITE | LCK_NONBLOCK, 1, 
+			      LCK_VG_WRITE | LCK_NONBLOCK, 1,
 			      NULL, &vgremove_single);
 
 	unlock_vg(cmd, VG_ORPHANS);
--- LVM2/tools/vgrename.c	2008/01/15 22:56:30	1.49
+++ LVM2/tools/vgrename.c	2008/01/30 14:00:02	1.50
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -150,8 +150,8 @@
 		  vg_name_old, vg_name_new);
 
 	/* FIXME lvmcache corruption - vginfo duplicated instead of renamed */
-        persistent_filter_wipe(cmd->filter);
-        lvmcache_destroy();
+	persistent_filter_wipe(cmd->filter);
+	lvmcache_destroy();
 
 	return 1;
 
--- LVM2/tools/vgscan.c	2007/08/23 15:02:26	1.28
+++ LVM2/tools/vgscan.c	2008/01/30 14:00:02	1.29
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
--- LVM2/tools/vgsplit.c	2008/01/22 03:49:39	1.49
+++ LVM2/tools/vgsplit.c	2008/01/30 14:00:02	1.50
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
  * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
@@ -181,7 +181,7 @@
 		if (!(lv->status & MIRRORED))
 			continue;
 
-		seg = first_seg(lv); 
+		seg = first_seg(lv);
 
 		seg_in = 0;
 		for (s = 0; s < seg->area_count; s++)
@@ -190,8 +190,8 @@
 
 		log_in = (!seg->log_lv || _lv_is_in_vg(vg_to, seg->log_lv));
 		
-		if ((seg_in && seg_in < seg->area_count) || 
-		    (seg_in && seg->log_lv && !log_in) || 
+		if ((seg_in && seg_in < seg->area_count) ||
+		    (seg_in && seg->log_lv && !log_in) ||
 		    (!seg_in && seg->log_lv && log_in)) {
 			log_error("Can't split mirror %s between "
 				  "two Volume Groups", lv->name);


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2007-11-12 20:51 agk
  0 siblings, 0 replies; 36+ messages in thread
From: agk @ 2007-11-12 20:51 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2007-11-12 20:51:54

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c activate.h dev_manager.c 
	                 dev_manager.h 
	lib/display    : display.c 
	lib/metadata   : lv_manip.c 
	lib/report     : report.c 
	tools          : lvchange.c lvcreate.c lvresize.c lvscan.c 
	                 toollib.c vgchange.c vgconvert.c vgreduce.c 

Log message:
	readahead activation code (but no dm support yet)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.732&r2=1.733
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.127&r2=1.128
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.58&r2=1.59
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.127&r2=1.128
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.h.diff?cvsroot=lvm2&r1=1.27&r2=1.28
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/display/display.c.diff?cvsroot=lvm2&r1=1.82&r2=1.83
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.133&r2=1.134
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.65&r2=1.66
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.82&r2=1.83
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvcreate.c.diff?cvsroot=lvm2&r1=1.156&r2=1.157
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvresize.c.diff?cvsroot=lvm2&r1=1.86&r2=1.87
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvscan.c.diff?cvsroot=lvm2&r1=1.33&r2=1.34
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.112&r2=1.113
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgchange.c.diff?cvsroot=lvm2&r1=1.60&r2=1.61
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgconvert.c.diff?cvsroot=lvm2&r1=1.25&r2=1.26
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgreduce.c.diff?cvsroot=lvm2&r1=1.68&r2=1.69

--- LVM2/WHATS_NEW	2007/11/12 13:34:14	1.732
+++ LVM2/WHATS_NEW	2007/11/12 20:51:53	1.733
@@ -1,9 +1,10 @@
 Version 2.02.29 -
 ==================================
   Attempt to remove incomplete LVs with lvcreate zeroing/activation problems.
+  Add read_ahead activation code.
   Add activation/readahead configuration option and FMT_RESTRICTED_READAHEAD.
   Extend readahead arg to accept "auto" and "none".
-  Add lv_read_ahead and lv_kernel_read_ahead fields to reports.
+  Add lv_read_ahead and lv_kernel_read_ahead fields to reports and lvdisplay.
   Prevent lvconvert -s from using same LV as origin and snapshot.
   Fix human-readable output of odd numbers of sectors.
   Add pv_mda_free and vg_mda_free fields to reports for raw text format.
--- LVM2/lib/activate/activate.c	2007/08/20 20:55:24	1.127
+++ LVM2/lib/activate/activate.c	2007/11/12 20:51:53	1.128
@@ -146,12 +146,12 @@
 	return 0;
 }
 int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, struct lvinfo *info,
-	    int with_open_count)
+	    int with_open_count, int with_read_ahead)
 {
 	return 0;
 }
 int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s,
-		    struct lvinfo *info, int with_open_count)
+		    struct lvinfo *info, int with_open_count, int with_read_ahead)
 {
 	return 0;
 }
@@ -425,7 +425,7 @@
  * Returns 1 if info structure populated, else 0 on failure.
  */
 static int _lv_info(struct cmd_context *cmd, const struct logical_volume *lv, int with_mknodes,
-		    struct lvinfo *info, int with_open_count, unsigned by_uuid_only)
+		    struct lvinfo *info, int with_open_count, int with_read_ahead, unsigned by_uuid_only)
 {
 	struct dm_info dminfo;
 	char *name = NULL;
@@ -439,7 +439,8 @@
 
 	log_debug("Getting device info for %s", name);
 	if (!dev_manager_info(lv->vg->cmd->mem, name, lv, with_mknodes,
-			      with_open_count, &dminfo)) {
+			      with_open_count, with_read_ahead, &dminfo,
+			      &info->read_ahead)) {
 		if (name)
 			dm_pool_free(cmd->mem, name);
 		return_0;
@@ -461,20 +462,20 @@
 }
 
 int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, struct lvinfo *info,
-	    int with_open_count)
+	    int with_open_count, int with_read_ahead)
 {
-	return _lv_info(cmd, lv, 0, info, with_open_count, 0);
+	return _lv_info(cmd, lv, 0, info, with_open_count, with_read_ahead, 0);
 }
 
 int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s,
-		    struct lvinfo *info, int with_open_count)
+		    struct lvinfo *info, int with_open_count, int with_read_ahead)
 {
 	struct logical_volume *lv;
 
 	if (!(lv = lv_from_lvid(cmd, lvid_s, 0)))
 		return 0;
 
-	return _lv_info(cmd, lv, 0, info, with_open_count, 0);
+	return _lv_info(cmd, lv, 0, info, with_open_count, with_read_ahead, 0);
 }
 
 /*
@@ -510,7 +511,7 @@
 	if (!activation())
 		return 0;
 
-	if (!lv_info(cmd, lv, &info, 0))
+	if (!lv_info(cmd, lv, &info, 0, 0))
 		return_0;
 
 	if (!info.exists)
@@ -532,7 +533,7 @@
 {
 	struct lvinfo info;
 
-	if (!_lv_info(cmd, lv, 0, &info, 0, by_uuid_only)) {
+	if (!_lv_info(cmd, lv, 0, &info, 0, 0, by_uuid_only)) {
 		stack;
 		return -1;
 	}
@@ -544,7 +545,7 @@
 {
 	struct lvinfo info;
 
-	if (!lv_info(cmd, lv, &info, 1)) {
+	if (!lv_info(cmd, lv, &info, 1, 0)) {
 		stack;
 		return -1;
 	}
@@ -772,7 +773,7 @@
 		return 1;
 	}
 
-	if (!lv_info(cmd, lv, &info, 0))
+	if (!lv_info(cmd, lv, &info, 0, 0))
 		return_0;
 
 	if (!info.exists || info.suspended)
@@ -832,7 +833,7 @@
 		return 1;
 	}
 
-	if (!lv_info(cmd, lv, &info, 0))
+	if (!lv_info(cmd, lv, &info, 0, 0))
 		return_0;
 
 	if (!info.exists || !info.suspended)
@@ -878,7 +879,7 @@
 		return 1;
 	}
 
-	if (!lv_info(cmd, lv, &info, 1))
+	if (!lv_info(cmd, lv, &info, 1, 0))
 		return_0;
 
 	if (!info.exists)
@@ -949,7 +950,7 @@
 		return 1;
 	}
 
-	if (!lv_info(cmd, lv, &info, 0))
+	if (!lv_info(cmd, lv, &info, 0, 0))
 		return_0;
 
 	if (info.exists && !info.suspended && info.live_table)
@@ -992,7 +993,7 @@
 		return r;
 	}
 
-	if (!_lv_info(cmd, lv, 1, &info, 0, 0))
+	if (!_lv_info(cmd, lv, 1, &info, 0, 0, 0))
 		return_0;
 
 	if (info.exists)
--- LVM2/lib/activate/activate.h	2007/08/20 20:55:24	1.58
+++ LVM2/lib/activate/activate.h	2007/11/12 20:51:53	1.59
@@ -27,6 +27,7 @@
 	int read_only;
 	int live_table;
 	int inactive_table;
+	uint32_t read_ahead;
 };
 
 void set_activation(int activation);
@@ -62,9 +63,9 @@
  * Returns 1 if info structure has been populated, else 0.
  */
 int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, struct lvinfo *info,
-	    int with_open_count);
+	    int with_open_count, int with_read_ahead);
 int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s,
-		    struct lvinfo *info, int with_open_count);
+		    struct lvinfo *info, int with_open_count, int with_read_ahead);
 
 /*
  * Returns 1 if activate_lv has been set: 1 = activate; 0 = don't.
--- LVM2/lib/activate/dev_manager.c	2007/08/20 20:55:24	1.127
+++ LVM2/lib/activate/dev_manager.c	2007/11/12 20:51:53	1.128
@@ -118,7 +118,8 @@
 }
 
 static int _info_run(const char *name, const char *dlid, struct dm_info *info,
-		     int mknodes, int with_open_count)
+		     uint32_t *read_ahead, int mknodes, int with_open_count,
+		     int with_read_ahead)
 {
 	int r = 0;
 	struct dm_task *dmt;
@@ -141,6 +142,12 @@
 	if (!dm_task_get_info(dmt, info))
 		goto_out;
 
+	if (!with_read_ahead) {
+		if (read_ahead)
+			*read_ahead = DM_READ_AHEAD_NONE;
+	} else
+		; // FIXME *read_ahead = dm_task_get_read_ahead(dmt);
+
 	r = 1;
 
       out:
@@ -201,27 +208,32 @@
 }
 
 static int _info(const char *name, const char *dlid, int mknodes,
-		 int with_open_count, struct dm_info *info)
+		 int with_open_count, int with_read_ahead,
+		 struct dm_info *info, uint32_t *read_ahead)
 {
 	if (!mknodes && dlid && *dlid) {
-		if (_info_run(NULL, dlid, info, 0, with_open_count) &&
+		if (_info_run(NULL, dlid, info, read_ahead, 0, with_open_count,
+			      with_read_ahead) &&
 	    	    info->exists)
 			return 1;
 		else if (_info_run(NULL, dlid + sizeof(UUID_PREFIX) - 1, info,
-				   0, with_open_count) &&
+				   read_ahead, 0, with_open_count,
+				   with_read_ahead) &&
 			 info->exists)
 			return 1;
 	}
 
 	if (name)
-		return _info_run(name, NULL, info, mknodes, with_open_count);
+		return _info_run(name, NULL, info, read_ahead, mknodes,
+				 with_open_count, with_read_ahead);
 
 	return 0;
 }
 
 int dev_manager_info(struct dm_pool *mem, const char *name,
 		     const struct logical_volume *lv, int with_mknodes,
-		     int with_open_count, struct dm_info *info)
+		     int with_open_count, int with_read_ahead,
+		     struct dm_info *info, uint32_t *read_ahead)
 {
 	const char *dlid;
 
@@ -230,7 +242,8 @@
 		return 0;
 	}
 
-	return _info(name, dlid, with_mknodes, with_open_count, info);
+	return _info(name, dlid, with_mknodes, with_open_count, with_read_ahead,
+		     info, read_ahead);
 }
 
 /* FIXME Interface must cope with multiple targets */
@@ -631,7 +644,7 @@
 		return_0;
 
         log_debug("Getting device info for %s [%s]", name, dlid);
-        if (!_info(name, dlid, 0, 1, &info)) {
+        if (!_info(name, dlid, 0, 1, 0, &info, NULL)) {
                 log_error("Failed to get info for %s [%s].", name, dlid);
                 return 0;
         }
@@ -886,6 +899,9 @@
 	struct lv_layer *lvlayer;
 	struct dm_tree_node *dnode;
 	char *name, *dlid;
+	uint32_t max_stripe_size = UINT32_C(0);
+	uint32_t read_ahead = lv->read_ahead;
+	uint32_t flags = UINT32_C(0);
 
 	if (!(name = build_dm_name(dm->mem, lv->vg->name, lv->name, layer)))
 		return_0;
@@ -932,8 +948,17 @@
 			break;
 		if (lv_is_cow(lv) && !layer)
 			break;
+		if (max_stripe_size < seg->stripe_size)
+			max_stripe_size = seg->stripe_size;
 	}
 
+	if (read_ahead == DM_READ_AHEAD_AUTO)
+		read_ahead = max_stripe_size;
+	else
+		flags = DM_READ_AHEAD_MINIMUM_FLAG;
+
+	// FIXME dm_tree_node_set_read_ahead(dnode, read_ahead, flags);
+
 	return 1;
 }
 
--- LVM2/lib/activate/dev_manager.h	2007/08/20 20:55:24	1.27
+++ LVM2/lib/activate/dev_manager.h	2007/11/12 20:51:53	1.28
@@ -40,7 +40,8 @@
  */
 int dev_manager_info(struct dm_pool *mem, const char *name,
 		     const struct logical_volume *lv,
-		     int mknodes, int with_open_count, struct dm_info *info);
+		     int mknodes, int with_open_count, int with_read_ahead,
+		     struct dm_info *info, uint32_t *read_ahead);
 int dev_manager_snapshot_percent(struct dev_manager *dm,
 				 const struct logical_volume *lv,
 				 float *percent);
--- LVM2/lib/display/display.c	2007/11/05 17:13:54	1.82
+++ LVM2/lib/display/display.c	2007/11/12 20:51:53	1.83
@@ -381,7 +381,7 @@
 {
 	int inkernel;
 	struct lvinfo info;
-	inkernel = lv_info(lv->vg->cmd, lv, &info, 1) && info.exists;
+	inkernel = lv_info(lv->vg->cmd, lv, &info, 1, 0) && info.exists;
 
 	log_print("%s%s/%s:%s:%d:%d:-1:%d:%" PRIu64 ":%d:-1:%d:%d:%d:%d",
 		  lv->vg->cmd->dev_dir,
@@ -412,7 +412,7 @@
 		return 0;
 	}
 
-	inkernel = lv_info(cmd, lv, &info, 1) && info.exists;
+	inkernel = lv_info(cmd, lv, &info, 1, 1) && info.exists;
 
 	log_print("--- Logical volume ---");
 
@@ -493,7 +493,15 @@
 ***********/
 
 	log_print("Allocation             %s", get_alloc_string(lv->alloc));
-	log_print("Read ahead sectors     %u", lv->read_ahead);
+	if (lv->read_ahead == DM_READ_AHEAD_AUTO)
+		log_print("Read ahead sectors     auto");
+	else if (lv->read_ahead == DM_READ_AHEAD_NONE)
+		log_print("Read ahead sectors     0");
+	else
+		log_print("Read ahead sectors     %u", lv->read_ahead);
+
+	if (inkernel && lv->read_ahead != info.read_ahead)
+		log_print("- currently set to     %u", info.read_ahead);
 
 	if (lv->status & FIXED_MINOR) {
 		if (lv->major >= 0)
--- LVM2/lib/metadata/lv_manip.c	2007/11/09 16:51:54	1.133
+++ LVM2/lib/metadata/lv_manip.c	2007/11/12 20:51:53	1.134
@@ -1839,7 +1839,7 @@
 
 	/* FIXME Ensure not referred to by another existing LVs */
 
-	if (lv_info(cmd, lv, &info, 1)) {
+	if (lv_info(cmd, lv, &info, 1, 0)) {
 		if (info.open_count) {
 			log_error("Can't remove open logical volume \"%s\"",
 				  lv->name);
--- LVM2/lib/report/report.c	2007/11/09 16:51:54	1.65
+++ LVM2/lib/report/report.c	2007/11/12 20:51:54	1.66
@@ -227,7 +227,7 @@
 	const struct logical_volume *lv = (const struct logical_volume *) data;
 	struct lvinfo info;
 
-	if (lv_info(lv->vg->cmd, lv, &info, 0) && info.exists)
+	if (lv_info(lv->vg->cmd, lv, &info, 0, 0) && info.exists)
 		return dm_report_field_int(rh, field, &info.major);
 
 	return dm_report_field_uint64(rh, field, &_minusone);
@@ -240,7 +240,7 @@
 	const struct logical_volume *lv = (const struct logical_volume *) data;
 	struct lvinfo info;
 
-	if (lv_info(lv->vg->cmd, lv, &info, 0) && info.exists)
+	if (lv_info(lv->vg->cmd, lv, &info, 0, 0) && info.exists)
 		return dm_report_field_int(rh, field, &info.minor);
 
 	return dm_report_field_uint64(rh, field, &_minusone);
@@ -297,7 +297,7 @@
 	else
 		repstr[3] = '-';
 
-	if (lv_info(lv->vg->cmd, lv, &info, 1) && info.exists) {
+	if (lv_info(lv->vg->cmd, lv, &info, 1, 0) && info.exists) {
 		if (info.suspended)
 			repstr[4] = 's';	/* Suspended */
 		else if (info.live_table)
@@ -583,7 +583,12 @@
 			      const void *data,
 			      void *private __attribute((unused)))
 {
-	// FIXME after dm support is added
+	const struct logical_volume *lv = (const struct logical_volume *) data;
+	struct lvinfo info;
+
+	if (lv_info(lv->vg->cmd, lv, &info, 0, 1) && info.exists)
+		return dm_report_field_int(rh, field, &info.read_ahead);
+
 	return dm_report_field_uint64(rh, field, &_minusone);
 }
 
@@ -852,7 +857,7 @@
 	}
 
 	if (!lv_is_cow(lv) ||
-	    (lv_info(lv->vg->cmd, lv, &info, 0) && !info.exists)) {
+	    (lv_info(lv->vg->cmd, lv, &info, 0, 0) && !info.exists)) {
 		*sortval = UINT64_C(0);
 		dm_report_field_set_value(field, "", sortval);
 		return 1;
--- LVM2/tools/lvchange.c	2007/11/09 16:51:54	1.82
+++ LVM2/tools/lvchange.c	2007/11/12 20:51:54	1.83
@@ -36,7 +36,7 @@
 	}
 
 	if ((lv->status & MIRRORED) && (lv->vg->status & CLUSTERED) &&
-	    lv_info(cmd, lv, &info, 0) && info.exists) {
+	    lv_info(cmd, lv, &info, 0, 0) && info.exists) {
 		log_error("Cannot change permissions of mirror \"%s\" "
 			  "while active.", lv->name);
 		return 0;
@@ -85,7 +85,7 @@
 {
 	struct lvinfo info;
 
-	if (!lv_info(cmd, lv, &info, 0) || !info.exists) {
+	if (!lv_info(cmd, lv, &info, 0, 0) || !info.exists) {
 		log_error("Logical volume, %s, is not active", lv->name);
 		return 0;
 	}
@@ -195,7 +195,7 @@
 		return 0;
 	}
 
-	if (lv_info(cmd, lv, &info, 1)) {
+	if (lv_info(cmd, lv, &info, 1, 0)) {
 		if (info.open_count) {
 			log_error("Can't resync open logical volume \"%s\"",
 				  lv->name);
@@ -447,7 +447,7 @@
 			log_error("Major number must be specified with -My");
 			return 0;
 		}
-		if (lv_info(cmd, lv, &info, 0) && info.exists)
+		if (lv_info(cmd, lv, &info, 0, 0) && info.exists)
 			active = 1;
 		if (active && !arg_count(cmd, force_ARG) &&
 		    yes_no_prompt("Logical volume %s will be "
--- LVM2/tools/lvcreate.c	2007/11/12 20:02:55	1.156
+++ LVM2/tools/lvcreate.c	2007/11/12 20:51:54	1.157
@@ -680,7 +680,7 @@
 		/* Must zero cow */
 		status |= LVM_WRITE;
 
-		if (!lv_info(cmd, org, &info, 0)) {
+		if (!lv_info(cmd, org, &info, 0, 0)) {
 			log_error("Check for existence of snapshot origin "
 				  "'%s' failed.", org->name);
 			return 0;
@@ -918,7 +918,7 @@
 
 revert_new_lv:
 	/* FIXME Better to revert to backup of metadata? */
-	if (!lv_remove(lv) || !vg_write(vg) || backup(vg) || !vg_commit(vg))
+	if (!lv_remove(lv) || !vg_write(vg) || backup(vg), !vg_commit(vg))
 		log_error("Manual intervention may be required to remove "
 			  "abandoned LV(s) before retrying.");
 	return 0;
--- LVM2/tools/lvresize.c	2007/11/12 20:02:55	1.86
+++ LVM2/tools/lvresize.c	2007/11/12 20:51:54	1.87
@@ -95,7 +95,7 @@
 
 	memset(&info, 0, sizeof(info));
 
-	if (!lv_info(cmd, lv, &info, 1) && driver_version(NULL, 0)) {
+	if (!lv_info(cmd, lv, &info, 1, 0) && driver_version(NULL, 0)) {
 		log_error("lv_info failed: aborting");
 		return 0;
 	}
@@ -545,7 +545,7 @@
 	}
 
 	if (lp->mirrors && activation() &&
-	    lv_info(cmd, lv, &info, 0) && info.exists) {
+	    lv_info(cmd, lv, &info, 0, 0) && info.exists) {
 		log_error("Mirrors cannot be resized while active yet.");
 		return ECMD_FAILED;
 	}
@@ -559,7 +559,7 @@
 
 		memset(&info, 0, sizeof(info));
 
-		if (lv_info(cmd, lv, &info, 0) && info.exists) {
+		if (lv_info(cmd, lv, &info, 0, 0) && info.exists) {
 			log_error("Snapshot origin volumes can be resized "
 				  "only while inactive: try lvchange -an");
 			return ECMD_FAILED;
--- LVM2/tools/lvscan.c	2007/08/20 20:55:30	1.33
+++ LVM2/tools/lvscan.c	2007/11/12 20:51:54	1.34
@@ -30,7 +30,7 @@
 	if (!arg_count(cmd, all_ARG) && !lv_is_visible(lv))
 		return ECMD_PROCESSED;
 
-	inkernel = lv_info(cmd, lv, &info, 1) && info.exists;
+	inkernel = lv_info(cmd, lv, &info, 1, 0) && info.exists;
 	if (lv_is_origin(lv)) {
 		list_iterate_items_gen(snap_seg, &lv->snapshot_segs,
 				       origin_list) {
--- LVM2/tools/toollib.c	2007/11/12 20:02:55	1.112
+++ LVM2/tools/toollib.c	2007/11/12 20:51:54	1.113
@@ -1415,7 +1415,7 @@
 	}
 
 revert_new_lv:
-	if (!lv_remove(log_lv) || !vg_write(vg) || backup(vg) || !vg_commit(vg))
+	if (!lv_remove(log_lv) || !vg_write(vg) || backup(vg), !vg_commit(vg))
 		log_error("Manual intervention may be required to remove "
 			  "abandoned log LV before retrying.");
 	return NULL;
--- LVM2/tools/vgchange.c	2007/08/20 20:55:30	1.60
+++ LVM2/tools/vgchange.c	2007/11/12 20:51:54	1.61
@@ -27,7 +27,7 @@
 	list_iterate_items(lvl, &vg->lvs) {
 		lv = lvl->lv;
 
-		if (!lv_info(cmd, lv, &info, 0))
+		if (!lv_info(cmd, lv, &info, 0, 0))
 			lv_active = 0;
 		else
 			lv_active = info.exists;
--- LVM2/tools/vgconvert.c	2007/10/12 14:29:32	1.25
+++ LVM2/tools/vgconvert.c	2007/11/12 20:51:54	1.26
@@ -89,7 +89,7 @@
 				continue;
 			if (lvnum_from_lvid(&lv->lvid) < MAX_RESTRICTED_LVS)
 				continue;
-			if (lv_info(cmd, lv, &info, 0) && info.exists) {
+			if (lv_info(cmd, lv, &info, 0, 0) && info.exists) {
 				log_error("Logical volume %s must be "
 					  "deactivated before conversion.",
 					   lv->name);
--- LVM2/tools/vgreduce.c	2007/10/12 14:29:32	1.68
+++ LVM2/tools/vgreduce.c	2007/11/12 20:51:54	1.69
@@ -116,7 +116,7 @@
 	 * the mirrored LV also should be cleaned up.
 	 * Clean-up is currently done by caller (_make_vg_consistent()).
 	 */
-	if ((lv_info(cmd, lv, &info, 0) && info.exists)
+	if ((lv_info(cmd, lv, &info, 0, 0) && info.exists)
 	    || first_seg(lv)->mirror_seg) {
 		extents = lv->le_count;
 		mirror_seg = first_seg(lv)->mirror_seg;


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2007-07-02 11:17 wysochanski
  0 siblings, 0 replies; 36+ messages in thread
From: wysochanski @ 2007-07-02 11:17 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski@sourceware.org	2007-07-02 11:17:21

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c dev_manager.c 
	lib/format_text: archive.c format-text.c 
	lib/snapshot   : snapshot.c 

Log message:
	Don't use index and rindex functions marked by SUSv3 as legacy - Jakub Bogusz <qboosh@pld-linux.org>

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.643&r2=1.644
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.123&r2=1.124
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.124&r2=1.125
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archive.c.diff?cvsroot=lvm2&r1=1.26&r2=1.27
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/format-text.c.diff?cvsroot=lvm2&r1=1.76&r2=1.77
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/snapshot.c.diff?cvsroot=lvm2&r1=1.19&r2=1.20

--- LVM2/WHATS_NEW	2007/06/28 17:59:34	1.643
+++ LVM2/WHATS_NEW	2007/07/02 11:17:20	1.644
@@ -1,5 +1,6 @@
 Version 2.02.27 - 
 ================================
+  Don't use index and rindex functions marked by SUSv3 as legacy.
   Fix vgsplit if splitting all PVs from VG.
   Fix lvmdiskscan volume reporting when run in the lvm shell
   Fix missing lvm_shell symbol in lvm2cmd library. (2.02.23)
--- LVM2/lib/activate/activate.c	2007/06/28 17:33:43	1.123
+++ LVM2/lib/activate/activate.c	2007/07/02 11:17:21	1.124
@@ -313,7 +313,7 @@
 			else
 				continue;
 		}
-		if (!index(str, '/')) {
+		if (!strchr(str, '/')) {
 			/* vgname supplied */
 			if (!strcmp(str, lv->vg->name))
 				return 1;
--- LVM2/lib/activate/dev_manager.c	2007/05/15 14:42:01	1.124
+++ LVM2/lib/activate/dev_manager.c	2007/07/02 11:17:21	1.125
@@ -561,7 +561,7 @@
 	log_debug("Getting device info for %s", dl->name);
 
 	/* Rename? */
-		if ((suffix = rindex(dl->dlid + sizeof(UUID_PREFIX) - 1, '-')))
+		if ((suffix = strrchr(dl->dlid + sizeof(UUID_PREFIX) - 1, '-')))
 			suffix++;
 		newname = build_dm_name(dm->mem, dm->vg_name, dl->lv->name,
 					suffix);
--- LVM2/lib/format_text/archive.c	2007/06/08 22:38:48	1.26
+++ LVM2/lib/format_text/archive.c	2007/07/02 11:17:21	1.27
@@ -71,7 +71,7 @@
 	if (strcmp(".vg", dot))
 		return 0;
 
-	if (!(underscore = rindex(filename, '_')))
+	if (!(underscore = strrchr(filename, '_')))
 		return 0;
 
 	if (sscanf(underscore + 1, "%u", ix) != 1)
--- LVM2/lib/format_text/format-text.c	2007/06/28 17:33:44	1.76
+++ LVM2/lib/format_text/format-text.c	2007/07/02 11:17:21	1.77
@@ -850,7 +850,7 @@
 	char *slash;
 	char temp_file[PATH_MAX], temp_dir[PATH_MAX];
 
-	slash = rindex(tc->path_edit, '/');
+	slash = strrchr(tc->path_edit, '/');
 
 	if (slash == 0)
 		strcpy(temp_dir, ".");
@@ -948,7 +948,7 @@
 		return 0;
 
 	/* vgrename? */
-	if ((slash = rindex(tc->path_live, '/')))
+	if ((slash = strrchr(tc->path_live, '/')))
 		slash = slash + 1;
 	else
 		slash = tc->path_live;
--- LVM2/lib/snapshot/snapshot.c	2006/10/18 18:01:52	1.19
+++ LVM2/lib/snapshot/snapshot.c	2007/07/02 11:17:21	1.20
@@ -98,7 +98,7 @@
 	float percent2;
 	uint64_t numerator, denominator;
 
-	if (index(params, '/')) {
+	if (strchr(params, '/')) {
 		if (sscanf(params, "%" PRIu64 "/%" PRIu64,
 			   &numerator, &denominator) == 2) {
 			*total_numerator += numerator;


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2007-03-08 21:08 agk
  0 siblings, 0 replies; 36+ messages in thread
From: agk @ 2007-03-08 21:08 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2007-03-08 21:08:25

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c activate.h 
	tools          : vgrename.c 

Log message:
	Fix vgrename active LV check to ignore differing vgids.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.579&r2=1.580
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.120&r2=1.121
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.54&r2=1.55
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgrename.c.diff?cvsroot=lvm2&r1=1.41&r2=1.42

--- LVM2/WHATS_NEW	2007/03/08 19:58:04	1.579
+++ LVM2/WHATS_NEW	2007/03/08 21:08:25	1.580
@@ -1,5 +1,6 @@
 Version 2.02.23 - 
 ====================================
+  Fix vgrename active LV check to ignore differing vgids.
   Remove no-longer-used uuid_out parameter from activation info functions.
   Fix two more segfaults if an empty config file section encountered.
   Move .cache file into a new /etc/lvm/cache directory by default.
--- LVM2/lib/activate/activate.c	2007/01/24 23:43:27	1.120
+++ LVM2/lib/activate/activate.c	2007/03/08 21:08:25	1.121
@@ -168,6 +168,10 @@
 {
 	return 0;
 }
+int lvs_in_vg_activated_by_uuid_only(struct volume_group *vg);
+{
+	return 0;
+}
 int lvs_in_vg_opened(struct volume_group *vg)
 {
 	return 0;
@@ -421,21 +425,23 @@
  * Returns 1 if info structure populated, else 0 on failure.
  */
 static int _lv_info(struct cmd_context *cmd, const struct logical_volume *lv, int with_mknodes,
-		    struct lvinfo *info, int with_open_count)
+		    struct lvinfo *info, int with_open_count, unsigned by_uuid_only)
 {
 	struct dm_info dminfo;
-	char *name;
+	char *name = NULL;
 
 	if (!activation())
 		return 0;
 
-	if (!(name = build_dm_name(cmd->mem, lv->vg->name, lv->name, NULL)))
+	if (!by_uuid_only &&
+	    !(name = build_dm_name(cmd->mem, lv->vg->name, lv->name, NULL)))
 		return_0;
 
 	log_debug("Getting device info for %s", name);
 	if (!dev_manager_info(lv->vg->cmd->mem, name, lv, with_mknodes,
 			      with_open_count, &dminfo)) {
-		dm_pool_free(cmd->mem, name);
+		if (name)
+			dm_pool_free(cmd->mem, name);
 		return_0;
 	}
 
@@ -448,14 +454,16 @@
 	info->live_table = dminfo.live_table;
 	info->inactive_table = dminfo.inactive_table;
 
-	dm_pool_free(cmd->mem, name);
+	if (name)
+		dm_pool_free(cmd->mem, name);
+
 	return 1;
 }
 
 int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, struct lvinfo *info,
 	    int with_open_count)
 {
-	return _lv_info(cmd, lv, 0, info, with_open_count);
+	return _lv_info(cmd, lv, 0, info, with_open_count, 0);
 }
 
 int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s,
@@ -466,7 +474,7 @@
 	if (!(lv = lv_from_lvid(cmd, lvid_s, 0)))
 		return 0;
 
-	return _lv_info(cmd, lv, 0, info, with_open_count);
+	return _lv_info(cmd, lv, 0, info, with_open_count, 0);
 }
 
 /*
@@ -519,11 +527,12 @@
 	return r;
 }
 
-static int _lv_active(struct cmd_context *cmd, struct logical_volume *lv)
+static int _lv_active(struct cmd_context *cmd, struct logical_volume *lv,
+		      unsigned by_uuid_only)
 {
 	struct lvinfo info;
 
-	if (!lv_info(cmd, lv, &info, 0)) {
+	if (!_lv_info(cmd, lv, 0, &info, 0, by_uuid_only)) {
 		stack;
 		return -1;
 	}
@@ -607,7 +616,7 @@
  * These two functions return the number of visible LVs in the state,
  * or -1 on error.
  */
-int lvs_in_vg_activated(struct volume_group *vg)
+static int _lvs_in_vg_activated(struct volume_group *vg, unsigned by_uuid_only)
 {
 	struct lv_list *lvl;
 	int count = 0;
@@ -617,12 +626,22 @@
 
 	list_iterate_items(lvl, &vg->lvs) {
 		if (lvl->lv->status & VISIBLE_LV)
-			count += (_lv_active(vg->cmd, lvl->lv) == 1);
+			count += (_lv_active(vg->cmd, lvl->lv, by_uuid_only) == 1);
 	}
 
 	return count;
 }
 
+int lvs_in_vg_activated_by_uuid_only(struct volume_group *vg)
+{
+	return _lvs_in_vg_activated(vg, 1);
+}
+
+int lvs_in_vg_activated(struct volume_group *vg)
+{
+	return _lvs_in_vg_activated(vg, 0);
+}
+
 int lvs_in_vg_opened(struct volume_group *vg)
 {
 	struct lv_list *lvl;
@@ -973,7 +992,7 @@
 		return r;
 	}
 
-	if (!_lv_info(cmd, lv, 1, &info, 0))
+	if (!_lv_info(cmd, lv, 1, &info, 0, 0))
 		return_0;
 
 	if (info.exists)
--- LVM2/lib/activate/activate.h	2007/01/25 21:22:30	1.54
+++ LVM2/lib/activate/activate.h	2007/03/08 21:08:25	1.55
@@ -83,6 +83,7 @@
  * Return number of LVs in the VG that are active.
  */
 int lvs_in_vg_activated(struct volume_group *vg);
+int lvs_in_vg_activated_by_uuid_only(struct volume_group *vg);
 int lvs_in_vg_opened(struct volume_group *vg);
 
 
--- LVM2/tools/vgrename.c	2006/09/02 01:18:17	1.41
+++ LVM2/tools/vgrename.c	2007/03/08 21:08:25	1.42
@@ -118,7 +118,7 @@
 		return ECMD_FAILED;
 	}
 
-	if (lvs_in_vg_activated(vg_old)) {
+	if (lvs_in_vg_activated_by_uuid_only(vg_old)) {
 		unlock_vg(cmd, vg_name_old);
 		log_error("Volume group \"%s\" still has active LVs",
 			  vg_name_old);


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2006-10-03 17:55 agk
  0 siblings, 0 replies; 36+ messages in thread
From: agk @ 2006-10-03 17:55 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2006-10-03 17:55:20

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c activate.h 
	lib/error      : errseg.c 
	lib/metadata   : segtype.h 
	lib/mirror     : mirrored.c 
	lib/report     : columns.h report.c 
	lib/snapshot   : snapshot.c 
	lib/striped    : striped.c 
	lib/zero       : zero.c 

Log message:
	Add LV column to reports listing kernel modules needed for activation.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.447&r2=1.448
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.113&r2=1.114
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.51&r2=1.52
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/error/errseg.c.diff?cvsroot=lvm2&r1=1.10&r2=1.11
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/segtype.h.diff?cvsroot=lvm2&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.35&r2=1.36
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/columns.h.diff?cvsroot=lvm2&r1=1.16&r2=1.17
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.48&r2=1.49
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/snapshot.c.diff?cvsroot=lvm2&r1=1.17&r2=1.18
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/striped/striped.c.diff?cvsroot=lvm2&r1=1.17&r2=1.18
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/zero/zero.c.diff?cvsroot=lvm2&r1=1.9&r2=1.10

--- LVM2/WHATS_NEW	2006/10/02 16:46:27	1.447
+++ LVM2/WHATS_NEW	2006/10/03 17:55:19	1.448
@@ -1,5 +1,6 @@
 Version 2.02.11 - 
 =====================================
+  Add LV column to reports listing kernel modules needed for activation.
   Show available fields if report given invalid field. (e.g. lvs -o list)
   Add timestamp functions with --disable-realtime configure option.
   Add %VG, %LV and %FREE suffices to lvcreate/lvresize --extents arg.
--- LVM2/lib/activate/activate.c	2006/08/21 12:54:51	1.113
+++ LVM2/lib/activate/activate.c	2006/10/03 17:55:19	1.114
@@ -51,6 +51,66 @@
 		return 0;
 }
 
+int list_segment_modules(struct dm_pool *mem, const struct lv_segment *seg,
+			 struct list *modules)
+{
+	unsigned int s;
+	struct lv_segment *seg2, *snap_seg;
+	struct list *snh;
+
+	if (seg->segtype->ops->modules_needed &&
+	    !seg->segtype->ops->modules_needed(mem, seg, modules)) {
+		log_error("module string allocation failed");
+		return 0;
+	}
+
+	if (lv_is_origin(seg->lv))
+		list_iterate(snh, &seg->lv->snapshot_segs)
+			if (!list_lv_modules(mem,
+					     list_struct_base(snh,
+							      struct lv_segment,
+							      origin_list)->cow,
+					     modules))
+				return_0;
+
+	if (lv_is_cow(seg->lv)) {
+		snap_seg = find_cow(seg->lv);
+		if (snap_seg->segtype->ops->modules_needed &&
+		    !snap_seg->segtype->ops->modules_needed(mem, snap_seg,
+							    modules)) {
+			log_error("snap_seg module string allocation failed");
+			return 0;
+		}
+	}
+
+	for (s = 0; s < seg->area_count; s++) {
+		switch (seg_type(seg, s)) {
+		case AREA_LV:
+			seg2 = find_seg_by_le(seg_lv(seg, s), seg_le(seg, s));
+			if (seg2 && !list_segment_modules(mem, seg2, modules))
+				return_0;
+			break;
+		case AREA_PV:
+		case AREA_UNASSIGNED:
+			;
+		}
+	}
+
+	return 1;
+}
+
+int list_lv_modules(struct dm_pool *mem, const struct logical_volume *lv,
+		    struct list *modules)
+{
+	struct lv_segment *seg;
+
+	list_iterate_items(seg, &lv->segments)
+		if (!list_segment_modules(mem, seg, modules))
+			return_0;
+
+	return 1;
+}
+
 #ifndef DEVMAPPER_SUPPORT
 void set_activation(int act)
 {
--- LVM2/lib/activate/activate.h	2006/05/16 16:48:30	1.51
+++ LVM2/lib/activate/activate.h	2006/10/03 17:55:19	1.52
@@ -39,6 +39,10 @@
 int target_present(const char *target_name, int use_modprobe);
 int target_version(const char *target_name, uint32_t *maj,
                    uint32_t *min, uint32_t *patchlevel);
+int list_segment_modules(struct dm_pool *mem, const struct lv_segment *seg,
+			 struct list *modules);
+int list_lv_modules(struct dm_pool *mem, const struct logical_volume *lv,
+		    struct list *modules);
 
 void activation_release(void);
 void activation_exit(void);
--- LVM2/lib/error/errseg.c	2006/05/16 16:48:30	1.10
+++ LVM2/lib/error/errseg.c	2006/10/03 17:55:19	1.11
@@ -23,6 +23,7 @@
 #include "targets.h"
 #include "lvm-string.h"
 #include "activate.h"
+#include "str_list.h"
 
 static const char *_errseg_name(const struct lv_segment *seg)
 {
@@ -64,6 +65,18 @@
 }
 #endif
 
+static int _errseg_modules_needed(struct dm_pool *mem,
+				  const struct lv_segment *seg,
+				  struct list *modules)
+{
+	if (!str_list_add(mem, modules, "error")) {
+		log_error("error module string list allocation failed");
+		return 0;
+	}
+
+	return 1;
+}
+ 
 static void _errseg_destroy(const struct segment_type *segtype)
 {
 	dm_free((void *)segtype);
@@ -76,6 +89,7 @@
 	.add_target_line = _errseg_add_target_line,
 	.target_present = _errseg_target_present,
 #endif
+	.modules_needed = _errseg_modules_needed,
 	.destroy = _errseg_destroy,
 };
 
--- LVM2/lib/metadata/segtype.h	2006/05/25 13:32:26	1.12
+++ LVM2/lib/metadata/segtype.h	2006/10/03 17:55:19	1.13
@@ -77,6 +77,9 @@
 			       uint64_t *total_numerator,
 			       uint64_t *total_denominator, float *percent);
 	int (*target_present) (void);
+	int (*modules_needed) (struct dm_pool *mem,
+			       const struct lv_segment *seg,
+			       struct list *modules);
 	void (*destroy) (const struct segment_type * segtype);
 	int (*target_register_events) (struct lv_segment *seg, int events);
 	int (*target_unregister_events) (struct lv_segment *seg, int events);
--- LVM2/lib/mirror/mirrored.c	2006/05/25 13:32:26	1.35
+++ LVM2/lib/mirror/mirrored.c	2006/10/03 17:55:19	1.36
@@ -26,6 +26,7 @@
 #include "targets.h"
 #include "activate.h"
 #include "sharedlib.h"
+#include "str_list.h"
 
 #ifdef DMEVENTD
 #  include <libdevmapper-event.h>
@@ -447,6 +448,28 @@
 #endif /* DMEVENTD */
 #endif /* DEVMAPPER_SUPPORT */
 
+static int _mirrored_modules_needed(struct dm_pool *mem,
+				    const struct lv_segment *seg,
+				    struct list *modules)
+{
+	if (seg->log_lv &&
+	    !list_segment_modules(mem, first_seg(seg->log_lv), modules))
+		return_0;
+
+	if ((seg->lv->vg->status & CLUSTERED) &&
+	    !str_list_add(mem, modules, "clog")) {
+		log_error("cluster log string list allocation failed");
+		return 0;
+	}
+
+	if (!str_list_add(mem, modules, "mirror")) {
+		log_error("mirror string list allocation failed");
+		return 0;
+	}
+
+	return 1;
+}
+
 static void _mirrored_destroy(const struct segment_type *segtype)
 {
 	dm_free((void *) segtype);
@@ -467,6 +490,7 @@
 	.target_unregister_events = _target_unregister_events,
 #endif
 #endif
+	.modules_needed = _mirrored_modules_needed,
 	.destroy = _mirrored_destroy,
 };
 
--- LVM2/lib/report/columns.h	2005/10/20 22:24:46	1.16
+++ LVM2/lib/report/columns.h	2006/10/03 17:55:20	1.17
@@ -33,6 +33,7 @@
 FIELD(LVS, lv, STR, "Move", lvid, 4, movepv, "move_pv")
 FIELD(LVS, lv, STR, "LV Tags", tags, 7, tags, "lv_tags")
 FIELD(LVS, lv, STR, "Log", lvid, 3, loglv, "mirror_log")
+FIELD(LVS, lv, STR, "Modules", lvid, 7, modules, "modules")
 
 FIELD(PVS, pv, STR, "Fmt", id, 3, pvfmt, "pv_fmt")
 FIELD(PVS, pv, STR, "PV UUID", id, 38, uuid, "pv_uuid")
--- LVM2/lib/report/report.c	2006/10/02 16:46:27	1.48
+++ LVM2/lib/report/report.c	2006/10/03 17:55:20	1.49
@@ -21,6 +21,7 @@
 #include "display.h"
 #include "activate.h"
 #include "segtype.h"
+#include "str_list.h"
 
 /* 
  * For macro use
@@ -200,6 +201,7 @@
 
 	return 1;
 }
+
 static int _tags_disp(struct report_handle *rh, struct field *field,
 		      const void *data)
 {
@@ -230,6 +232,23 @@
 	return 1;
 }
 
+static int _modules_disp(struct report_handle *rh, struct field *field,
+			 const void *data)
+{
+	const struct logical_volume *lv = (const struct logical_volume *) data;
+	struct list *modules;
+
+	if (!(modules = str_list_create(rh->mem))) {
+		log_error("modules str_list allocation failed");
+		return 0;
+	}
+
+	if (!list_lv_modules(rh->mem, lv, modules))
+		return_0;
+
+	return _tags_disp(rh, field, modules);
+}
+
 static int _vgfmt_disp(struct report_handle *rh, struct field *field,
 		       const void *data)
 {
--- LVM2/lib/snapshot/snapshot.c	2006/05/16 20:53:13	1.17
+++ LVM2/lib/snapshot/snapshot.c	2006/10/03 17:55:20	1.18
@@ -20,6 +20,7 @@
 #include "text_export.h"
 #include "config.h"
 #include "activate.h"
+#include "str_list.h"
 
 static const char *_snap_name(const struct lv_segment *seg)
 {
@@ -126,6 +127,18 @@
 }
 #endif
 
+static int _snap_modules_needed(struct dm_pool *mem,
+				const struct lv_segment *seg,
+				struct list *modules)
+{
+	if (!str_list_add(mem, modules, "snapshot")) {
+		log_error("snapshot string list allocation failed");
+		return 0;
+	}
+
+	return 1;
+}
+
 static void _snap_destroy(const struct segment_type *segtype)
 {
 	dm_free((void *)segtype);
@@ -139,6 +152,7 @@
 	.target_percent = _snap_target_percent,
 	.target_present = _snap_target_present,
 #endif
+	.modules_needed = _snap_modules_needed,
 	.destroy = _snap_destroy,
 };
 
--- LVM2/lib/striped/striped.c	2006/05/16 16:48:31	1.17
+++ LVM2/lib/striped/striped.c	2006/10/03 17:55:20	1.18
@@ -189,6 +189,17 @@
 }
 #endif
 
+static int _striped_modules_needed(struct dm_pool *mem,
+				   const struct lv_segment *seg,
+				   struct list *modules)
+{
+	const char *module;
+
+	module = (seg->area_count == 1) ? "linear" : "striped";
+
+	return str_list_add(mem, modules, module);
+}
+
 static void _striped_destroy(const struct segment_type *segtype)
 {
 	dm_free((void *)segtype);
@@ -205,6 +216,7 @@
 	.add_target_line = _striped_add_target_line,
 	.target_present = _striped_target_present,
 #endif
+	.modules_needed = _striped_modules_needed,
 	.destroy = _striped_destroy,
 };
 
--- LVM2/lib/zero/zero.c	2006/05/16 16:48:31	1.9
+++ LVM2/lib/zero/zero.c	2006/10/03 17:55:20	1.10
@@ -63,6 +63,18 @@
 }
 #endif
 
+static int _zero_modules_needed(struct dm_pool *mem,
+				const struct lv_segment *seg,
+				struct list *modules)
+{
+	if (!str_list_add(mem, modules, "zero")) {
+		log_error("zero module string list allocation failed");
+		return 0;
+	}
+
+	return 1;
+}
+
 static void _zero_destroy(const struct segment_type *segtype)
 {
 	dm_free((void *) segtype);
@@ -75,6 +87,7 @@
 	.add_target_line = _zero_add_target_line,
 	.target_present = _zero_target_present,
 #endif
+	.modules_needed = _zero_modules_needed,
 	.destroy = _zero_destroy,
 };
 


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2006-08-21 12:55 agk
  0 siblings, 0 replies; 36+ messages in thread
From: agk @ 2006-08-21 12:55 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2006-08-21 12:54:54

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c fs.c 
	lib/commands   : toolcontext.c 
	lib/filters    : filter-sysfs.c filter.c 
	lib/format1    : import-export.c 
	lib/format_text: archive.c archiver.c export.c format-text.c 
	lib/locking    : cluster_locking.c file_locking.c locking.c 
	lib/log        : log.c 
	lib/metadata   : lv_manip.c mirror.c 
	lib/misc       : lvm-file.c lvm-string.c lvm-string.h 
	                 sharedlib.c 
	lib/report     : report.c 
	tools          : lvmcmdline.c lvresize.c toollib.c 

Log message:
	Move lvm_snprintf into libdevmapper.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.429&r2=1.430
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.112&r2=1.113
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/fs.c.diff?cvsroot=lvm2&r1=1.37&r2=1.38
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.40&r2=1.41
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-sysfs.c.diff?cvsroot=lvm2&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter.c.diff?cvsroot=lvm2&r1=1.35&r2=1.36
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/import-export.c.diff?cvsroot=lvm2&r1=1.82&r2=1.83
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archive.c.diff?cvsroot=lvm2&r1=1.23&r2=1.24
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archiver.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/export.c.diff?cvsroot=lvm2&r1=1.51&r2=1.52
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/format-text.c.diff?cvsroot=lvm2&r1=1.65&r2=1.66
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/cluster_locking.c.diff?cvsroot=lvm2&r1=1.13&r2=1.14
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/file_locking.c.diff?cvsroot=lvm2&r1=1.24&r2=1.25
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.c.diff?cvsroot=lvm2&r1=1.30&r2=1.31
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/log/log.c.diff?cvsroot=lvm2&r1=1.34&r2=1.35
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.99&r2=1.100
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.31&r2=1.32
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-file.c.diff?cvsroot=lvm2&r1=1.15&r2=1.16
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-string.c.diff?cvsroot=lvm2&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-string.h.diff?cvsroot=lvm2&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/sharedlib.c.diff?cvsroot=lvm2&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.46&r2=1.47
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvmcmdline.c.diff?cvsroot=lvm2&r1=1.33&r2=1.34
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvresize.c.diff?cvsroot=lvm2&r1=1.73&r2=1.74
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.84&r2=1.85

--- LVM2/WHATS_NEW	2006/08/21 12:04:54	1.429
+++ LVM2/WHATS_NEW	2006/08/21 12:54:51	1.430
@@ -1,6 +1,6 @@
 Version 2.02.10 - 
 ==================================
-  Move split_words() and split_dm_name() into libdevmapper.
+  Move lvm_snprintf(), split_words() and split_dm_name() into libdevmapper.
   Add lvconvert man page.
   Add mirror options to man pages.
   Prevent mirror renames.
--- LVM2/lib/activate/activate.c	2006/08/08 21:20:00	1.112
+++ LVM2/lib/activate/activate.c	2006/08/21 12:54:51	1.113
@@ -39,7 +39,7 @@
 {
 	char path[PATH_MAX];
 
-	if (lvm_snprintf(path, sizeof(path), "%s/lvm/global", cmd->proc_dir)
+	if (dm_snprintf(path, sizeof(path), "%s/lvm/global", cmd->proc_dir)
 	    < 0) {
 		log_error("LVM1 proc global snprintf failed");
 		return 0;
@@ -257,9 +257,9 @@
 				continue;
 		}
 		/* vgname/lvname */
-		if (lvm_snprintf(path, sizeof(path), "%s/%s", lv->vg->name,
+		if (dm_snprintf(path, sizeof(path), "%s/%s", lv->vg->name,
 				 lv->name) < 0) {
-			log_error("lvm_snprintf error from %s/%s", lv->vg->name,
+			log_error("dm_snprintf error from %s/%s", lv->vg->name,
 				  lv->name);
 			continue;
 		}
@@ -342,7 +342,7 @@
 		if (target_version(target_name, &maj, &min, &patchlevel))
 			return 1;
 
-		if (lvm_snprintf(module, sizeof(module), "dm-%s", target_name)
+		if (dm_snprintf(module, sizeof(module), "dm-%s", target_name)
 		    < 0) {
 			log_error("target_present module name too long: %s",
 				  target_name);
--- LVM2/lib/activate/fs.c	2005/10/25 17:28:46	1.37
+++ LVM2/lib/activate/fs.c	2006/08/21 12:54:51	1.38
@@ -30,7 +30,7 @@
 {
 	char vg_path[PATH_MAX];
 
-	if (lvm_snprintf(vg_path, sizeof(vg_path), "%s%s",
+	if (dm_snprintf(vg_path, sizeof(vg_path), "%s%s",
 			 dev_dir, vg_name) == -1) {
 		log_error("Couldn't construct name of volume "
 			  "group directory.");
@@ -53,7 +53,7 @@
 {
 	char vg_path[PATH_MAX];
 
-	if (lvm_snprintf(vg_path, sizeof(vg_path), "%s%s",
+	if (dm_snprintf(vg_path, sizeof(vg_path), "%s%s",
 			 dev_dir, vg_name) == -1) {
 		log_error("Couldn't construct name of volume "
 			  "group directory.");
@@ -87,7 +87,7 @@
 		if (!strcmp(name, ".") || !strcmp(name, ".."))
 			continue;
 
-		if (lvm_snprintf(path, sizeof(path), "%s/%s", dir, name) == -1) {
+		if (dm_snprintf(path, sizeof(path), "%s/%s", dir, name) == -1) {
 			log_error("Couldn't create path for %s", name);
 			continue;
 		}
@@ -109,28 +109,28 @@
 	char vg_path[PATH_MAX];
 	struct stat buf;
 
-	if (lvm_snprintf(vg_path, sizeof(vg_path), "%s%s",
+	if (dm_snprintf(vg_path, sizeof(vg_path), "%s%s",
 			 dev_dir, vg_name) == -1) {
 		log_error("Couldn't create path for volume group dir %s",
 			  vg_name);
 		return 0;
 	}
 
-	if (lvm_snprintf(lv_path, sizeof(lv_path), "%s/%s", vg_path,
+	if (dm_snprintf(lv_path, sizeof(lv_path), "%s/%s", vg_path,
 			 lv_name) == -1) {
 		log_error("Couldn't create source pathname for "
 			  "logical volume link %s", lv_name);
 		return 0;
 	}
 
-	if (lvm_snprintf(link_path, sizeof(link_path), "%s/%s",
+	if (dm_snprintf(link_path, sizeof(link_path), "%s/%s",
 			 dm_dir(), dev) == -1) {
 		log_error("Couldn't create destination pathname for "
 			  "logical volume link for %s", lv_name);
 		return 0;
 	}
 
-	if (lvm_snprintf(lvm1_group_path, sizeof(lvm1_group_path), "%s/group",
+	if (dm_snprintf(lvm1_group_path, sizeof(lvm1_group_path), "%s/group",
 			 vg_path) == -1) {
 		log_error("Couldn't create pathname for LVM1 group file for %s",
 			  vg_name);
@@ -190,7 +190,7 @@
 	struct stat buf;
 	char lv_path[PATH_MAX];
 
-	if (lvm_snprintf(lv_path, sizeof(lv_path), "%s%s/%s",
+	if (dm_snprintf(lv_path, sizeof(lv_path), "%s%s/%s",
 			 dev_dir, vg_name, lv_name) == -1) {
 		log_error("Couldn't determine link pathname.");
 		return 0;
--- LVM2/lib/commands/toolcontext.c	2006/08/18 21:17:18	1.40
+++ LVM2/lib/commands/toolcontext.c	2006/08/21 12:54:51	1.41
@@ -67,7 +67,7 @@
 
 	/* Set to "" to avoid using any system directory */
 	if ((e = getenv("LVM_SYSTEM_DIR"))) {
-		if (lvm_snprintf(cmd->sys_dir, sizeof(cmd->sys_dir),
+		if (dm_snprintf(cmd->sys_dir, sizeof(cmd->sys_dir),
 				 "%s", e) < 0) {
 			log_error("LVM_SYSTEM_DIR environment variable "
 				  "is too long.");
@@ -167,7 +167,7 @@
 		log_verbose("Set umask to %04o", cmd->default_settings.umask);
 
 	/* dev dir */
-	if (lvm_snprintf(cmd->dev_dir, sizeof(cmd->dev_dir), "%s/",
+	if (dm_snprintf(cmd->dev_dir, sizeof(cmd->dev_dir), "%s/",
 			 find_config_tree_str(cmd, "devices/dir",
 					 DEFAULT_DEV_DIR)) < 0) {
 		log_error("Device directory given in config file too long");
@@ -178,7 +178,7 @@
 #endif
 
 	/* proc dir */
-	if (lvm_snprintf(cmd->proc_dir, sizeof(cmd->proc_dir), "%s",
+	if (dm_snprintf(cmd->proc_dir, sizeof(cmd->proc_dir), "%s",
 			 find_config_tree_str(cmd, "global/proc",
 					 DEFAULT_PROC_DIR)) < 0) {
 		log_error("Device directory given in config file too long");
@@ -319,7 +319,7 @@
 	if (*tag)
 		filler = "_";
 
-	if (lvm_snprintf(config_file, sizeof(config_file), "%s/lvm%s%s.conf",
+	if (dm_snprintf(config_file, sizeof(config_file), "%s/lvm%s%s.conf",
 			 cmd->sys_dir, filler, tag) < 0) {
 		log_error("LVM_SYSTEM_DIR or tag was too long");
 		return 0;
@@ -587,7 +587,7 @@
 	if (!(f3 = _init_filter_components(cmd)))
 		return 0;
 
-	if (lvm_snprintf(cache_file, sizeof(cache_file),
+	if (dm_snprintf(cache_file, sizeof(cache_file),
 			 "%s/.cache", cmd->sys_dir) < 0) {
 		log_error("Persistent cache filename too long ('%s/.cache').",
 			  cmd->sys_dir);
@@ -839,7 +839,7 @@
 	min = (uint32_t) find_config_tree_int(cmd, "backup/retain_min",
 					 DEFAULT_ARCHIVE_NUMBER);
 
-	if (lvm_snprintf
+	if (dm_snprintf
 	    (default_dir, sizeof(default_dir), "%s/%s", cmd->sys_dir,
 	     DEFAULT_ARCHIVE_SUBDIR) == -1) {
 		log_err("Couldn't create default archive path '%s/%s'.",
@@ -860,7 +860,7 @@
 	    find_config_tree_bool(cmd, "backup/backup",
 			     DEFAULT_BACKUP_ENABLED);
 
-	if (lvm_snprintf
+	if (dm_snprintf
 	    (default_dir, sizeof(default_dir), "%s/%s", cmd->sys_dir,
 	     DEFAULT_BACKUP_SUBDIR) == -1) {
 		log_err("Couldn't create default backup path '%s/%s'.",
--- LVM2/lib/filters/filter-sysfs.c	2006/08/21 12:04:55	1.12
+++ LVM2/lib/filters/filter-sysfs.c	2006/08/21 12:54:52	1.13
@@ -32,7 +32,7 @@
 		return 0;
 	}
 		
-	if (lvm_snprintf(proc_mounts, sizeof(proc_mounts),
+	if (dm_snprintf(proc_mounts, sizeof(proc_mounts),
 			 "%s/mounts", proc) < 0) {
 		log_error("Failed to create /proc/mounts string");
 		return 0;
@@ -46,7 +46,7 @@
 	while (fgets(buffer, sizeof(buffer), fp)) {
 		if (dm_split_words(buffer, 4, 0, split) == 4 &&
 		    !strcmp(split[2], "sysfs")) {
-			if (lvm_snprintf(path, len, "%s/%s", split[1],
+			if (dm_snprintf(path, len, "%s/%s", split[1],
 					 "block") >= 0) {
 				r = 1;
 			}
@@ -183,7 +183,7 @@
                 if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, ".."))
 			continue;
 
-		if (lvm_snprintf(path, sizeof(path), "%s/%s", dir,
+		if (dm_snprintf(path, sizeof(path), "%s/%s", dir,
 				 d->d_name) < 0) {
 			log_error("sysfs path name too long: %s in %s",
 				  d->d_name, dir);
--- LVM2/lib/filters/filter.c	2006/05/09 21:23:50	1.35
+++ LVM2/lib/filters/filter.c	2006/08/21 12:54:52	1.36
@@ -145,7 +145,7 @@
 	/* All types unrecognised initially */
 	memset(_max_partitions_by_major, 0, sizeof(int) * NUMBER_OF_MAJORS);
 
-	if (lvm_snprintf(proc_devices, sizeof(proc_devices),
+	if (dm_snprintf(proc_devices, sizeof(proc_devices),
 			 "%s/devices", proc) < 0) {
 		log_error("Failed to create /proc/devices string");
 		return 0;
--- LVM2/lib/format1/import-export.c	2006/05/10 17:49:25	1.82
+++ LVM2/lib/format1/import-export.c	2006/08/21 12:54:52	1.83
@@ -103,7 +103,7 @@
 static int _system_id(struct cmd_context *cmd, char *s, const char *prefix)
 {
 
-	if (lvm_snprintf(s, NAME_LEN, "%s%s%lu",
+	if (dm_snprintf(s, NAME_LEN, "%s%s%lu",
 			 prefix, cmd->hostname, time(NULL)) < 0) {
 		log_error("Generated system_id too long");
 		return 0;
--- LVM2/lib/format_text/archive.c	2006/05/09 21:23:50	1.23
+++ LVM2/lib/format_text/archive.c	2006/08/21 12:54:52	1.24
@@ -277,7 +277,7 @@
 	}
 
 	for (i = 0; i < 10; i++) {
-		if (lvm_snprintf(archive_name, sizeof(archive_name),
+		if (dm_snprintf(archive_name, sizeof(archive_name),
 				 "%s/%s_%05u.vg", dir, vg->name, ix) < 0) {
 			log_error("Archive file name too long.");
 			return 0;
--- LVM2/lib/format_text/archiver.c	2006/04/12 21:23:04	1.4
+++ LVM2/lib/format_text/archiver.c	2006/08/21 12:54:52	1.5
@@ -190,7 +190,7 @@
 		return 0;
 	}
 
-	if (lvm_snprintf(name, sizeof(name), "%s/%s",
+	if (dm_snprintf(name, sizeof(name), "%s/%s",
 			 vg->cmd->backup_params->dir, vg->name) < 0) {
 		log_error("Failed to generate volume group metadata backup "
 			  "filename.");
@@ -233,7 +233,7 @@
 {
 	char path[PATH_MAX];
 
-	if (lvm_snprintf(path, sizeof(path), "%s/%s",
+	if (dm_snprintf(path, sizeof(path), "%s/%s",
 			 cmd->backup_params->dir, vg_name) < 0) {
 		log_err("Failed to generate backup filename (for removal).");
 		return 0;
@@ -342,7 +342,7 @@
 {
 	char path[PATH_MAX];
 
-	if (lvm_snprintf(path, sizeof(path), "%s/%s",
+	if (dm_snprintf(path, sizeof(path), "%s/%s",
 			 cmd->backup_params->dir, vg_name) < 0) {
 		log_err("Failed to generate backup filename (for restore).");
 		return 0;
@@ -397,7 +397,7 @@
 	if ((vg->status & PARTIAL_VG) || (vg->status & EXPORTED_VG))
 		return;
 
-	if (lvm_snprintf(path, sizeof(path), "%s/%s",
+	if (dm_snprintf(path, sizeof(path), "%s/%s",
 			 vg->cmd->backup_params->dir, vg->name) < 0) {
 		log_debug("Failed to generate backup filename.");
 		return;
--- LVM2/lib/format_text/export.c	2006/05/16 20:53:13	1.51
+++ LVM2/lib/format_text/export.c	2006/08/21 12:54:52	1.52
@@ -233,7 +233,7 @@
 	for (i = 0; (d > 1024.0) && _units[i]; i++)
 		d /= 1024.0;
 
-	return lvm_snprintf(buffer, s, "# %g %s", d, _units[i]) > 0;
+	return dm_snprintf(buffer, s, "# %g %s", d, _units[i]) > 0;
 }
 
 /*
@@ -623,7 +623,7 @@
 		pv = pvl->pv;
 
 		/* FIXME But skip if there's already an LV called pv%d ! */
-		if (lvm_snprintf(buffer, sizeof(buffer), "pv%d", count++) < 0)
+		if (dm_snprintf(buffer, sizeof(buffer), "pv%d", count++) < 0)
 			return_0;
 
 		if (!(name = dm_pool_strdup(f->mem, buffer)))
--- LVM2/lib/format_text/format-text.c	2006/08/17 19:53:35	1.65
+++ LVM2/lib/format_text/format-text.c	2006/08/21 12:54:52	1.66
@@ -853,7 +853,7 @@
 			     tmp != dirent->d_name + strlen(dirent->d_name)
 			     - 4)) {
 				vgname = dirent->d_name;
-				if (lvm_snprintf(path, PATH_MAX, "%s/%s",
+				if (dm_snprintf(path, PATH_MAX, "%s/%s",
 						 dl->dir, vgname) < 0) {
 					log_error("Name too long %s/%s",
 						  dl->dir, vgname);
@@ -1533,7 +1533,7 @@
 		dir_list = &((struct mda_lists *) fmt->private)->dirs;
 
 		list_iterate_items(dl, dir_list) {
-			if (lvm_snprintf(path, PATH_MAX, "%s/%s",
+			if (dm_snprintf(path, PATH_MAX, "%s/%s",
 					 dl->dir, vgname) < 0) {
 				log_error("Name too long %s/%s", dl->dir,
 					  vgname);
--- LVM2/lib/locking/cluster_locking.c	2006/06/12 09:46:35	1.13
+++ LVM2/lib/locking/cluster_locking.c	2006/08/21 12:54:52	1.14
@@ -398,9 +398,9 @@
 	case LCK_VG:
 		/* If the VG name is empty then lock the unused PVs */
 		if (!*resource)
-			lvm_snprintf(lockname, sizeof(lockname), "P_orphans");
+			dm_snprintf(lockname, sizeof(lockname), "P_orphans");
 		else
-			lvm_snprintf(lockname, sizeof(lockname), "V_%s",
+			dm_snprintf(lockname, sizeof(lockname), "V_%s",
 				     resource);
 
 		cluster_cmd = CLVMD_CMD_LOCK_VG;
--- LVM2/lib/locking/file_locking.c	2006/05/16 16:48:30	1.24
+++ LVM2/lib/locking/file_locking.c	2006/08/21 12:54:52	1.25
@@ -212,10 +212,10 @@
 	switch (flags & LCK_SCOPE_MASK) {
 	case LCK_VG:
 		if (!*resource)
-			lvm_snprintf(lockfile, sizeof(lockfile),
+			dm_snprintf(lockfile, sizeof(lockfile),
 				     "%s/P_orphans", _lock_dir);
 		else
-			lvm_snprintf(lockfile, sizeof(lockfile),
+			dm_snprintf(lockfile, sizeof(lockfile),
 				     "%s/V_%s", _lock_dir, resource);
 
 		if (!_lock_file(lockfile, flags))
--- LVM2/lib/locking/locking.c	2006/05/16 16:48:30	1.30
+++ LVM2/lib/locking/locking.c	2006/08/21 12:54:52	1.31
@@ -189,7 +189,7 @@
 	if (!*vgname)
 		return 1;
 
-	if (lvm_snprintf(path, sizeof(path), "%s/lvm/VGs/%s", cmd->proc_dir,
+	if (dm_snprintf(path, sizeof(path), "%s/lvm/VGs/%s", cmd->proc_dir,
 			 vgname) < 0) {
 		log_error("LVM1 proc VG pathname too long for %s", vgname);
 		return 0;
--- LVM2/lib/log/log.c	2006/08/01 14:56:33	1.34
+++ LVM2/lib/log/log.c	2006/08/21 12:54:53	1.35
@@ -318,7 +318,7 @@
       log_it:
 	if (!_log_suppress) {
 		if (_verbose_level > _LOG_DEBUG)
-			lvm_snprintf(locn, sizeof(locn), "#%s:%d ",
+			dm_snprintf(locn, sizeof(locn), "#%s:%d ",
 				     file, line);
 		else
 			locn[0] = '\0';
@@ -413,7 +413,7 @@
 		_already_logging = 1;
 		memset(&buf, ' ', sizeof(buf));
 		bufused = 0;
-		if ((n = lvm_snprintf(buf, sizeof(buf) - bufused - 1,
+		if ((n = dm_snprintf(buf, sizeof(buf) - bufused - 1,
 				      "%s:%d %s%s", file, line, _cmd_name,
 				      _msg_prefix)) == -1)
 			goto done;
--- LVM2/lib/metadata/lv_manip.c	2006/05/11 18:54:04	1.99
+++ LVM2/lib/metadata/lv_manip.c	2006/08/21 12:54:53	1.100
@@ -1240,7 +1240,7 @@
 			high = i;
 	}
 
-	if (lvm_snprintf(buffer, len, format, high + 1) < 0)
+	if (dm_snprintf(buffer, len, format, high + 1) < 0)
 		return NULL;
 
 	return buffer;
--- LVM2/lib/metadata/mirror.c	2006/07/20 20:37:10	1.31
+++ LVM2/lib/metadata/mirror.c	2006/08/21 12:54:53	1.32
@@ -428,7 +428,7 @@
 		return 0;
 	}
 
-	if (lvm_snprintf(img_name, len, "%s_mimage_%%d", lv->name) < 0) {
+	if (dm_snprintf(img_name, len, "%s_mimage_%%d", lv->name) < 0) {
 		log_error("img_name allocation failed. "
 			  "Remove new LV and retry.");
 		return 0;
--- LVM2/lib/misc/lvm-file.c	2006/05/09 21:23:50	1.15
+++ LVM2/lib/misc/lvm-file.c	2006/08/21 12:54:53	1.16
@@ -50,7 +50,7 @@
 
 	for (i = 0; i < 20; i++, num++) {
 
-		if (lvm_snprintf(buffer, len, "%s/.lvm_%s_%d_%d",
+		if (dm_snprintf(buffer, len, "%s/.lvm_%s_%d_%d",
 				 dir, hostname, pid, num) == -1) {
 			log_err("Not enough space to build temporary file "
 				"string.");
--- LVM2/lib/misc/lvm-string.c	2006/08/21 12:04:55	1.11
+++ LVM2/lib/misc/lvm-string.c	2006/08/21 12:54:53	1.12
@@ -14,30 +14,9 @@
  */
 
 #include "lib.h"
-#include "lvm-types.h"
 #include "lvm-string.h"
 
-/*
- * On error, up to glibc 2.0.6, snprintf returned -1 if buffer was too small;
- * From glibc 2.1 it returns number of chars (excl. trailing null) that would 
- * have been written had there been room.
- *
- * lvm_snprintf reverts to the old behaviour.
- */
-int lvm_snprintf(char *buf, size_t bufsize, const char *format, ...)
-{
-	int n;
-	va_list ap;
-
-	va_start(ap, format);
-	n = vsnprintf(buf, bufsize, format, ap);
-	va_end(ap);
-
-	if (n < 0 || (n > bufsize - 1))
-		return -1;
-
-	return n;
-}
+#include <ctype.h>
 
 int emit_to_buffer(char **buffer, size_t *size, const char *fmt, ...)
 {
--- LVM2/lib/misc/lvm-string.h	2006/08/21 12:04:55	1.12
+++ LVM2/lib/misc/lvm-string.h	2006/08/21 12:54:53	1.13
@@ -23,15 +23,6 @@
 
 struct pool;
 
-/*
- * On error, up to glibc 2.0.6, snprintf returned -1 if buffer was too small;
- * From glibc 2.1 it returns number of chars (excl. trailing null) that would 
- * have been written had there been room.
- *
- * lvm_snprintf reverts to the old behaviour.
- */
-int lvm_snprintf(char *buf, size_t bufsize, const char *format, ...);
-
 int emit_to_buffer(char **buffer, size_t *size, const char *fmt, ...);
 
 char *build_dm_name(struct dm_pool *mem, const char *vg,
--- LVM2/lib/misc/sharedlib.c	2006/07/05 17:26:36	1.11
+++ LVM2/lib/misc/sharedlib.c	2006/08/21 12:54:53	1.12
@@ -32,7 +32,7 @@
 	 * if present */
 	if (libname[0] == '/' ||
 	    !(lib_dir = find_config_tree_str(cmd, "global/library_dir", 0)) ||
-	    (lvm_snprintf(path, path_len, "%s/%s", lib_dir,
+	    (dm_snprintf(path, path_len, "%s/%s", lib_dir,
 			  libname) == -1) || stat(path, &info) == -1)
 		strncpy(path, libname, path_len);
 }
--- LVM2/lib/report/report.c	2006/05/11 20:17:17	1.46
+++ LVM2/lib/report/report.c	2006/08/21 12:54:53	1.47
@@ -172,9 +172,9 @@
 			return 0;
 		}
 
-		if (lvm_snprintf(extent_str, sizeof(extent_str), "(%" PRIu32
+		if (dm_snprintf(extent_str, sizeof(extent_str), "(%" PRIu32
 				 ")", extent) < 0) {
-			log_error("Extent number lvm_snprintf failed");
+			log_error("Extent number dm_snprintf failed");
 			return 0;
 		}
 
@@ -276,7 +276,7 @@
 		return 0;
 	}
 
-	if (lvm_snprintf(repstr, 12, "%d", value) < 0) {
+	if (dm_snprintf(repstr, 12, "%d", value) < 0) {
 		log_error("int too big: %d", value);
 		return 0;
 	}
@@ -540,7 +540,7 @@
 		return 0;
 	}
 
-	if (lvm_snprintf(repstr, len, "[%s]", lv->name) < 0) {
+	if (dm_snprintf(repstr, len, "[%s]", lv->name) < 0) {
 		log_error("lvname snprintf failed");
 		return 0;
 	}
@@ -784,7 +784,7 @@
 		return 0;
 	}
 
-	if (lvm_snprintf(repstr, 11, "%u", value) < 0) {
+	if (dm_snprintf(repstr, 11, "%u", value) < 0) {
 		log_error("uint32 too big: %u", value);
 		return 0;
 	}
@@ -813,7 +813,7 @@
 		return 0;
 	}
 
-	if (lvm_snprintf(repstr, 12, "%d", value) < 0) {
+	if (dm_snprintf(repstr, 12, "%d", value) < 0) {
 		log_error("int32 too big: %d", value);
 		return 0;
 	}
@@ -870,7 +870,7 @@
 		return 0;
 	}
 
-	if (lvm_snprintf(repstr, 7, "%.2f", snap_percent) < 0) {
+	if (dm_snprintf(repstr, 7, "%.2f", snap_percent) < 0) {
 		log_error("snapshot percentage too large");
 		return 0;
 	}
@@ -910,7 +910,7 @@
 		return 0;
 	}
 
-	if (lvm_snprintf(repstr, 7, "%.2f", percent) < 0) {
+	if (dm_snprintf(repstr, 7, "%.2f", percent) < 0) {
 		log_error("copy percentage too large");
 		return 0;
 	}
@@ -1324,7 +1324,7 @@
 
 		heading = _fields[fp->field_num].heading;
 		if (rh->flags & RH_ALIGNED) {
-			if (lvm_snprintf(buf, sizeof(buf), "%-*.*s",
+			if (dm_snprintf(buf, sizeof(buf), "%-*.*s",
 					 fp->width, fp->width, heading) < 0) {
 				log_error("snprintf heading failed");
 				dm_pool_end_object(rh->mem);
@@ -1467,7 +1467,7 @@
 						      strlen(repstr)))
 					goto bad;
 			} else if (field->props->flags & FLD_ALIGN_LEFT) {
-				if (lvm_snprintf(buf, sizeof(buf), "%-*.*s",
+				if (dm_snprintf(buf, sizeof(buf), "%-*.*s",
 						 width, width, repstr) < 0) {
 					log_error("snprintf repstr failed");
 					dm_pool_end_object(rh->mem);
@@ -1476,7 +1476,7 @@
 				if (!dm_pool_grow_object(rh->mem, buf, width))
 					goto bad;
 			} else if (field->props->flags & FLD_ALIGN_RIGHT) {
-				if (lvm_snprintf(buf, sizeof(buf), "%*.*s",
+				if (dm_snprintf(buf, sizeof(buf), "%*.*s",
 						 width, width, repstr) < 0) {
 					log_error("snprintf repstr failed");
 					dm_pool_end_object(rh->mem);
--- LVM2/tools/lvmcmdline.c	2006/08/18 21:17:18	1.33
+++ LVM2/tools/lvmcmdline.c	2006/08/21 12:54:53	1.34
@@ -1188,7 +1188,7 @@
 {
 	char *e = getenv("HOME");
 
-	if (lvm_snprintf(buffer, size, "%s/.lvm_history", e) < 0) {
+	if (dm_snprintf(buffer, size, "%s/.lvm_history", e) < 0) {
 		log_error("$HOME/.lvm_history: path too long");
 		return 0;
 	}
@@ -1311,7 +1311,7 @@
 {
 	char path[PATH_MAX];
 
-	if (lvm_snprintf(path, sizeof(path), "%s.lvm1", argv[0]) < 0) {
+	if (dm_snprintf(path, sizeof(path), "%s.lvm1", argv[0]) < 0) {
 		log_error("Failed to create LVM1 tool pathname");
 		return;
 	}
--- LVM2/tools/lvresize.c	2006/05/16 16:48:31	1.73
+++ LVM2/tools/lvresize.c	2006/08/21 12:54:53	1.74
@@ -480,14 +480,14 @@
 	}
 
 	if (lp->resizefs) {
-		if (lvm_snprintf(lv_path, PATH_MAX, "%s%s/%s", cmd->dev_dir,
+		if (dm_snprintf(lv_path, PATH_MAX, "%s%s/%s", cmd->dev_dir,
 				 lp->vg_name, lp->lv_name) < 0) {
 			log_error("Couldn't create LV path for %s",
 				  lp->lv_name);
 			return ECMD_FAILED;
 		}
 
-		if (lvm_snprintf(size_buf, SIZE_BUF, "%" PRIu64,
+		if (dm_snprintf(size_buf, SIZE_BUF, "%" PRIu64,
 				 (uint64_t) lp->extents * vg->extent_size / 2)
 				 < 0) {
 			log_error("Couldn't generate new LV size string");
--- LVM2/tools/toollib.c	2006/06/14 20:27:15	1.84
+++ LVM2/tools/toollib.c	2006/08/21 12:54:53	1.85
@@ -268,7 +268,7 @@
 			} else {
 				vglv_sz = strlen(vgname) + strlen(lv_name) + 2;
 				if (!(vglv = dm_pool_alloc(cmd->mem, vglv_sz)) ||
-				    lvm_snprintf(vglv, vglv_sz, "%s/%s", vgname,
+				    dm_snprintf(vglv, vglv_sz, "%s/%s", vgname,
 						 lv_name) < 0) {
 					log_error("vg/lv string alloc failed");
 					return ECMD_FAILED;
@@ -1098,14 +1098,14 @@
 int generate_log_name_format(struct volume_group *vg __attribute((unused)),
 			     const char *lv_name, char *buffer, size_t size)
 {
-	if (lvm_snprintf(buffer, size, "%s_mlog", lv_name) < 0) {
+	if (dm_snprintf(buffer, size, "%s_mlog", lv_name) < 0) {
 		stack;
 		return 0;
 	}
 
 	/* FIXME I think we can cope without this.  Cf. _add_lv_to_dtree()
 	if (find_lv_in_vg(vg, buffer) &&
-	    lvm_snprintf(buffer, size, "%s_mlog_%%d",
+	    dm_snprintf(buffer, size, "%s_mlog_%%d",
 			 lv_name) < 0) {
 		stack;
 		return 0;
@@ -1135,7 +1135,7 @@
 		return 0;
 	}
 
-	if (lvm_snprintf(name, PATH_MAX, "%s%s/%s", cmd->dev_dir,
+	if (dm_snprintf(name, PATH_MAX, "%s%s/%s", cmd->dev_dir,
 			 lv->vg->name, lv->name) < 0) {
 		log_error("Name too long - device not cleared (%s)", lv->name);
 		return 0;
@@ -1183,7 +1183,7 @@
 		return 0;
 	}
 
-	if (lvm_snprintf(name, PATH_MAX, "%s%s/%s", cmd->dev_dir,
+	if (dm_snprintf(name, PATH_MAX, "%s%s/%s", cmd->dev_dir,
 			 lv->vg->name, lv->name) < 0) {
 		log_error("Name too long - log header not written (%s)", lv->name);
 		return 0;


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2006-08-08 21:20 agk
  0 siblings, 0 replies; 36+ messages in thread
From: agk @ 2006-08-08 21:20 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2006-08-08 21:20:01

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c dev_manager.c dev_manager.h 

Log message:
	Fix missing lockfs on first snapshot creation.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.414&r2=1.415
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.111&r2=1.112
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.112&r2=1.113
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.h.diff?cvsroot=lvm2&r1=1.25&r2=1.26

--- LVM2/WHATS_NEW	2006/08/01 14:56:32	1.414
+++ LVM2/WHATS_NEW	2006/08/08 21:20:00	1.415
@@ -1,5 +1,6 @@
 Version 2.02.08 - 
 ================================
+  Fix missing lockfs on first snapshot creation.
   Add unreliable --trustcache option to reporting commands.
   Fix locking for mimage removal.
   Fix clvmd_init_rhel4 'status' exit code.
--- LVM2/lib/activate/activate.c	2006/05/25 13:32:26	1.111
+++ LVM2/lib/activate/activate.c	2006/08/08 21:20:00	1.112
@@ -528,7 +528,7 @@
 	return r;
 }
 
-static int _lv_suspend_lv(struct logical_volume *lv)
+static int _lv_suspend_lv(struct logical_volume *lv, int lockfs)
 {
 	int r;
 	struct dev_manager *dm;
@@ -536,7 +536,7 @@
 	if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name)))
 		return_0;
 
-	if (!(r = dev_manager_suspend(dm, lv)))
+	if (!(r = dev_manager_suspend(dm, lv, lockfs)))
 		stack;
 
 	dev_manager_destroy(dm);
@@ -637,6 +637,7 @@
 {
 	struct logical_volume *lv, *lv_pre;
 	struct lvinfo info;
+	int lockfs = 0;
 
 	if (!activation())
 		return 1;
@@ -672,7 +673,11 @@
 		stack;
 
 	memlock_inc();
-	if (!_lv_suspend_lv(lv)) {
+
+	if (lv_is_origin(lv_pre) || lv_is_cow(lv_pre))
+		lockfs = 1;
+
+	if (!_lv_suspend_lv(lv, lockfs)) {
 		memlock_dec();
 		fs_unlock();
 		return 0;
--- LVM2/lib/activate/dev_manager.c	2006/07/10 19:17:40	1.112
+++ LVM2/lib/activate/dev_manager.c	2006/08/08 21:20:00	1.113
@@ -37,6 +37,7 @@
 	ACTIVATE,
 	DEACTIVATE,
 	SUSPEND,
+	SUSPEND_WITH_LOCKFS,
 	CLEAN
 } action_t;
 
@@ -984,8 +985,8 @@
 			goto_out;
 		break;
 	case SUSPEND:
-		if (!lv_is_origin(lv) && !lv_is_cow(lv))
-			dm_tree_skip_lockfs(root);
+		dm_tree_skip_lockfs(root);
+	case SUSPEND_WITH_LOCKFS:
 		if (!dm_tree_suspend_children(root, dlid, ID_LEN + sizeof(UUID_PREFIX) - 1))
 			goto_out;
 		break;
@@ -1049,9 +1050,10 @@
 	return r;
 }
 
-int dev_manager_suspend(struct dev_manager *dm, struct logical_volume *lv)
+int dev_manager_suspend(struct dev_manager *dm, struct logical_volume *lv,
+			int lockfs)
 {
-	return _tree_action(dm, lv, SUSPEND);
+	return _tree_action(dm, lv, lockfs ? SUSPEND_WITH_LOCKFS : SUSPEND);
 }
 
 /*
--- LVM2/lib/activate/dev_manager.h	2006/05/16 16:48:30	1.25
+++ LVM2/lib/activate/dev_manager.h	2006/08/08 21:20:00	1.26
@@ -47,7 +47,8 @@
 int dev_manager_mirror_percent(struct dev_manager *dm,
 			       struct logical_volume *lv, int wait,
 			       float *percent, uint32_t *event_nr);
-int dev_manager_suspend(struct dev_manager *dm, struct logical_volume *lv);
+int dev_manager_suspend(struct dev_manager *dm, struct logical_volume *lv,
+			int lockfs);
 int dev_manager_activate(struct dev_manager *dm, struct logical_volume *lv);
 int dev_manager_preload(struct dev_manager *dm, struct logical_volume *lv);
 int dev_manager_deactivate(struct dev_manager *dm, struct logical_volume *lv);


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2005-10-25 19:08 agk
  0 siblings, 0 replies; 36+ messages in thread
From: agk @ 2005-10-25 19:08 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-10-25 19:08:21

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c activate.h dev_manager.c 
	                 dev_manager.h 
	lib/cache      : lvmcache.c 
	lib/filters    : filter.c filter.h 
	lib/metadata   : lv_manip.c metadata.c 
	tools          : vgmerge.c 

Log message:
	Use dm_is_dm_major instead of local copy.
	Allow mapped devices to be used as PVs safely.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.311&r2=1.312
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.95&r2=1.96
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.44&r2=1.45
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.89&r2=1.90
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.h.diff?cvsroot=lvm2&r1=1.20&r2=1.21
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.9&r2=1.10
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter.c.diff?cvsroot=lvm2&r1=1.32&r2=1.33
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter.h.diff?cvsroot=lvm2&r1=1.13&r2=1.14
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.83&r2=1.84
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.82&r2=1.83
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/vgmerge.c.diff?cvsroot=lvm2&r1=1.29&r2=1.30


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2005-10-19 13:59 agk
  0 siblings, 0 replies; 36+ messages in thread
From: agk @ 2005-10-19 13:59 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-10-19 13:59:19

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c dev_manager.c dev_manager.h 

Log message:
	Add 'LVM-' prefix to uuids.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.307&r2=1.308
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.94&r2=1.95
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.87&r2=1.88
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.h.diff?cvsroot=lvm2&r1=1.19&r2=1.20


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2005-06-01 16:51 agk
  0 siblings, 0 replies; 36+ messages in thread
From: agk @ 2005-06-01 16:51 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-06-01 16:51:55

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c dev_manager.c 
	lib/cache      : lvmcache.c 
	lib/commands   : toolcontext.c 
	lib/config     : defaults.h 
	lib/datastruct : list.h 
	lib/device     : dev-cache.c 
	lib/display    : display.c 
	lib/filters    : filter-persistent.c filter-regex.c 
	lib/format1    : disk-rep.c format1.c import-export.c 
	                 import-extents.c vg_number.c 
	lib/format_pool: disk_rep.c format_pool.c import_export.c 
	lib/format_text: archive.c export.c flags.c format-text.c 
	                 import_vsn1.c layout.h text_label.c 
	lib/label      : label.c 
	lib/locking    : locking.c locking_types.h 
	lib/metadata   : lv_alloc.h lv_manip.c merge.c metadata.c 
	                 metadata.h mirror.c pv_alloc.h pv_manip.c 
	                 segtype.h snapshot_manip.c 
	lib/mirror     : mirrored.c 
	lib/mm         : dbg_malloc.c 
	lib/report     : columns.h report.c 
	lib/striped    : striped.c 
	tools          : args.h commands.h lvchange.c lvcreate.c 
	                 lvremove.c toollib.c vgchange.c vgreduce.c 
	                 vgsplit.c 

Log message:
	Basic support for mirrors.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.247&r2=1.248
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.89&r2=1.90
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.76&r2=1.77
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.32&r2=1.33
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/config/defaults.h.diff?cvsroot=lvm2&r1=1.23&r2=1.24
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/datastruct/list.h.diff?cvsroot=lvm2&r1=1.20&r2=1.21
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-cache.c.diff?cvsroot=lvm2&r1=1.40&r2=1.41
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/display/display.c.diff?cvsroot=lvm2&r1=1.62&r2=1.63
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-persistent.c.diff?cvsroot=lvm2&r1=1.24&r2=1.25
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-regex.c.diff?cvsroot=lvm2&r1=1.17&r2=1.18
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format1/disk-rep.c.diff?cvsroot=lvm2&r1=1.53&r2=1.54
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format1/format1.c.diff?cvsroot=lvm2&r1=1.91&r2=1.92
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format1/import-export.c.diff?cvsroot=lvm2&r1=1.74&r2=1.75
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format1/import-extents.c.diff?cvsroot=lvm2&r1=1.27&r2=1.28
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format1/vg_number.c.diff?cvsroot=lvm2&r1=1.9&r2=1.10
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/disk_rep.c.diff?cvsroot=lvm2&r1=1.2&r2=1.3
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/format_pool.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/import_export.c.diff?cvsroot=lvm2&r1=1.11&r2=1.12
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archive.c.diff?cvsroot=lvm2&r1=1.16&r2=1.17
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/export.c.diff?cvsroot=lvm2&r1=1.43&r2=1.44
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/flags.c.diff?cvsroot=lvm2&r1=1.24&r2=1.25
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/format-text.c.diff?cvsroot=lvm2&r1=1.41&r2=1.42
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import_vsn1.c.diff?cvsroot=lvm2&r1=1.25&r2=1.26
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/layout.h.diff?cvsroot=lvm2&r1=1.2&r2=1.3
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/text_label.c.diff?cvsroot=lvm2&r1=1.6&r2=1.7
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/label/label.c.diff?cvsroot=lvm2&r1=1.25&r2=1.26
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.c.diff?cvsroot=lvm2&r1=1.25&r2=1.26
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking_types.h.diff?cvsroot=lvm2&r1=1.11&r2=1.12
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_alloc.h.diff?cvsroot=lvm2&r1=1.8&r2=1.9
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.73&r2=1.74
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/merge.c.diff?cvsroot=lvm2&r1=1.21&r2=1.22
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.78&r2=1.79
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.120&r2=1.121
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.13&r2=1.14
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_alloc.h.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_manip.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/segtype.h.diff?cvsroot=lvm2&r1=1.2&r2=1.3
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/snapshot_manip.c.diff?cvsroot=lvm2&r1=1.20&r2=1.21
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.7&r2=1.8
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/mm/dbg_malloc.c.diff?cvsroot=lvm2&r1=1.20&r2=1.21
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/report/columns.h.diff?cvsroot=lvm2&r1=1.11&r2=1.12
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.31&r2=1.32
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/striped/striped.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/args.h.diff?cvsroot=lvm2&r1=1.38&r2=1.39
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/commands.h.diff?cvsroot=lvm2&r1=1.69&r2=1.70
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.61&r2=1.62
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/lvcreate.c.diff?cvsroot=lvm2&r1=1.93&r2=1.94
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/lvremove.c.diff?cvsroot=lvm2&r1=1.41&r2=1.42
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.67&r2=1.68
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/vgchange.c.diff?cvsroot=lvm2&r1=1.47&r2=1.48
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/vgreduce.c.diff?cvsroot=lvm2&r1=1.36&r2=1.37
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/vgsplit.c.diff?cvsroot=lvm2&r1=1.14&r2=1.15


^ permalink raw reply	[flat|nested] 36+ messages in thread

* LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
@ 2005-01-12 22:58 agk
  0 siblings, 0 replies; 36+ messages in thread
From: agk @ 2005-01-12 22:58 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-01-12 22:58:21

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c activate.h dev_manager.c 
	                 dev_manager.h 
	lib/display    : display.c 
	lib/report     : report.c 
	tools          : lvchange.c lvremove.c lvresize.c lvscan.c 
	                 vgconvert.c 

Log message:
	Only ask libdevmapper for open_count when we need it.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.150&r2=1.151
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.88&r2=1.89
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.40&r2=1.41
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.71&r2=1.72
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.h.diff?cvsroot=lvm2&r1=1.17&r2=1.18
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/display/display.c.diff?cvsroot=lvm2&r1=1.58&r2=1.59
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.25&r2=1.26
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.59&r2=1.60
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/lvremove.c.diff?cvsroot=lvm2&r1=1.39&r2=1.40
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/lvresize.c.diff?cvsroot=lvm2&r1=1.58&r2=1.59
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/lvscan.c.diff?cvsroot=lvm2&r1=1.25&r2=1.26
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/vgconvert.c.diff?cvsroot=lvm2&r1=1.13&r2=1.14


^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2012-03-23  9:58 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-19 21:01 LVM2 ./WHATS_NEW lib/activate/activate.c lib/a agk
  -- strict thread matches above, loose matches on Subject: below --
2012-03-23  9:58 zkabelac
2012-02-23 22:42 zkabelac
2012-01-25 13:10 zkabelac
2012-01-25  8:48 zkabelac
2011-11-18 19:31 zkabelac
2011-10-06 14:55 jbrassow
2011-10-03 18:37 zkabelac
2011-09-22 17:33 prajnoha
2011-06-30 18:25 agk
2011-06-22 21:31 jbrassow
2011-06-17 14:22 zkabelac
2011-06-17 14:14 zkabelac
2011-02-04 19:14 zkabelac
2011-02-03  1:24 zkabelac
2010-08-17  1:16 agk
2010-02-24 20:01 mbroz
2010-02-24 20:00 mbroz
2009-10-01  0:35 agk
2009-06-01 12:43 mbroz
2009-05-20 11:09 mbroz
2009-05-20  9:52 mbroz
2009-02-28  0:54 agk
2008-12-19 14:22 prajnoha
2008-04-07 10:23 mbroz
2008-01-30 14:00 agk
2007-11-12 20:51 agk
2007-07-02 11:17 wysochanski
2007-03-08 21:08 agk
2006-10-03 17:55 agk
2006-08-21 12:55 agk
2006-08-08 21:20 agk
2005-10-25 19:08 agk
2005-10-19 13:59 agk
2005-06-01 16:51 agk
2005-01-12 22:58 agk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).