git.samba.org
/
vlendec
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f7febd2
)
Revert "change the hash function to use the much better Jenkins hash"
author
Ronnie Sahlberg
<ronniesahlberg@gmail.com>
Sun, 10 Oct 2010 20:05:41 +0000
(07:05 +1100)
committer
Ronnie Sahlberg
<ronniesahlberg@gmail.com>
Sun, 10 Oct 2010 20:05:41 +0000
(07:05 +1100)
This reverts commit
f7e91ae905cd61249028e15f2cb509ea69f10b9e
.
This may require a change to the ctdb protocol, or a mechanism
to negotiate/verify that we dont run with different hash fucntions
across the cluster.
Reverting the change until we decide how to solve this in the master
version.
(This used to be ctdb commit
2a2a7a201c90462295544ca23c8a3e215f140622
)
ctdb/common/ctdb_util.c
patch
|
blob
|
history
diff --git
a/ctdb/common/ctdb_util.c
b/ctdb/common/ctdb_util.c
index 749b9c286f1879de16ff0b9e915c5bbbb4f45a34..4acfa3f33e1badaa0b1108e07d6377f62436717a 100644
(file)
--- a/
ctdb/common/ctdb_util.c
+++ b/
ctdb/common/ctdb_util.c
@@
-99,7
+99,14
@@
bool ctdb_same_address(struct ctdb_address *a1, struct ctdb_address *a2)
*/
uint32_t ctdb_hash(const TDB_DATA *key)
{
- return tdb_jenkins_hash(discard_const(key));
+ uint32_t value; /* Used to compute the hash value. */
+ uint32_t i; /* Used to cycle through random values. */
+
+ /* Set the initial value from the key size. */
+ for (value = 0x238F13AF * key->dsize, i=0; i < key->dsize; i++)
+ value = (value + (key->dptr[i] << (i*5 % 24)));
+
+ return (1103515243 * value + 12345);
}
/*