lkml.org 
[lkml]   [2002]   [Sep]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] 2.4.19 fix for fuzzy hash <linux/ghash.h>
* Bart Trojanowski <bart@jukie.net> [020911 14:04]:
> The DEF_HASH_FUZZY macro allows the user to template their hash; it
> takes on a paramter for the hashing-function, namely HASHFN. When used
> with a hashing-function named anything other than 'hashfn()', a module
> using the kernel's fuzzy hash implementation will not compile.
>
> None of the in-kernel 2.4.x drivers use this primitive (yet) so it's no
> wonder no one has spotted it. The patch is very trivial and makes me
> think that I am the very first user of the include/linux/ghash.h
> hash-table primitive. ;)
>
> Bart.

Please ignore the garbage at the end of the last patch.

Here is a cleaned up one.

Bart.

diff -ruN linux-2.4.19/include/linux/ghash.h linux-2.4.19+ghash-fix/include/linux/ghash.h
--- linux-2.4.19/include/linux/ghash.h Wed Sep 11 10:09:57 2002
+++ linux-2.4.19+ghash-fix/include/linux/ghash.h Wed Sep 11 10:12:52 2002
@@ -106,7 +106,7 @@
\
LINKAGE TYPE * find_##NAME##_hash(struct NAME##_table * tbl, KEYTYPE pos)\
{\
- int ix = hashfn(pos);\
+ int ix = HASHFN(pos);\
TYPE * ptr = tbl->hashtable[ix];\
while(ptr && KEYCMP(ptr->KEY, pos))\
ptr = ptr->PTRS.next_hash;\
@@ -206,7 +206,7 @@
\
LINKAGE TYPE * find_##NAME##_hash(struct NAME##_table * tbl, KEYTYPE pos)\
{\
- int ix = hashfn(pos);\
+ int ix = HASHFN(pos);\
TYPE * ptr = tbl->hashtable[ix];\
while(ptr && KEYCMP(ptr->KEY, pos))\
ptr = ptr->PTRS.next_hash;\
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:22    [W:0.049 / U:2.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site