[Sheepdog] [PATCH 1/2] rename SD_FLAG_CMD_FORWARD to SD_FLAG_CMD_DIRECT

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Thu May 6 10:12:08 CEST 2010


"SD_FLAG_CMD_FORWARD" name is confusing since we need to use
"SD_FLAG_CMD_FORWARD" for no-forwarded requests (for recovery, etc).

This patch renames SD_FLAG_CMD_FORWARD to
SD_FLAG_CMD_DIRECT. SD_FLAG_CMD_DIRECT means that the sender wants to
send a request to a node "directly".

Signed-off-by: FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp>
---
 collie/store.c           |   10 +++++-----
 include/sheepdog_proto.h |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/collie/store.c b/collie/store.c
index bf5824f..e18a091 100644
--- a/collie/store.c
+++ b/collie/store.c
@@ -395,7 +395,7 @@ static int forward_read_obj_req(struct request *req, char *buf)
 	if (!copies)
 		copies = sys->nr_sobjs;
 
-	hdr->flags |= SD_FLAG_CMD_FORWARD;
+	hdr->flags |= SD_FLAG_CMD_DIRECT;
 	hdr->epoch = sys->epoch;
 
 	/* TODO: we can do better; we need to check this first */
@@ -470,7 +470,7 @@ static int forward_write_obj_req(struct request *req, char *buf)
 	for (i = 0; i < ARRAY_SIZE(pfds); i++)
 		pfds[i].fd = -1;
 
-	hdr->flags |= SD_FLAG_CMD_FORWARD;
+	hdr->flags |= SD_FLAG_CMD_DIRECT;
 	hdr->epoch = sys->epoch;
 
 	wlen = hdr->data_length;
@@ -811,7 +811,7 @@ void store_queue_request(struct work *work, int idx)
 
 	dprintf("%d, %x, %" PRIx64" , %u, %u\n", idx, opcode, oid, epoch, req_epoch);
 
-	if (hdr->flags & SD_FLAG_CMD_FORWARD) {
+	if (hdr->flags & SD_FLAG_CMD_DIRECT) {
 		ret = check_epoch(req);
 		if (ret != SD_RES_SUCCESS)
 			goto out;
@@ -830,7 +830,7 @@ void store_queue_request(struct work *work, int idx)
 		goto out;
 	}
 
-	if (!(hdr->flags & SD_FLAG_CMD_FORWARD)) {
+	if (!(hdr->flags & SD_FLAG_CMD_DIRECT)) {
 		if (hdr->flags & SD_FLAG_CMD_WRITE)
 			ret = forward_write_obj_req(req, buf);
 		else
@@ -1150,7 +1150,7 @@ next:
 	hdr.opcode = SD_OP_READ_OBJ;
 	hdr.oid = oid;
 	hdr.epoch = sys->epoch;
-	hdr.flags = SD_FLAG_CMD_RECOVERY | SD_FLAG_CMD_FORWARD;
+	hdr.flags = SD_FLAG_CMD_RECOVERY | SD_FLAG_CMD_DIRECT;
 	hdr.tgt_epoch = tgt_epoch;
 	hdr.data_length = rlen;
 
diff --git a/include/sheepdog_proto.h b/include/sheepdog_proto.h
index bb14929..2cc4388 100644
--- a/include/sheepdog_proto.h
+++ b/include/sheepdog_proto.h
@@ -54,7 +54,7 @@
 
 #define SD_FLAG_CMD_WRITE    0x01
 #define SD_FLAG_CMD_COW      0x02
-#define SD_FLAG_CMD_FORWARD  0x04
+#define SD_FLAG_CMD_DIRECT   0x04
 #define SD_FLAG_CMD_RECOVERY 0x08
 
 #define SD_STATUS_OK            0x00
-- 
1.6.5




More information about the sheepdog mailing list