Skip to contentSkip to conversation

LVM2 ./WHATS_NEW lib/locking/locking.c lib/loc ...

PATCH [email protected] 1 participant 1 message Apr 9, 2008

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: agk at sourceware.org 2008-04-09 12:56:34

Modified files:

	.              : WHATS_NEW 
	lib/locking    : locking.c locking.h 
	tools          : lvconvert.c polldaemon.h pvmove.c 

Log message:
Use clustered mirror log with pvmove in clustered VGs, if available.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.836&r2=1.837
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.c.diff?cvsroot=lvm2&r1=1.45&r2=1.46
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.h.diff?cvsroot=lvm2&r1=1.37&r2=1.38
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.62&r2=1.63
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/polldaemon.h.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvmove.c.diff?cvsroot=lvm2&r1=1.51&r2=1.52

WHATS_NEW +1 -0
@@ -1,5 +1,6 @@
 Version 2.02.34 -
 ===================================
+  Use clustered mirror log with pvmove in clustered VGs, if available.
   Fix some pvmove error status codes.
   Fix vgsplit error paths to release vg_to lock.
   Indicate whether or not VG is clustered in vgcreate log message.
lib/locking/locking.c +7 -3
@@ -412,19 +412,23 @@
 }
 
 /* Lock a list of LVs */
-int activate_lvs_excl(struct cmd_context *cmd, struct list *lvs)
+int activate_lvs(struct cmd_context *cmd, struct list *lvs, unsigned exclusive)
 {
 	struct list *lvh;
 	struct lv_list *lvl;
 
 	list_iterate_items(lvl, lvs) {
-		if (!activate_lv_excl(cmd, lvl->lv)) {
+		if (!exclusive) {
+			if (!activate_lv(cmd, lvl->lv)) {
+				log_error("Failed to activate %s", lvl->lv->name);
+				return 0;
+			}
+		} else if (!activate_lv_excl(cmd, lvl->lv)) {
 			log_error("Failed to activate %s", lvl->lv->name);
 			list_uniterate(lvh, lvs, &lvl->list) {
 				lvl = list_item(lvh, struct lv_list);
 				activate_lv(cmd, lvl->lv);
 			}
-
 			return 0;
 		}
 	}
lib/locking/locking.h +1 -1
@@ -120,7 +120,7 @@
 /* Process list of LVs */
 int suspend_lvs(struct cmd_context *cmd, struct list *lvs);
 int resume_lvs(struct cmd_context *cmd, struct list *lvs);
-int activate_lvs_excl(struct cmd_context *cmd, struct list *lvs);
+int activate_lvs(struct cmd_context *cmd, struct list *lvs, unsigned exclusive);
 
 /* Interrupt handling */
 void sigint_clear(void);
tools/lvconvert.c +1 -1
@@ -258,7 +258,7 @@
 				    struct volume_group *vg __attribute((unused)),
 				    struct logical_volume *lv __attribute((unused)),
 				    struct list *lvs_changed __attribute((unused)),
-				    int first_time __attribute((unused)))
+				    unsigned flags __attribute((unused)))
 {
 	/* lvconvert mirror doesn't require periodical metadata update */
 	return 1;
tools/polldaemon.h +1 -1
@@ -29,7 +29,7 @@
 	int (*update_metadata) (struct cmd_context *cmd,
 				struct volume_group *vg,
 				struct logical_volume *lv_mirr,
-				struct list *lvs_changed, int first_time);
+				struct list *lvs_changed, unsigned flags);
 	int (*finish_copy) (struct cmd_context *cmd,
 			    struct volume_group *vg,
 			    struct logical_volume *lv_mirr,
tools/pvmove.c +52 -20

140 lines not on this page · raw message