[sheepdog] [PATCH] sheep: rename check_request_in_recovery()

Liu Yuan namei.unix at gmail.com
Sat Jun 2 16:32:21 CEST 2012


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

As Christoph suggests and modifies it to return bool value.

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

diff --git a/sheep/sdnet.c b/sheep/sdnet.c
index afe1f41..78037ae 100644
--- a/sheep/sdnet.c
+++ b/sheep/sdnet.c
@@ -216,7 +216,7 @@ static int check_request_epoch(struct request *req)
 	return 0;
 }
 
-static int check_request_in_recovery(struct request *req)
+static bool request_in_recovery(struct request *req)
 {
 	if (is_recoverying_oid(req->local_oid)) {
 		if (req->rq.flags & SD_FLAG_CMD_RECOVERY) {
@@ -238,7 +238,7 @@ static int check_request_in_recovery(struct request *req)
 				list_add_tail(&req->request_list,
 					      &sys->wait_obj_queue);
 		}
-		return -1;
+		return 1;
 	}
 	return 0;
 }
@@ -328,7 +328,7 @@ static void queue_io_request(struct request *req)
 	if (req->local_oid) {
 		if (check_request_epoch(req) < 0)
 			return;
-		if (check_request_in_recovery(req) < 0)
+		if (request_in_recovery(req))
 			return;
 	}
 
@@ -351,7 +351,7 @@ static void queue_gateway_request(struct request *req)
 	    (!sys->enable_write_cache ||
 	     !(req->rq.flags & SD_FLAG_CMD_CACHE) ||
 	     !object_is_cached(req->rq.obj.oid))) {
-		if (check_request_in_recovery(req) < 0)
+		if (request_in_recovery(req))
 			return;
 	}
 
-- 
1.7.10.2




More information about the sheepdog mailing list