[sheepdog] [PATCH] sheep: cleanup string format for epoch

Liu Yuan namei.unix at gmail.com
Mon Aug 27 12:29:27 CEST 2012


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

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/ops.c         |    2 +-
 sheep/plain_store.c |    2 +-
 sheep/request.c     |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sheep/ops.c b/sheep/ops.c
index 499c773..4afd0a2 100644
--- a/sheep/ops.c
+++ b/sheep/ops.c
@@ -1222,7 +1222,7 @@ void do_process_work(struct work *work)
 	struct request *req = container_of(work, struct request, work);
 	int ret = SD_RES_SUCCESS;
 
-	dprintf("%x, %" PRIx64" , %u\n",
+	dprintf("%x, %" PRIx64", %"PRIu32"\n",
 		req->rq.opcode, req->rq.obj.oid, req->rq.epoch);
 
 	if (req->op->process_work)
diff --git a/sheep/plain_store.c b/sheep/plain_store.c
index f79a7ac..26aa6dc 100644
--- a/sheep/plain_store.c
+++ b/sheep/plain_store.c
@@ -44,7 +44,7 @@ static int get_tmp_obj_path(uint64_t oid, char *path)
 
 static int get_stale_obj_path(uint64_t oid, uint32_t epoch, char *path)
 {
-	return sprintf(path, "%s/%016"PRIx64".%d", stale_dir, oid, epoch);
+	return sprintf(path, "%s/%016"PRIx64".%"PRIx32, stale_dir, oid, epoch);
 }
 
 int for_each_object_in_wd(int (*func)(uint64_t oid, void *arg), void *arg)
diff --git a/sheep/request.c b/sheep/request.c
index ce4315b..5981e14 100644
--- a/sheep/request.c
+++ b/sheep/request.c
@@ -80,7 +80,7 @@ static void gateway_op_done(struct work *work)
 	case SD_RES_WAIT_FOR_FORMAT:
 	case SD_RES_KILLED:
 		dprintf("retrying failed I/O request "
-			"op %s result %d epoch %d, sys epoch %d\n",
+			"op %s result %x epoch %"PRIu32", sys epoch %"PRIu32"\n",
 			op_name(req->op),
 			req->rp.result,
 			req->rq.epoch,
-- 
1.7.10.2




More information about the sheepdog mailing list