throw away shouldn't be global but instead used per instance structure.
patch for whitetank.
Index: exec/totempg.c
===================================================================
--- exec/totempg.c (revision 1761)
+++ exec/totempg.c (working copy)
@@ -158,21 +158,20 @@
struct totem_config *totempg_totem_config;
+enum throw_away_mode {
+ THROW_AWAY_INACTIVE,
+ THROW_AWAY_ACTIVE
+};
+
struct assembly {
unsigned int nodeid;
unsigned char data[MESSAGE_SIZE_MAX];
int index;
unsigned char last_frag_num;
+ enum throw_away_mode throw_away_mode;
struct list_head list;
};
-enum throw_away_mode_t {
- THROW_AWAY_INACTIVE,
- THROW_AWAY_ACTIVE
-};
-
-static enum throw_away_mode_t throw_away_mode = THROW_AWAY_INACTIVE;
-
DECLARE_LIST_INIT(assembly_list_inuse);
DECLARE_LIST_INIT(assembly_list_free);
@@ -265,6 +264,10 @@
list_del (&assembly->list);
list_add (&assembly->list, &assembly_list_inuse);
assembly->nodeid = nodeid;
+ assembly->index = 0;
+ assembly->last_frag_num = 0;
+ assembly->throw_away_mode = THROW_AWAY_INACTIVE;
+
return (assembly);
}
@@ -278,6 +281,9 @@
*/
assert (assembly);
assembly->nodeid = nodeid;
+ assembly->index = 0;
+ assembly->last_frag_num = 0;
+ assembly->throw_away_mode = THROW_AWAY_INACTIVE;
list_init (&assembly->list);
list_add (&assembly->list, &assembly_list_inuse);
@@ -569,10 +575,10 @@
*/
start = 0;
- if (throw_away_mode == THROW_AWAY_ACTIVE) {
+ if (assembly->throw_away_mode == THROW_AWAY_ACTIVE) {
/* Throw away the first msg block */
if (mcast->fragmented == 0 || mcast->fragmented == 1) {
- throw_away_mode = THROW_AWAY_INACTIVE;
+ assembly->throw_away_mode = THROW_AWAY_INACTIVE;
assembly->index += msg_lens[0];
iov_delv.iov_base = &assembly->data[assembly->index];
@@ -580,7 +586,7 @@
start = 1;
}
} else
- if (throw_away_mode == THROW_AWAY_INACTIVE) {
+ if (assembly->throw_away_mode == THROW_AWAY_INACTIVE) {
if (continuation == assembly->last_frag_num) {
assembly->last_frag_num = mcast->fragmented;
for (i = start; i < msg_count; i++) {
@@ -593,7 +599,7 @@
}
}
} else {
- throw_away_mode = THROW_AWAY_ACTIVE;
+ assembly->throw_away_mode = THROW_AWAY_ACTIVE;
}
}
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais