[Sheepdog] [PATCH] sheep: rename SD_FLAG_CMD_DIRECT
MORITA Kazutaka
morita.kazutaka at lab.ntt.co.jp
Mon Oct 24 06:12:25 CEST 2011
At Fri, 21 Oct 2011 11:44:41 +0800,
Liu Yuan wrote:
>
> From: Liu Yuan <tailai.ly at taobao.com>
>
> Based on the devel branch.
> ----8>--------------8>----
>
> Change SD_FLAG_CMD_DIRECT into SD_FLAG_CMD_IO_LOCAL to make it more
> descriptive.
>
> Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
> ---
> collie/common.c | 4 ++--
> collie/vdi.c | 2 +-
> include/sheep.h | 2 +-
> sheep/group.c | 6 +++---
> sheep/sdnet.c | 12 ++++++------
> sheep/store.c | 10 +++++-----
> 6 files changed, 18 insertions(+), 18 deletions(-)
Applied, thanks!
When you add texts which should not go to the commit message, would
put them below '---' next time so that git-am can remove them?
Thanks,
Kazutaka
>
> diff --git a/collie/common.c b/collie/common.c
> index e139dfb..0653b72 100644
> --- a/collie/common.c
> +++ b/collie/common.c
> @@ -67,7 +67,7 @@ int sd_read_object(uint64_t oid, void *data, unsigned int datalen,
> hdr.opcode = SD_OP_READ_OBJ;
> hdr.oid = oid;
> /* use direct to avoid checking consistency */
> - hdr.flags = SD_FLAG_CMD_DIRECT;
> + hdr.flags = SD_FLAG_CMD_IO_LOCAL;
> hdr.data_length = rlen;
> hdr.offset = offset;
>
> @@ -112,7 +112,7 @@ int sd_write_object(uint64_t oid, uint64_t cow_oid, void *data, unsigned int dat
> hdr.cow_oid = cow_oid;
> hdr.copies = copies;
> hdr.data_length = wlen;
> - hdr.flags = (flags & ~SD_FLAG_CMD_DIRECT) | SD_FLAG_CMD_WRITE;
> + hdr.flags = (flags & ~SD_FLAG_CMD_IO_LOCAL) | SD_FLAG_CMD_WRITE;
> hdr.offset = offset;
>
> ret = exec_req(fd, (struct sd_req *)&hdr, data, &wlen, &rlen);
> diff --git a/collie/vdi.c b/collie/vdi.c
> index e8fe129..c582654 100644
> --- a/collie/vdi.c
> +++ b/collie/vdi.c
> @@ -273,7 +273,7 @@ static void parse_objs(uint64_t oid, obj_parser_func_t func, void *data)
>
> hdr.opcode = SD_OP_READ_OBJ;
> hdr.data_length = rlen;
> - hdr.flags = SD_FLAG_CMD_DIRECT;
> + hdr.flags = SD_FLAG_CMD_IO_LOCAL;
> hdr.oid = oid;
> hdr.epoch = node_list_version;
>
> diff --git a/include/sheep.h b/include/sheep.h
> index 3e5458e..e06d34b 100644
> --- a/include/sheep.h
> +++ b/include/sheep.h
> @@ -37,7 +37,7 @@
> #define SD_OP_KILL_NODE 0x88
> #define SD_OP_GET_VDI_ATTR 0x89
>
> -#define SD_FLAG_CMD_DIRECT 0x0010
> +#define SD_FLAG_CMD_IO_LOCAL 0x0010
> #define SD_FLAG_CMD_RECOVERY 0x0020
>
> /* flags for vdi attribute operations */
> diff --git a/sheep/group.c b/sheep/group.c
> index 2f6c4e5..e22dabc 100644
> --- a/sheep/group.c
> +++ b/sheep/group.c
> @@ -1233,7 +1233,7 @@ do_retry:
> copies = req->nr_zones;
>
> if (__is_access_to_recoverying_objects(req)) {
> - if (req->rq.flags & SD_FLAG_CMD_DIRECT) {
> + if (req->rq.flags & SD_FLAG_CMD_IO_LOCAL) {
> req->rp.result = SD_RES_NEW_NODE_VER;
> sys->nr_outstanding_io++; /* TODO: cleanup */
> list_add_tail(&req->r_wlist, &failed_req_list);
> @@ -1263,7 +1263,7 @@ do_retry:
> }
> }
>
> - if (!(req->rq.flags & SD_FLAG_CMD_DIRECT) &&
> + if (!(req->rq.flags & SD_FLAG_CMD_IO_LOCAL) &&
> req->rq.opcode == SD_OP_READ_OBJ) {
> struct sd_obj_req *hdr = (struct sd_obj_req *)&req->rq;
> uint32_t vdi_id = oid_to_vid(hdr->oid);
> @@ -1284,7 +1284,7 @@ do_retry:
>
> if (is_cluster_request(req->rq.opcode))
> queue_work(sys->cpg_wqueue, &req->work);
> - else if (req->rq.flags & SD_FLAG_CMD_DIRECT)
> + else if (req->rq.flags & SD_FLAG_CMD_IO_LOCAL)
> queue_work(sys->io_wqueue, &req->work);
> else
> queue_work(sys->gateway_wqueue, &req->work);
> diff --git a/sheep/sdnet.c b/sheep/sdnet.c
> index 817df84..474b1be 100644
> --- a/sheep/sdnet.c
> +++ b/sheep/sdnet.c
> @@ -101,7 +101,7 @@ static void setup_access_to_local_objects(struct request *req)
> struct sd_obj_req *hdr = (struct sd_obj_req *)&req->rq;
> int copies;
>
> - if (hdr->flags & SD_FLAG_CMD_DIRECT) {
> + if (hdr->flags & SD_FLAG_CMD_IO_LOCAL) {
> req->local_oid = hdr->oid;
> return;
> }
> @@ -142,7 +142,7 @@ static void __done(struct work *work, int idx)
> * of sys->cpg_event_siblings.
> */
>
> - if (!(req->rq.flags & SD_FLAG_CMD_DIRECT) &&
> + if (!(req->rq.flags & SD_FLAG_CMD_IO_LOCAL) &&
> (req->rp.result == SD_RES_OLD_NODE_VER ||
> req->rp.result == SD_RES_NEW_NODE_VER ||
> req->rp.result == SD_RES_NETWORK_ERROR ||
> @@ -195,7 +195,7 @@ static void __done(struct work *work, int idx)
> eprintf("leave from cluster\n");
> leave_cluster();
>
> - if (req->rq.flags & SD_FLAG_CMD_DIRECT)
> + if (req->rq.flags & SD_FLAG_CMD_IO_LOCAL)
> /* hack to retry */
> req->rp.result = SD_RES_NETWORK_ERROR;
> else {
> @@ -310,7 +310,7 @@ static void queue_request(struct request *req)
> * start_cpg_event_work(that is, passing requests to work
> * threads).
> */
> - if (!(hdr->flags & SD_FLAG_CMD_DIRECT))
> + if (!(hdr->flags & SD_FLAG_CMD_IO_LOCAL))
> hdr->epoch = sys->epoch;
>
> setup_ordered_sd_vnode_list(req);
> @@ -687,7 +687,7 @@ int write_object(struct sheepdog_vnode_list_entry *e,
> hdr.copies = nr;
>
> hdr.flags = flags;
> - hdr.flags |= SD_FLAG_CMD_WRITE | SD_FLAG_CMD_DIRECT;
> + hdr.flags |= SD_FLAG_CMD_WRITE | SD_FLAG_CMD_IO_LOCAL;
> hdr.data_length = wlen;
> hdr.offset = offset;
>
> @@ -752,7 +752,7 @@ int read_object(struct sheepdog_vnode_list_entry *e,
> hdr.opcode = SD_OP_READ_OBJ;
> hdr.oid = oid;
>
> - hdr.flags = SD_FLAG_CMD_DIRECT;
> + hdr.flags = SD_FLAG_CMD_IO_LOCAL;
> hdr.data_length = rlen;
> hdr.offset = offset;
>
> diff --git a/sheep/store.c b/sheep/store.c
> index 3596ee0..bcf36a4 100644
> --- a/sheep/store.c
> +++ b/sheep/store.c
> @@ -203,7 +203,7 @@ static int read_from_one(struct request *req, uint32_t epoch, uint64_t oid,
>
> rlen = *ori_rlen;
> wlen = 0;
> - hdr.flags = SD_FLAG_CMD_DIRECT;
> + hdr.flags = SD_FLAG_CMD_IO_LOCAL;
> hdr.data_length = rlen;
> hdr.offset = offset;
>
> @@ -269,7 +269,7 @@ static int forward_read_obj_req(struct request *req, int idx)
> if (copies > req->nr_zones)
> copies = req->nr_zones;
>
> - hdr.flags |= SD_FLAG_CMD_DIRECT;
> + hdr.flags |= SD_FLAG_CMD_IO_LOCAL;
>
> /* TODO: we can do better; we need to check this first */
> for (i = 0; i < copies; i++) {
> @@ -334,7 +334,7 @@ static int forward_write_obj_req(struct request *req, int idx)
> for (i = 0; i < ARRAY_SIZE(pfds); i++)
> pfds[i].fd = -1;
>
> - hdr.flags |= SD_FLAG_CMD_DIRECT;
> + hdr.flags |= SD_FLAG_CMD_IO_LOCAL;
>
> wlen = hdr.data_length;
> rlen = 0;
> @@ -795,7 +795,7 @@ void store_queue_request(struct work *work, int idx)
> goto out;
> }
>
> - if (!(hdr->flags & SD_FLAG_CMD_DIRECT)) {
> + if (!(hdr->flags & SD_FLAG_CMD_IO_LOCAL)) {
> /* fix object consistency when we read the object for the first time */
> if (req->check_consistency) {
> ret = fix_object_consistency(req, idx);
> @@ -1298,7 +1298,7 @@ next:
> hdr.opcode = SD_OP_READ_OBJ;
> hdr.oid = oid;
> hdr.epoch = epoch;
> - hdr.flags = SD_FLAG_CMD_RECOVERY | SD_FLAG_CMD_DIRECT;
> + hdr.flags = SD_FLAG_CMD_RECOVERY | SD_FLAG_CMD_IO_LOCAL;
> hdr.tgt_epoch = tgt_epoch;
> hdr.data_length = rlen;
>
> --
> 1.7.6.1
>
> --
> sheepdog mailing list
> sheepdog at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/sheepdog
More information about the sheepdog
mailing list