[sheepdog] [PATCH] sheep: remove unused field 'flags' in struct siocb

Liu Yuan namei.unix at gmail.com
Wed May 8 05:20:13 CEST 2013


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

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/ops.c         |    3 ---
 sheep/plain_store.c |   10 +++++-----
 sheep/sheep_priv.h  |    1 -
 3 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/sheep/ops.c b/sheep/ops.c
index 90f4b00..a3db005 100644
--- a/sheep/ops.c
+++ b/sheep/ops.c
@@ -916,7 +916,6 @@ int peer_read_obj(struct request *req)
 
 	memset(&iocb, 0, sizeof(iocb));
 	iocb.epoch = epoch;
-	iocb.flags = hdr->flags;
 	iocb.buf = req->data;
 	iocb.length = hdr->data_length;
 	iocb.offset = hdr->obj.offset;
@@ -954,7 +953,6 @@ int peer_write_obj(struct request *req)
 	uint64_t oid = hdr->obj.oid;
 
 	iocb.epoch = hdr->epoch;
-	iocb.flags = hdr->flags;
 	iocb.buf = req->data;
 	iocb.length = hdr->data_length;
 	iocb.offset = hdr->obj.offset;
@@ -974,7 +972,6 @@ int peer_create_and_write_obj(struct request *req)
 
 	memset(&iocb, 0, sizeof(iocb));
 	iocb.epoch = epoch;
-	iocb.flags = hdr->flags;
 	iocb.length = get_objsize(oid);
 	if (hdr->flags & SD_FLAG_CMD_COW) {
 		sd_dprintf("%" PRIx64 ", %" PRIx64, oid, hdr->obj.cow_oid);
diff --git a/sheep/plain_store.c b/sheep/plain_store.c
index 640f769..27bb4a7 100644
--- a/sheep/plain_store.c
+++ b/sheep/plain_store.c
@@ -18,7 +18,7 @@
 #include "sheep_priv.h"
 #include "config.h"
 
-static int get_open_flags(uint64_t oid, bool create, int fl)
+static int get_open_flags(uint64_t oid, bool create)
 {
 	int flags = O_DSYNC | O_RDWR;
 
@@ -90,7 +90,7 @@ static int err_to_sderr(char *path, uint64_t oid, int err)
 
 int default_write(uint64_t oid, const struct siocb *iocb)
 {
-	int flags = get_open_flags(oid, false, iocb->flags), fd,
+	int flags = get_open_flags(oid, false), fd,
 	    ret = SD_RES_SUCCESS;
 	char path[PATH_MAX];
 	ssize_t size;
@@ -171,7 +171,7 @@ int default_cleanup(void)
 static int init_vdi_state(uint64_t oid, char *wd)
 {
 	char path[PATH_MAX];
-	int fd, flags = get_open_flags(oid, false, 0), ret;
+	int fd, flags = get_open_flags(oid, false), ret;
 	struct sd_inode *inode = xzalloc(sizeof(*inode));
 
 	snprintf(path, sizeof(path), "%s/%016"PRIx64, wd, oid);
@@ -229,7 +229,7 @@ int default_init(void)
 static int default_read_from_path(uint64_t oid, char *path,
 				  const struct siocb *iocb)
 {
-	int flags = get_open_flags(oid, false, iocb->flags), fd,
+	int flags = get_open_flags(oid, false), fd,
 	    ret = SD_RES_SUCCESS;
 	ssize_t size;
 
@@ -292,7 +292,7 @@ int prealloc(int fd, uint32_t size)
 int default_create_and_write(uint64_t oid, const struct siocb *iocb)
 {
 	char path[PATH_MAX], tmp_path[PATH_MAX];
-	int flags = get_open_flags(oid, true, iocb->flags);
+	int flags = get_open_flags(oid, true);
 	int ret, fd;
 	uint32_t len = iocb->length;
 
diff --git a/sheep/sheep_priv.h b/sheep/sheep_priv.h
index d01d408..b9c5934 100644
--- a/sheep/sheep_priv.h
+++ b/sheep/sheep_priv.h
@@ -125,7 +125,6 @@ struct cluster_info {
 };
 
 struct siocb {
-	uint16_t flags;
 	uint32_t epoch;
 	void *buf;
 	uint32_t length;
-- 
1.7.9.5




More information about the sheepdog mailing list