[Cluster-devel] Cluster Project branch, master, updated. cluster-2.99.06-15-g986180d

teigland at sourceware.org teigland at sourceware.org
Wed Jul 16 21:37:23 UTC 2008


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Cluster Project".

http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=986180d297a20592039dd8818d1d7ffa39d79d62

The branch, master has been updated
       via  986180d297a20592039dd8818d1d7ffa39d79d62 (commit)
      from  ab0f0a1043740922837819238b3450aaa668a2c5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 986180d297a20592039dd8818d1d7ffa39d79d62
Author: David Teigland <teigland at redhat.com>
Date:   Wed Jul 16 16:30:48 2008 -0500

    gfs_controld: add missing endian conversion
    
    for id_info structs in start messages
    
    Signed-off-by: David Teigland <teigland at redhat.com>

-----------------------------------------------------------------------

Summary of changes:
 group/gfs_controld/cpg-new.c |   55 +++++++++++++++++++++++++++++++++--------
 1 files changed, 44 insertions(+), 11 deletions(-)

diff --git a/group/gfs_controld/cpg-new.c b/group/gfs_controld/cpg-new.c
index 5c72bfd..fdfef9a 100644
--- a/group/gfs_controld/cpg-new.c
+++ b/group/gfs_controld/cpg-new.c
@@ -874,30 +874,55 @@ static struct change *find_change(struct mountgroup *mg, struct gfs_header *hd,
 	return NULL;
 }
 
+static void mg_info_in(struct mg_info *mi)
+{
+	mi->mg_info_size  = le32_to_cpu(mi->mg_info_size);
+	mi->id_info_size  = le32_to_cpu(mi->id_info_size);
+	mi->id_info_count = le32_to_cpu(mi->id_info_count);
+	mi->started_count = le32_to_cpu(mi->started_count);
+	mi->member_count  = le32_to_cpu(mi->member_count);
+	mi->joined_count  = le32_to_cpu(mi->joined_count);
+	mi->remove_count  = le32_to_cpu(mi->remove_count);
+	mi->failed_count  = le32_to_cpu(mi->failed_count);
+	mi->first_recovery_needed = le32_to_cpu(mi->first_recovery_needed);
+	mi->first_recovery_master = le32_to_cpu(mi->first_recovery_master);
+}
+
+static void id_info_in(struct id_info *id)
+{
+	id->nodeid = le32_to_cpu(id->nodeid);
+	id->jid    = le32_to_cpu(id->jid);
+	id->flags  = le32_to_cpu(id->flags);
+}
+
+static void ids_in(struct mg_info *mi, struct id_info *ids)
+{
+	struct id_info *id;
+	int i;
+
+	id = ids;
+	for (i = 0; i < mi->id_info_count; i++) {
+		id_info_in(id);
+		id = (struct id_info *)((char *)id + mi->id_info_size);
+	}
+}
+
 static void receive_start(struct mountgroup *mg, struct gfs_header *hd, int len)
 {
 	struct change *cg;
 	struct member *memb;
 	struct mg_info *mi;
+	struct id_info *ids;
 	uint32_t seq = hd->msgdata;
 	int added;
 
 	log_group(mg, "receive_start %d:%u len %d", hd->nodeid, seq, len);
 
 	/* header endian conv in deliver_cb, mg_info endian conv here,
-	   id_info endian conv later when it's used */
+	   id_info endian conv below */
 
 	mi = (struct mg_info *)((char *)hd + sizeof(struct gfs_header));
-	mi->mg_info_size  = le32_to_cpu(mi->mg_info_size);
-	mi->id_info_size  = le32_to_cpu(mi->id_info_size);
-	mi->id_info_count = le32_to_cpu(mi->id_info_count);
-	mi->started_count = le32_to_cpu(mi->started_count);
-	mi->member_count  = le32_to_cpu(mi->member_count);
-	mi->joined_count  = le32_to_cpu(mi->joined_count);
-	mi->remove_count  = le32_to_cpu(mi->remove_count);
-	mi->failed_count  = le32_to_cpu(mi->failed_count);
-	mi->first_recovery_needed = le32_to_cpu(mi->first_recovery_needed);
-	mi->first_recovery_master = le32_to_cpu(mi->first_recovery_master);
+	mg_info_in(mi);
 
 	cg = find_change(mg, hd, len, mi);
 	if (!cg)
@@ -934,14 +959,22 @@ static void receive_start(struct mountgroup *mg, struct gfs_header *hd, int len)
 		return;
 	}
 
+	/* save a copy of each start message */
 	memb->start_msg = malloc(len);
 	if (!memb->start_msg) {
 		log_error("receive_start len %d no mem", len);
 		return;
 	}
 	memcpy(memb->start_msg, hd, len);
+
+	/* a shortcut to the saved mg_info */
 	memb->mg_info = (struct mg_info *)(memb->start_msg +
 					   sizeof(struct gfs_header));
+	/* endian swap saved id_info entries */
+	ids = (struct id_info *)(memb->start_msg +
+				 sizeof(struct gfs_header) +
+				 memb->mg_info->mg_info_size);
+	ids_in(mi, ids);
 }
 
 /* start messages are associated with a specific change and use the


hooks/post-receive
--
Cluster Project




More information about the Cluster-devel mailing list