[sheepdog] [PATCH 1/2] sheep: always route request to cache layer when cache is enabled

Liu Yuan namei.unix at gmail.com
Thu Aug 2 05:43:03 CEST 2012


From: Liu Yuan <tailai.ly at taobao.com>

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/request.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sheep/request.c b/sheep/request.c
index 0fa5795..1f0f9a8 100644
--- a/sheep/request.c
+++ b/sheep/request.c
@@ -274,11 +274,11 @@ static void queue_gateway_request(struct request *req)
 		req->local_oid = hdr->obj.oid;
 
 	/*
-	 * If we go for a cached object, we don't care if it is being recovered
+	 * If we go for cache object, we don't care if it is being recovered
+	 * Even if it doesn't exist in cache, we'll rely on cache layer to pull
+	 * it.
 	 */
-	if (sys->enable_write_cache &&
-	    req->rq.flags & SD_FLAG_CMD_CACHE &&
-	    object_is_cached(req->rq.obj.oid))
+	if (sys->enable_write_cache && req->rq.flags & SD_FLAG_CMD_CACHE)
 		goto queue_work;
 
 	if (req->local_oid)
-- 
1.7.10.2




More information about the sheepdog mailing list