* [Cluster-devel] cluster/group/gfs_controld cpg.c
@ 2006-11-30 19:50 teigland
0 siblings, 0 replies; 3+ messages in thread
From: teigland @ 2006-11-30 19:50 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL50
Changes by: teigland at sourceware.org 2006-11-30 19:50:20
Modified files:
group/gfs_controld: cpg.c
Log message:
From: Steven Dake
We dispatch in the dispatch handler now instead of saving the
data. Also we use dispatch all which will basically try to dispatch all
messages possible in one go instead of only dispatching on each loop
through poll.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/cpg.c.diff?cvsroot=cluster&only_with_tag=RHEL50&r1=1.9.4.1&r2=1.9.4.2
--- cluster/group/gfs_controld/cpg.c 2006/11/20 21:10:36 1.9.4.1
+++ cluster/group/gfs_controld/cpg.c 2006/11/30 19:50:20 1.9.4.2
@@ -15,10 +15,6 @@
static cpg_handle_t daemon_handle;
static struct cpg_name daemon_name;
-static int got_msg;
-static int saved_nodeid;
-static int saved_len;
-static char saved_data[MAX_MSGLEN];
int message_flow_control_on;
void receive_journals(struct mountgroup *mg, char *buf, int len, int from);
@@ -113,10 +109,7 @@
void deliver_cb(cpg_handle_t handle, struct cpg_name *group_name,
uint32_t nodeid, uint32_t pid, void *data, int data_len)
{
- saved_nodeid = nodeid;
- saved_len = data_len;
- memcpy(saved_data, data, data_len);
- got_msg = 1;
+ do_deliver(nodeid, data, data_len);
}
void confchg_cb(cpg_handle_t handle, struct cpg_name *group_name,
@@ -143,11 +136,14 @@
}
if (flow_control_state == CPG_FLOW_CONTROL_ENABLED) {
+ if (message_flow_control_on == 0) {
+ log_debug("flow control on");
+ }
message_flow_control_on = 1;
- log_debug("flow control on");
} else {
- if (message_flow_control_on)
+ if (message_flow_control_on) {
log_debug("flow control off");
+ }
message_flow_control_on = 0;
}
}
@@ -156,20 +152,12 @@
{
cpg_error_t error;
- got_msg = 0;
- saved_len = 0;
- saved_nodeid = 0;
- memset(saved_data, 0, sizeof(saved_data));
-
- error = cpg_dispatch(daemon_handle, CPG_DISPATCH_ONE);
+ error = cpg_dispatch(daemon_handle, CPG_DISPATCH_ALL);
if (error != CPG_OK) {
log_error("cpg_dispatch error %d", error);
return -1;
}
- if (got_msg)
- do_deliver(saved_nodeid, saved_data, saved_len);
-
update_flow_control_status();
return 0;
^ permalink raw reply [flat|nested] 3+ messages in thread* [Cluster-devel] cluster/group/gfs_controld cpg.c
@ 2006-11-30 19:49 teigland
0 siblings, 0 replies; 3+ messages in thread
From: teigland @ 2006-11-30 19:49 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: teigland at sourceware.org 2006-11-30 19:49:36
Modified files:
group/gfs_controld: cpg.c
Log message:
From: Steven Dake
We dispatch in the dispatch handler now instead of saving the
data. Also we use dispatch all which will basically try to dispatch all
messages possible in one go instead of only dispatching on each loop
through poll.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/cpg.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.9.2.1&r2=1.9.2.2
--- cluster/group/gfs_controld/cpg.c 2006/11/20 21:10:28 1.9.2.1
+++ cluster/group/gfs_controld/cpg.c 2006/11/30 19:49:36 1.9.2.2
@@ -15,10 +15,6 @@
static cpg_handle_t daemon_handle;
static struct cpg_name daemon_name;
-static int got_msg;
-static int saved_nodeid;
-static int saved_len;
-static char saved_data[MAX_MSGLEN];
int message_flow_control_on;
void receive_journals(struct mountgroup *mg, char *buf, int len, int from);
@@ -113,10 +109,7 @@
void deliver_cb(cpg_handle_t handle, struct cpg_name *group_name,
uint32_t nodeid, uint32_t pid, void *data, int data_len)
{
- saved_nodeid = nodeid;
- saved_len = data_len;
- memcpy(saved_data, data, data_len);
- got_msg = 1;
+ do_deliver(nodeid, data, data_len);
}
void confchg_cb(cpg_handle_t handle, struct cpg_name *group_name,
@@ -143,11 +136,14 @@
}
if (flow_control_state == CPG_FLOW_CONTROL_ENABLED) {
+ if (message_flow_control_on == 0) {
+ log_debug("flow control on");
+ }
message_flow_control_on = 1;
- log_debug("flow control on");
} else {
- if (message_flow_control_on)
+ if (message_flow_control_on) {
log_debug("flow control off");
+ }
message_flow_control_on = 0;
}
}
@@ -156,20 +152,12 @@
{
cpg_error_t error;
- got_msg = 0;
- saved_len = 0;
- saved_nodeid = 0;
- memset(saved_data, 0, sizeof(saved_data));
-
- error = cpg_dispatch(daemon_handle, CPG_DISPATCH_ONE);
+ error = cpg_dispatch(daemon_handle, CPG_DISPATCH_ALL);
if (error != CPG_OK) {
log_error("cpg_dispatch error %d", error);
return -1;
}
- if (got_msg)
- do_deliver(saved_nodeid, saved_data, saved_len);
-
update_flow_control_status();
return 0;
^ permalink raw reply [flat|nested] 3+ messages in thread* [Cluster-devel] cluster/group/gfs_controld cpg.c
@ 2006-11-30 19:48 teigland
0 siblings, 0 replies; 3+ messages in thread
From: teigland @ 2006-11-30 19:48 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: teigland at sourceware.org 2006-11-30 19:48:43
Modified files:
group/gfs_controld: cpg.c
Log message:
From: Steven Dake
We dispatch in the dispatch handler now instead of saving the
data. Also we use dispatch all which will basically try to dispatch all
messages possible in one go instead of only dispatching on each loop
through poll.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/cpg.c.diff?cvsroot=cluster&r1=1.10&r2=1.11
--- cluster/group/gfs_controld/cpg.c 2006/11/20 21:07:18 1.10
+++ cluster/group/gfs_controld/cpg.c 2006/11/30 19:48:43 1.11
@@ -15,10 +15,6 @@
static cpg_handle_t daemon_handle;
static struct cpg_name daemon_name;
-static int got_msg;
-static int saved_nodeid;
-static int saved_len;
-static char saved_data[MAX_MSGLEN];
int message_flow_control_on;
void receive_journals(struct mountgroup *mg, char *buf, int len, int from);
@@ -113,10 +109,7 @@
void deliver_cb(cpg_handle_t handle, struct cpg_name *group_name,
uint32_t nodeid, uint32_t pid, void *data, int data_len)
{
- saved_nodeid = nodeid;
- saved_len = data_len;
- memcpy(saved_data, data, data_len);
- got_msg = 1;
+ do_deliver(nodeid, data, data_len);
}
void confchg_cb(cpg_handle_t handle, struct cpg_name *group_name,
@@ -143,11 +136,14 @@
}
if (flow_control_state == CPG_FLOW_CONTROL_ENABLED) {
+ if (message_flow_control_on == 0) {
+ log_debug("flow control on");
+ }
message_flow_control_on = 1;
- log_debug("flow control on");
} else {
- if (message_flow_control_on)
+ if (message_flow_control_on) {
log_debug("flow control off");
+ }
message_flow_control_on = 0;
}
}
@@ -156,20 +152,12 @@
{
cpg_error_t error;
- got_msg = 0;
- saved_len = 0;
- saved_nodeid = 0;
- memset(saved_data, 0, sizeof(saved_data));
-
- error = cpg_dispatch(daemon_handle, CPG_DISPATCH_ONE);
+ error = cpg_dispatch(daemon_handle, CPG_DISPATCH_ALL);
if (error != CPG_OK) {
log_error("cpg_dispatch error %d", error);
return -1;
}
- if (got_msg)
- do_deliver(saved_nodeid, saved_data, saved_len);
-
update_flow_control_status();
return 0;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-11-30 19:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-30 19:50 [Cluster-devel] cluster/group/gfs_controld cpg.c teigland
-- strict thread matches above, loose matches on Subject: below --
2006-11-30 19:49 teigland
2006-11-30 19:48 teigland
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.