[sheepdog] [PATCH] sheep: do COW at local node for just one time

Liu Yuan namei.unix at gmail.com
Mon Jun 25 06:08:40 CEST 2012


On 06/21/2012 11:09 AM, yaohaiting.wujue at gmail.com wrote:
>  int forward_write_obj_req(struct request *req)
>  {
>  	int i, fd, ret, pollret;
> @@ -106,6 +144,14 @@ int forward_write_obj_req(struct request *req)
>  	memcpy(&fwd_hdr, &req->rq, sizeof(fwd_hdr));
>  	fwd_hdr.flags |= SD_FLAG_CMD_IO_LOCAL;
>  
> +	if (fwd_hdr.flags & SD_FLAG_CMD_COW) {
> +		ret = do_cow_at_local(req, &fwd_hdr);
> +		if (!ret) {
> +			fwd_hdr.flags &= ~SD_FLAG_CMD_COW;
> +			req->rq.flags &= ~SD_FLAG_CMD_COW;
> +		}
> +	}
> +
>  	wlen = fwd_hdr.data_length;

This optimization should be handled before forward_write_obj_req(),
which handles request forwarding only.

If we do an early COW object reading at gateway node, it seems we don't
need the COW code in store_create_and_write().

Thanks,
Yuan



More information about the sheepdog mailing list