[Sheepdog] [PATCH 1/4] sheep: remove unnecessary code
Liu Yuan
namei.unix at gmail.com
Sat Mar 10 17:53:22 CET 2012
From: Liu Yuan <tailai.ly at taobao.com>
This code is never visited and acted as a safe guard, but the
uppper layer code should take responsibility of initializing
hdr->copies to avoid this redundant check in the hot path.
Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
sheep/store.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/sheep/store.c b/sheep/store.c
index 9f8a2c6..0a1932d 100644
--- a/sheep/store.c
+++ b/sheep/store.c
@@ -645,11 +645,6 @@ int store_create_and_write_obj(const struct sd_req *req, struct sd_rsp *rsp, voi
char *buf = NULL;
struct siocb iocb;
- if (!hdr->copies) {
- eprintf("the number of copies cannot be zero\n");
- return SD_RES_INVALID_PARMS;
- }
-
memset(&iocb, 0, sizeof(iocb));
iocb.epoch = epoch;
iocb.flags = hdr->flags;
--
1.7.8.2
More information about the sheepdog
mailing list