git » libjio » commit cacd803

libjio: Remove unused checksum_fd()

author Alberto Bertogli
2009-07-12 18:07:00 UTC
committer Alberto Bertogli
2009-07-12 18:07:00 UTC
parent cf556c751da0a1dec4d04c663ad1298f166b56f2

libjio: Remove unused checksum_fd()

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

libjio/checksum.c +0 -17
libjio/common.h +0 -1

diff --git a/libjio/checksum.c b/libjio/checksum.c
index 225a8af..252c03f 100644
--- a/libjio/checksum.c
+++ b/libjio/checksum.c
@@ -91,20 +91,3 @@ uint32_t checksum_buf(uint32_t crc32, const unsigned char *buf, size_t count)
 	return ~crc32;
 }
 
-/** Reads the contents of the given fd, up to len bytes, and stores the
- * checksum in csum. Returns 1 on success, 0 on error. */
-int checksum_fd(int fd, size_t len, uint32_t *csum)
-{
-	uint8_t *map;
-
-	map = (uint8_t *) mmap(NULL, len, PROT_READ, MAP_SHARED, fd, 0);
-	if (map == MAP_FAILED)
-		return 0;
-
-	*csum = checksum_buf(0, map, len);
-
-	munmap(map, len);
-	return 1;
-}
-
-
diff --git a/libjio/common.h b/libjio/common.h
index d0f3ad8..512355a 100644
--- a/libjio/common.h
+++ b/libjio/common.h
@@ -77,7 +77,6 @@ void get_jtfile(struct jfs *fs, unsigned int tid, char *jtfile);
 uint64_t ntohll(uint64_t x);
 uint64_t htonll(uint64_t x);
 
-int checksum_fd(int fd, size_t len, uint32_t *csum);
 uint32_t checksum_buf(uint32_t sum, const unsigned char *buf, size_t count);
 
 void autosync_check(struct jfs *fs);