[Sheepdog] [PATCH 12/18] collie: support safely shutdown
MORITA Kazutaka
morita.kazutaka at lab.ntt.co.jp
Thu Mar 11 07:48:11 CET 2010
Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
collie/group.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/collie/group.c b/collie/group.c
index 01b51f8..7dbbe9e 100644
--- a/collie/group.c
+++ b/collie/group.c
@@ -804,6 +804,8 @@ static void vdi_op(struct vdi_op_message *msg)
case SD_OP_MAKE_FS:
ret = make_super_object(&msg->req);
break;
+ case SD_OP_SHUTDOWN:
+ break;
default:
ret = SD_RES_SYSTEM_ERROR;
eprintf("opcode %d is not implemented\n", hdr->opcode);
@@ -862,6 +864,8 @@ static void vdi_op_done(struct vdi_op_message *msg)
eprintf("%d\n", sys->nr_sobjs);
}
+ case SD_OP_SHUTDOWN:
+ sys->status = SD_STATUS_SHUTDOWN;
break;
default:
eprintf("unknown operation %d\n", hdr->opcode);
@@ -1106,6 +1110,9 @@ static void sd_confch(cpg_handle_t handle, const struct cpg_name *group_name,
member_list[i].reason);
}
+ if (sys->status & SD_STATUS_SHUTDOWN_MASK || sys->status & SD_STATUS_ERROR_MASK)
+ return;
+
w = zalloc(sizeof(*w));
if (!w)
return;
--
1.5.6.5
More information about the sheepdog
mailing list