public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: teigland@sourceware.org
To: cluster-cvs@sources.redhat.com, cluster-devel@redhat.com
Subject: Cluster Project branch, master, updated. cluster-2.99.06-15-g986180d
Date: Wed, 16 Jul 2008 21:37:00 -0000	[thread overview]
Message-ID: <20080716213723.8402.qmail@sourceware.org> (raw)

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@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@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


                 reply	other threads:[~2008-07-16 21:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080716213723.8402.qmail@sourceware.org \
    --to=teigland@sourceware.org \
    --cc=cluster-cvs@sources.redhat.com \
    --cc=cluster-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).