[sheepdog] [PATCH 1/3] sheep: use qemu cache option to use writeback/writethrough mode

MORITA Kazutaka morita.kazutaka at gmail.com
Fri Aug 31 03:06:41 CEST 2012


At Fri, 31 Aug 2012 08:50:26 +0800,
Liu Yuan wrote:
> 
> On 08/31/2012 08:14 AM, MORITA Kazutaka wrote:
> > I think running sheeps with '-w 50' and start a qemu with
> > 'cache=writethrough' will be what you want to do.
> 
> But it seems that your 1/3 patch doesn't do this way. -w xxx enables writeback
> mode for object cache.

No, in object_cache_handle_request(), this patch passes (hdr->flags &
SD_FLAG_CMD_CACHE) to write_cache_object().  If (hdr->flags &
SD_FLAG_CMD_CACHE) is false, it means that the request is in
writethrough mode and sheep push data to the backend storage in
write_cache_object().

 
 	if (hdr->flags & SD_FLAG_CMD_WRITE) {
-		ret = cache->write(entry, req->data, hdr->data_length,
-				   hdr->obj.offset, create);
+		ret = write_cache_object(entry, req->data, hdr->data_length,
+					 hdr->obj.offset, create,
+					 hdr->flags & SD_FLAG_CMD_CACHE);
 		if (ret != SD_RES_SUCCESS)



More information about the sheepdog mailing list