[sheepdog] [PATCH v3 4/8] sheep: refactor forward_write_obj_req()

Christoph Hellwig hch at infradead.org
Tue Jun 26 12:02:37 CEST 2012


> +static void init_write_info(struct write_info *wi)
> +{
> +	int i;
> +	for (i = 0; i < SD_MAX_REDUNDANCY; i++) {
> +		wi->pfds[i].fd = -1;
> +		wi->vnodes[i] = NULL;
> +	}
> +	wi->nr_sent = 0;

Oh you actually add this helper here - I thin it should be there
from the beginning.

> @@ -121,107 +207,51 @@ int forward_write_obj_req(struct request *req)
>  	oid_to_vnodes(req->vnodes, oid, nr_copies, obj_vnodes);
>  	for (i = 0; i < nr_copies; i++) {
>  		v = obj_vnodes[i];
> +		if (!vnode_is_local(v))
>  			continue;
>  		ret = do_local_io(req, fwd_hdr.epoch);

Any reason you start the local I/O before the remote one?  Usually
local I/O will be faster, so kicking off the remote I/O first and then
the local I/O will deliver better latency.




More information about the sheepdog mailing list