[Sheepdog] [PATCH 5/7] sheep: remove message state
MORITA Kazutaka
morita.kazutaka at lab.ntt.co.jp
Wed Oct 12 15:22:17 CEST 2011
There is no multi phases events now, so we don't need a message state.
Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
sheep/group.c | 20 +++-----------------
1 files changed, 3 insertions(+), 17 deletions(-)
diff --git a/sheep/group.c b/sheep/group.c
index f9958c3..d6bcef3 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -29,16 +29,9 @@ struct node {
struct list_head list;
};
-enum deliver_msg_state {
- DM_INIT = 1,
- DM_CONT,
- DM_FIN,
-};
-
struct message_header {
uint8_t proto_ver;
- uint8_t state;
- uint8_t pad[2];
+ uint8_t pad[3];
uint32_t msg_length;
struct sheepdog_node_list_entry from;
};
@@ -294,7 +287,6 @@ forward:
return;
}
- msg->header.state = DM_FIN;
msg->header.msg_length = sizeof(*msg) + hdr->data_length;
msg->header.from = sys->this_node;
msg->req = *((struct sd_vdi_req *)&req->rq);
@@ -860,8 +852,8 @@ static void sd_notify_handler(struct sheepdog_node_list_entry *sender,
struct message_header *m = msg;
char name[128];
- dprintf("state: %u, size: %d, from: %s, pid: %u\n",
- m->state, m->msg_length,
+ dprintf("size: %d, from: %s, pid: %u\n",
+ m->msg_length,
addr_to_str(name, sizeof(name), m->from.addr, m->from.port),
sender->port);
@@ -1008,7 +1000,6 @@ static int send_join_request(struct sheepdog_node_list_entry *ent)
memset(&msg, 0, sizeof(msg));
msg.header.proto_ver = SD_SHEEP_PROTO_VER;
- msg.header.state = DM_INIT;
msg.header.msg_length = sizeof(msg);
msg.header.from = *ent;
@@ -1115,12 +1106,8 @@ static void cpg_event_fn(struct work *work, int idx)
__sd_leave(cevent);
break;
case CPG_EVENT_NOTIFY:
- {
- struct work_notify *w = container_of(cevent, struct work_notify, cev);
- vprintf(SDOG_DEBUG "%d\n", w->msg->state);
__sd_notify(cevent);
break;
- }
case CPG_EVENT_REQUEST:
vprintf(SDOG_ERR "should not happen\n");
break;
@@ -1395,7 +1382,6 @@ static enum cluster_join_result sd_check_join_handler(struct sheepdog_node_list_
}
join(jm);
- m->state = DM_FIN;
dprintf("%d, %d\n", jm->result, jm->cluster_status);
if (jm->result == SD_RES_SUCCESS && jm->cluster_status != SD_STATUS_OK) {
--
1.7.2.5
More information about the sheepdog
mailing list