[Sheepdog] [PATCH] sheep: remove useless code in do_local_io()
Liu Yuan
namei.unix at gmail.com
Mon Feb 27 13:17:22 CET 2012
From: Liu Yuan <tailai.ly at taobao.com>
We don't need to read old epoch in the case of SD_RES_NO_OBJ
since do_recover_object() already does this.
Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
sheep/store.c | 13 +------------
1 files changed, 1 insertions(+), 12 deletions(-)
diff --git a/sheep/store.c b/sheep/store.c
index 273f234..086dbac 100644
--- a/sheep/store.c
+++ b/sheep/store.c
@@ -661,22 +661,11 @@ out:
static int do_local_io(struct request *req, uint32_t epoch)
{
struct sd_obj_req *hdr = (struct sd_obj_req *)&req->rq;
- int ret = SD_RES_SUCCESS;
hdr->epoch = epoch;
dprintf("%x, %" PRIx64" , %u\n", hdr->opcode, hdr->oid, epoch);
- ret = do_process_work(req->op, &req->rq, &req->rp, req);
-
- if (ret == SD_RES_NO_OBJ && hdr->flags & SD_FLAG_CMD_RECOVERY) {
- struct sd_obj_rsp *rsp = (struct sd_obj_rsp *)&req->rp;
- int len = epoch_log_read(epoch - 1, req->data, hdr->data_length);
- if (len < 0)
- len = 0;
- rsp->data_length = len;
- }
-
- return ret;
+ return do_process_work(req->op, &req->rq, &req->rp, req);
}
static int fix_object_consistency(struct request *req)
--
1.7.8.2
More information about the sheepdog
mailing list