[sheepdog] [PATCH v2 2/3] object_cache: fix dirty bitmap size

MORITA Kazutaka morita.kazutaka at gmail.com
Thu Aug 8 10:39:36 CEST 2013


From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>

The type of bitmap for object cache is not unsigned long, but uint64_t.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/object_cache.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sheep/object_cache.c b/sheep/object_cache.c
index 9bdd4e2..8c602a1 100644
--- a/sheep/object_cache.c
+++ b/sheep/object_cache.c
@@ -125,7 +125,7 @@ static inline size_t get_cache_block_size(uint64_t oid)
 static uint64_t calc_object_bmap(uint64_t oid, size_t len, off_t offset)
 {
 	int start, end, nr;
-	unsigned long bmap = 0;
+	uint64_t bmap = 0;
 	size_t bsize = get_cache_block_size(oid);
 
 	start = offset / bsize;
@@ -135,7 +135,7 @@ static uint64_t calc_object_bmap(uint64_t oid, size_t len, off_t offset)
 	while (nr--)
 		set_bit(start + nr, &bmap);
 
-	return (uint64_t)bmap;
+	return bmap;
 }
 
 static inline void get_cache_entry(struct object_cache_entry *entry)
-- 
1.7.9.5




More information about the sheepdog mailing list