<div dir="ltr">Reviewed-by: Robin Dong <<a href="mailto:sanbai@taobao.com">sanbai@taobao.com</a>></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/12/6 Liu Yuan <span dir="ltr"><<a href="mailto:namei.unix@gmail.com" target="_blank">namei.unix@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">No need to set up another .h file in sheep/http<br>
<br>
Signed-off-by: Liu Yuan <<a href="mailto:namei.unix@gmail.com">namei.unix@gmail.com</a>><br>
---<br>
sheep/Makefile.am | 2 +-<br>
sheep/http/http.h | 28 ++++++++++++++++++++++++++++<br>
sheep/http/kv.c | 2 +-<br>
sheep/http/kv.h | 44 --------------------------------------------<br>
sheep/http/s3.c | 1 -<br>
sheep/http/swift.c | 1 -<br>
6 files changed, 30 insertions(+), 48 deletions(-)<br>
delete mode 100644 sheep/http/kv.h<br>
<br>
diff --git a/sheep/Makefile.am b/sheep/Makefile.am<br>
index af1087f..3cfec53 100644<br>
--- a/sheep/Makefile.am<br>
+++ b/sheep/Makefile.am<br>
@@ -52,7 +52,7 @@ sheep_LDADD = ../lib/libsheepdog.a -lpthread -lm\<br>
sheep_DEPENDENCIES = ../lib/libsheepdog.a<br>
<br>
<br>
-noinst_HEADERS = sheep_priv.h cluster.h http/http.h http/kv.h trace/trace.h<br>
+noinst_HEADERS = sheep_priv.h cluster.h http/http.h trace/trace.h<br>
<br>
EXTRA_DIST =<br>
<br>
diff --git a/sheep/http/http.h b/sheep/http/http.h<br>
index 046d412..5849b7d 100644<br>
--- a/sheep/http/http.h<br>
+++ b/sheep/http/http.h<br>
@@ -114,4 +114,32 @@ int oalloc_new_finish(uint32_t vid, uint64_t start, uint64_t count);<br>
int oalloc_free(uint32_t vid, uint64_t start, uint64_t count);<br>
int oalloc_init(uint32_t vid);<br>
<br>
+/* for kv.c */<br>
+#define SD_MAX_BUCKET_NAME 1024<br>
+#define SD_MAX_OBJECT_NAME 1024<br>
+<br>
+/* Bucket operations */<br>
+int kv_create_bucket(struct http_request *req, const char *bucket);<br>
+int kv_read_bucket(struct http_request *req, const char *bucket);<br>
+int kv_update_bucket(struct http_request *req, const char *bucket);<br>
+int kv_delete_bucket(struct http_request *req, const char *bucket);<br>
+int kv_list_buckets(struct http_request *req,<br>
+ void (*cb)(struct http_request *req, const char *bucket,<br>
+ void *opaque),<br>
+ void *opaque);<br>
+<br>
+/* Object operations */<br>
+int kv_create_object(struct http_request *req, const char *bucket,<br>
+ const char *object);<br>
+int kv_read_object(struct http_request *req, const char *bucket,<br>
+ const char *object);<br>
+int kv_update_object(struct http_request *req, const char *bucket,<br>
+ const char *object);<br>
+int kv_delete_object(struct http_request *req, const char *bucket,<br>
+ const char *object);<br>
+int kv_list_objects(struct http_request *req, const char *bucket,<br>
+ void (*cb)(struct http_request *req, const char *bucket,<br>
+ const char *object, void *opaque),<br>
+ void *opaque);<br>
+<br>
#endif /* __SHEEP_HTTP_H__ */<br>
diff --git a/sheep/http/kv.c b/sheep/http/kv.c<br>
index 8113389..9281c6d 100644<br>
--- a/sheep/http/kv.c<br>
+++ b/sheep/http/kv.c<br>
@@ -12,7 +12,7 @@<br>
/* This file implements backend kv functions for object storage. */<br>
<br>
#include "sheep_priv.h"<br>
-#include "kv.h"<br>
+#include "http.h"<br>
<br>
#define FOR_EACH_VDI(nr, vdis) FOR_EACH_BIT(nr, vdis, SD_NR_VDIS)<br>
<br>
diff --git a/sheep/http/kv.h b/sheep/http/kv.h<br>
deleted file mode 100644<br>
index f0b09fe..0000000<br>
--- a/sheep/http/kv.h<br>
+++ /dev/null<br>
@@ -1,44 +0,0 @@<br>
-/*<br>
- * Copyright (C) 2013 MORITA Kazutaka <<a href="mailto:morita.kazutaka@gmail.com">morita.kazutaka@gmail.com</a>><br>
- *<br>
- * This program is free software; you can redistribute it and/or<br>
- * modify it under the terms of the GNU General Public License version<br>
- * 2 as published by the Free Software Foundation.<br>
- *<br>
- * You should have received a copy of the GNU General Public License<br>
- * along with this program. If not, see <<a href="http://www.gnu.org/licenses/" target="_blank">http://www.gnu.org/licenses/</a>>.<br>
- */<br>
-<br>
-#ifndef __SD_KV_H__<br>
-#define __SD_KV_H__<br>
-<br>
-#include "http.h"<br>
-<br>
-#define SD_MAX_BUCKET_NAME 1024<br>
-#define SD_MAX_OBJECT_NAME 1024<br>
-<br>
-/* Bucket operations */<br>
-int kv_create_bucket(struct http_request *req, const char *bucket);<br>
-int kv_read_bucket(struct http_request *req, const char *bucket);<br>
-int kv_update_bucket(struct http_request *req, const char *bucket);<br>
-int kv_delete_bucket(struct http_request *req, const char *bucket);<br>
-int kv_list_buckets(struct http_request *req,<br>
- void (*cb)(struct http_request *req, const char *bucket,<br>
- void *opaque),<br>
- void *opaque);<br>
-<br>
-/* Object operations */<br>
-int kv_create_object(struct http_request *req, const char *bucket,<br>
- const char *object);<br>
-int kv_read_object(struct http_request *req, const char *bucket,<br>
- const char *object);<br>
-int kv_update_object(struct http_request *req, const char *bucket,<br>
- const char *object);<br>
-int kv_delete_object(struct http_request *req, const char *bucket,<br>
- const char *object);<br>
-int kv_list_objects(struct http_request *req, const char *bucket,<br>
- void (*cb)(struct http_request *req, const char *bucket,<br>
- const char *object, void *opaque),<br>
- void *opaque);<br>
-<br>
-#endif /* __SD_KV_H__ */<br>
diff --git a/sheep/http/s3.c b/sheep/http/s3.c<br>
index ca2efe3..3d8914b 100644<br>
--- a/sheep/http/s3.c<br>
+++ b/sheep/http/s3.c<br>
@@ -10,7 +10,6 @@<br>
*/<br>
<br>
#include "http.h"<br>
-#include "kv.h"<br>
<br>
#define MAX_BUCKET_LISTING 1000<br>
<br>
diff --git a/sheep/http/swift.c b/sheep/http/swift.c<br>
index 7b3354a..6e122e2 100644<br>
--- a/sheep/http/swift.c<br>
+++ b/sheep/http/swift.c<br>
@@ -10,7 +10,6 @@<br>
*/<br>
<br>
#include "http.h"<br>
-#include "kv.h"<br>
<br>
static void make_bucket_path(char *bucket, size_t size, const char *account,<br>
const char *container)<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.9.5<br>
<br>
--<br>
sheepdog mailing list<br>
<a href="mailto:sheepdog@lists.wpkg.org">sheepdog@lists.wpkg.org</a><br>
<a href="http://lists.wpkg.org/mailman/listinfo/sheepdog" target="_blank">http://lists.wpkg.org/mailman/listinfo/sheepdog</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>--<br>Best Regard<br>Robin Dong
</div>