FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 01-18-2012, 03:39 PM
Andrew Price
 
Default fsck.gfs2: Remove unused hash.c, hash.h

The functions in hash.c aren't being used so it can be removed.

Signed-off-by: Andrew Price <anprice@redhat.com>
---
gfs2/fsck/Makefile.am | 4 +-
gfs2/fsck/hash.c | 93 ------------------------------------------------
gfs2/fsck/hash.h | 7 ----
gfs2/fsck/inode_hash.c | 1 -
gfs2/fsck/metawalk.c | 1 -
5 files changed, 2 insertions(+), 104 deletions(-)
delete mode 100644 gfs2/fsck/hash.c
delete mode 100644 gfs2/fsck/hash.h

diff --git a/gfs2/fsck/Makefile.am b/gfs2/fsck/Makefile.am
index e6a621f..261f6b1 100644
--- a/gfs2/fsck/Makefile.am
+++ b/gfs2/fsck/Makefile.am
@@ -10,10 +10,10 @@ sbindir := $(shell rpl=0; test '$(exec_prefix):$(sbindir)' = /usr:/usr/sbin

sbin_PROGRAMS = fsck.gfs2

-noinst_HEADERS = eattr.h fs_bits.h fsck.h fs_recovery.h hash.h
+noinst_HEADERS = eattr.h fs_bits.h fsck.h fs_recovery.h
inode_hash.h link.h lost_n_found.h metawalk.h util.h

-fsck_gfs2_SOURCES = eattr.c fs_recovery.c hash.c initialize.c
+fsck_gfs2_SOURCES = eattr.c fs_recovery.c initialize.c
inode_hash.c link.c lost_n_found.c main.c metawalk.c
pass1b.c pass1.c pass1c.c pass2.c pass3.c pass4.c
pass5.c rgrepair.c util.c
diff --git a/gfs2/fsck/hash.c b/gfs2/fsck/hash.c
deleted file mode 100644
index f55c2a7..0000000
--- a/gfs2/fsck/hash.c
+++ /dev/null
@@ -1,93 +0,0 @@
-#include "clusterautoconfig.h"
-
-/* This is the same hash algorithm used by the glocks in gfs */
-
-#include <stdint.h>
-#include <unistd.h>
-#include "libgfs2.h"
-#include "hash.h"
-#include "osi_list.h"
-
-/**
- * hash_more_internal - hash an array of data
- * @data: the data to be hashed
- * @len: the length of data to be hashed
- * @hash: the hash from a previous call
- *
- * Take some data and convert it to a 32-bit hash.
- *
- * This is the 32-bit FNV-1a hash from:
- * http://www.isthe.com/chongo/tech/comp/fnv/
- *
- * Hash guts
- *
- * Returns: the hash
- */
-
-static __inline__ uint32_t
-hash_more_internal(const void *data, unsigned int len, uint32_t hash)
-{
- unsigned char *p = (unsigned char *) data;
- unsigned char *e = p + len;
- uint32_t h = hash;
-
- while (p < e) {
- h ^= (uint32_t) (*p++);
- h *= 0x01000193;
- }
-
- return h;
-}
-
-/**
- * fsck_hash - hash an array of data
- * @data: the data to be hashed
- * @len: the length of data to be hashed
- *
- * Take some data and convert it to a 32-bit hash.
- *
- * This is the 32-bit FNV-1a hash from:
- * http://www.isthe.com/chongo/tech/comp/fnv/
- *
- * Returns: the hash
- */
-
-uint32_t
-fsck_hash(const void *data, unsigned int len)
-{
- uint32_t h = 0x811C9DC5;
- h = hash_more_internal(data, len, h);
- return h;
-}
-
-/**
- * fsck_hash_more - hash an array of data
- * @data: the data to be hashed
- * @len: the length of data to be hashed
- * @hash: the hash from a previous call
- *
- * Take some data and convert it to a 32-bit hash.
- *
- * This is the 32-bit FNV-1a hash from:
- * http://www.isthe.com/chongo/tech/comp/fnv/
- *
- * This version let's you hash together discontinuous regions.
- * For example, to compute the combined hash of the memory in
- * (data1, len1), (data2, len2), and (data3, len3) you:
- *
- * h = fsck_hash(data1, len1);
- * h = fsck_hash_more(data2, len2, h);
- * h = fsck_hash_more(data3, len3, h);
- *
- * Returns: the hash
- */
-
-uint32_t
-fsck_hash_more(const void *data, unsigned int len, uint32_t hash)
-{
- uint32_t h;
- h = hash_more_internal(data, len, hash);
- return h;
-}
-
-
diff --git a/gfs2/fsck/hash.h b/gfs2/fsck/hash.h
deleted file mode 100644
index d5fe8e9..0000000
--- a/gfs2/fsck/hash.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _HASH_H
-#define _HASH_H
-
-uint32_t fsck_hash(const void *data, unsigned int len);
-uint32_t fsck_hash_more(const void *data, unsigned int len, uint32_t hash);
-
-#endif /* _HASH_H */
diff --git a/gfs2/fsck/inode_hash.c b/gfs2/fsck/inode_hash.c
index 731c9c6..e2d3c29 100644
--- a/gfs2/fsck/inode_hash.c
+++ b/gfs2/fsck/inode_hash.c
@@ -7,7 +7,6 @@

#include "libgfs2.h"
#include "osi_list.h"
-#include "hash.h"
#include "inode_hash.h"
#include "fsck.h"
#define _(String) gettext(String)
diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index eb80ccf..fc87d2f 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -16,7 +16,6 @@
#include "fsck.h"
#include "util.h"
#include "metawalk.h"
-#include "hash.h"
#include "inode_hash.h"

#define COMFORTABLE_BLKS 5242880 /* 20GB in 4K blocks */
--
1.7.7.5
 

Thread Tools




All times are GMT. The time now is 07:33 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org