[Sheepdog] [PATCH 2/2] remove some whitespace and SD_RES_NO_OBJ check in do_local_io.

levin levin108 at gmail.com
Tue Feb 21 06:46:48 CET 2012


Sorry, the patch is just for testing, I sent to the wrong mail list, sorry
for my fault.

On Tuesday, February 21, 2012, Li Wenpeng wrote:

> From: levin li <levin108 at gmail.com <javascript:;>>
>
> ---
>  sheep/store.c |   16 +++-------------
>  1 files changed, 3 insertions(+), 13 deletions(-)
>
> diff --git a/sheep/store.c b/sheep/store.c
> index 59eba86..70b4df1 100644
> --- a/sheep/store.c
> +++ b/sheep/store.c
> @@ -244,14 +244,12 @@ static int forward_read_obj_req(struct request *req)
>                if (is_myself(e[n].addr, e[n].port)) {
>                        ret = do_local_io(req, hdr.epoch);
>
> -                       if (SD_RES_SUCCESS != ret &&
> -                       !(SD_RES_NO_OBJ == ret && hdr.flags &
> SD_FLAG_CMD_RECOVERY)) {
> -
> +                       if (SD_RES_SUCCESS != ret) {
>                                dprintf("%x, read object %" PRIx64" locally
> failed.\n",
>                                                hdr.opcode, oid);
>                                break;
>                        }
> -
> +
>                        goto out;
>                }
>        }
> @@ -273,7 +271,7 @@ fetch_again:
>        if (ret) { /* network errors */
>                del_sheep_fd(fd);
>
> -               copies_index ++;
> +               copies_index++;
>                if (copies_index < copies) {
>                        goto fetch_again;
>                }
> @@ -684,14 +682,6 @@ static int do_local_io(struct request *req, uint32_t
> epoch)
>
>        ret = do_process_work(req->op, &req->rq, &req->rp, req);
>
> -       if (ret == SD_RES_NO_OBJ && hdr->flags & SD_FLAG_CMD_RECOVERY) {
> -               struct sd_obj_rsp *rsp = (struct sd_obj_rsp *)&req->rp;
> -               int len = epoch_log_read(epoch - 1, req->data,
> hdr->data_length);
> -               if (len < 0)
> -                       len = 0;
> -               rsp->data_length = len;
> -       }
> -
>        return ret;
>  }
>
> --
> 1.7.1
>
>

-- 
levin
basiccoder.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/sheepdog/attachments/20120221/239f0ffd/attachment-0003.html>


More information about the sheepdog mailing list