From: Andrew Price <anprice@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 4/5] fsck.gfs2: Remove unused hash.c, hash.h
Date: Wed, 18 Jan 2012 16:39:30 +0000 [thread overview]
Message-ID: <1326904771-12416-4-git-send-email-anprice@redhat.com> (raw)
In-Reply-To: <1326904771-12416-1-git-send-email-anprice@redhat.com>
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
next prev parent reply other threads:[~2012-01-18 16:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-18 16:39 [Cluster-devel] [PATCH 1/5] fsck.gfs2: Plug memory leak in check_system_dir() Andrew Price
2012-01-18 16:39 ` [Cluster-devel] [PATCH 2/5] fsck.gfs2: Fix null pointer deref " Andrew Price
2012-01-18 16:39 ` [Cluster-devel] [PATCH 3/5] fsck.gfs2: Plug a leak in find_block_ref() Andrew Price
2012-01-18 16:39 ` Andrew Price [this message]
2012-01-18 16:39 ` [Cluster-devel] [PATCH 5/5] mkfs.gfs2: Improve error messages Andrew Price
2012-01-18 16:48 ` Steven Whitehouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1326904771-12416-4-git-send-email-anprice@redhat.com \
--to=anprice@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).