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

Christoph Hellwig hch at infradead.org
Fri Jul 13 10:35:59 CEST 2012


I don't quite understand the subject line,

what does " for just one time" mean here?  From my reading of the patch
we always do it.

> +static int do_cow_at_local(struct request *req, struct sd_req *cow_hdr)

I'd call this gateway_handle_copy_on_write or similar.

> @@ -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;
> +		}
> +	}

If you initialize the forward hdr after the COW this code would be quite
a bit simpler.




More information about the sheepdog mailing list