[sheepdog] [PATCH 2/4] farm: clean up trunk.c

Liu Yuan namei.unix at gmail.com
Tue Jul 16 11:30:19 CEST 2013


Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 collie/farm/farm.h  |    1 -
 collie/farm/trunk.c |    4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/collie/farm/farm.h b/collie/farm/farm.h
index b2d82ed..129903e 100644
--- a/collie/farm/farm.h
+++ b/collie/farm/farm.h
@@ -52,7 +52,6 @@ char *get_object_directory(void);
 int trunk_init(void);
 int trunk_file_write(uint64_t nr_entries, struct trunk_entry *entries,
 		     unsigned char *trunk_sha1);
-struct trunk_file *trunk_file_read(unsigned char *sha1);
 int for_each_entry_in_trunk(unsigned char *trunk_sha1,
 			    int (*func)(struct trunk_entry *entry, void *data),
 			    void *data);
diff --git a/collie/farm/trunk.c b/collie/farm/trunk.c
index df1813b..4d39084 100644
--- a/collie/farm/trunk.c
+++ b/collie/farm/trunk.c
@@ -35,7 +35,7 @@ int trunk_file_write(uint64_t nr_entries, struct trunk_entry *entries,
 	return sha1_file_write(entries, size, trunk_sha1);
 }
 
-struct trunk_file *trunk_file_read(unsigned char *sha1)
+static struct trunk_file *trunk_file_read(unsigned char *sha1)
 {
 	size_t size;
 	struct trunk_file *trunk = NULL;
@@ -45,7 +45,7 @@ struct trunk_file *trunk_file_read(unsigned char *sha1)
 		return NULL;
 	trunk = xmalloc(sizeof(struct trunk_file));
 	trunk->nr_entries = size / sizeof(struct trunk_entry);
-	trunk->entries = (struct trunk_entry *)buf;
+	trunk->entries = buf;
 
 	return trunk;
 }
-- 
1.7.9.5




More information about the sheepdog mailing list