[sheepdog] [PATCH 4/6] sheep: use the specified copies number for IO requests
Liu Yuan
namei.unix at gmail.com
Mon Aug 6 08:56:56 CEST 2012
On 08/06/2012 01:59 PM, levin li wrote:
>
> + int nr_copies = req->rq.obj.copies;
This assignment is redundant, since later we already call get_req_copy()
for it.
> struct write_info wi;
> struct sd_op_template *op;
> struct sd_req hdr;
> @@ -245,7 +245,7 @@ static int gateway_forward_request(struct request *req)
>
> write_info_init(&wi);
> wlen = hdr.data_length;
> - nr_copies = get_nr_copies(req->vinfo);
> + nr_copies = get_req_copies(req);
> index efaf979..4037dd5 100644
> --- a/sheep/ops.c
> +++ b/sheep/ops.c
> @@ -654,7 +654,7 @@ static int read_copy_from_replica(struct vnode_info *vnodes, uint32_t epoch,
> char name[128];
> int rounded_rand, local = -1;
>
> - nr_copies = get_nr_copies(vnodes);
> + nr_copies = get_obj_copies(oid);
> oid_to_vnodes(vnodes->vnodes, vnodes->nr_vnodes, oid,
> nr_copies, obj_vnodes);
>
> diff --git a/sheep/recovery.c b/sheep/recovery.c
> index 5164aa7..6919b64 100644
> --- a/sheep/recovery.c
> +++ b/sheep/recovery.c
> @@ -172,7 +172,7 @@ again:
> oid, tgt_epoch);
>
> /* Let's do a breadth-first search */
> - nr_copies = get_nr_copies(old);
> + nr_copies = get_obj_copies(nr_copies);
I guess you meant get_obj_copies(oid)
Thanks,
Yuan
More information about the sheepdog
mailing list