<div dir="ltr"><div style="text-align:left">Reviewed-by: Robin Dong <<a href="mailto:sanbai@taobao.com">sanbai@taobao.com</a>></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/12/16 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>
Reviewed-by: Robin Dong <<a href="mailto:sanbai@taobao.com">sanbai@taobao.com</a>><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 | 40 ++++++++++++++++++++++++++++++++++++++<br>
sheep/http/kv.c | 2 +-<br>
sheep/http/kv.h | 55 ----------------------------------------------------<br>
sheep/http/s3.c | 1 -<br>
sheep/http/swift.c | 1 -<br>
6 files changed, 42 insertions(+), 59 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 a8527d1..e541d0e 100644<br>
--- a/sheep/http/http.h<br>
+++ b/sheep/http/http.h<br>
@@ -109,6 +109,46 @@ int http_request_writes(struct http_request *req, const char *str);<br>
__printf(2, 3)<br>
int http_request_writef(struct http_request *req, const char *fmt, ...);<br>
<br>
+/* For kv.c */<br>
+<br>
+#define SD_MAX_BUCKET_NAME 64<br>
+#define SD_MAX_OBJECT_NAME 1024<br>
+<br>
+/* Account operations */<br>
+int kv_create_account(const char *account);<br>
+int kv_read_account(const char *account, uint32_t *nr_buckets);<br>
+int kv_update_account(const char *account);<br>
+int kv_delete_account(const char *account);<br>
+int kv_list_accounts(struct http_request *req,<br>
+ void (*cb)(struct http_request *req, const char *account,<br>
+ void *opaque),<br>
+ void *opaque);<br>
+<br>
+/* Bucket operations */<br>
+int kv_create_bucket(const char *account, const char *bucket);<br>
+int kv_read_bucket(const char *account, const char *bucket);<br>
+int kv_update_bucket(const char *account, const char *bucket);<br>
+int kv_delete_bucket(const char *account, const char *bucket);<br>
+int kv_list_buckets(struct http_request *req, const char *account,<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 *account,<br>
+ const char *bucket, const char *object);<br>
+int kv_read_object(struct http_request *req, const char *account,<br>
+ const char *bucket, 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 *account,<br>
+ const char *bucket, const char *object);<br>
+int kv_list_objects(struct http_request *req, const char *account,<br>
+ const char *bucket,<br>
+ void (*cb)(struct http_request *req, const char *bucket,<br>
+ const char *object, void *opaque),<br>
+ void *opaque);<br>
+<br>
/* object_allocator.c */<br>
int oalloc_new_prepare(uint32_t vid, uint64_t *start, uint64_t count);<br>
int oalloc_new_finish(uint32_t vid, uint64_t start, uint64_t count);<br>
diff --git a/sheep/http/kv.c b/sheep/http/kv.c<br>
index 8dc4db8..cc95995 100644<br>
--- a/sheep/http/kv.c<br>
+++ b/sheep/http/kv.c<br>
@@ -14,7 +14,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 4ccb716..0000000<br>
--- a/sheep/http/kv.h<br>
+++ /dev/null<br>
@@ -1,55 +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 64<br>
-#define SD_MAX_OBJECT_NAME 1024<br>
-<br>
-/* Account operations */<br>
-int kv_create_account(const char *account);<br>
-int kv_read_account(const char *account, uint32_t *nr_buckets);<br>
-int kv_update_account(const char *account);<br>
-int kv_delete_account(const char *account);<br>
-int kv_list_accounts(struct http_request *req,<br>
- void (*cb)(struct http_request *req, const char *account,<br>
- void *opaque),<br>
- void *opaque);<br>
-<br>
-/* Bucket operations */<br>
-int kv_create_bucket(const char *account, const char *bucket);<br>
-int kv_read_bucket(const char *account, const char *bucket);<br>
-int kv_update_bucket(const char *account, const char *bucket);<br>
-int kv_delete_bucket(const char *account, const char *bucket);<br>
-int kv_list_buckets(struct http_request *req, const char *account,<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 *account,<br>
- const char *bucket, const char *object);<br>
-int kv_read_object(struct http_request *req, const char *account,<br>
- const char *bucket, 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 *account,<br>
- const char *bucket, const char *object);<br>
-int kv_list_objects(struct http_request *req, const char *account,<br>
- 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 8dde7f3..6a41308 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 d9f5a76..16ce8fb 100644<br>
--- a/sheep/http/swift.c<br>
+++ b/sheep/http/swift.c<br>
@@ -11,7 +11,6 @@<br>
<br>
#include "strbuf.h"<br>
#include "http.h"<br>
-#include "kv.h"<br>
<br>
#define HTTP_REMOVE_ACCOUNT "HTTP_X_REMOVE_ACCOUNT_META_BOOK"<br>
<span class="HOEnZb"><font color="#888888"><br>
--<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>