6 * header file for routines to manipulate hash_tble lookup,
9 * $Id: hash.h,v 1.1 2002/03/11 20:25:52 ningning Exp $
13 * Revision 1.1 2002/03/11 20:25:52 ningning
14 * hash function for file handle map completely implemented.
23 #include "../common/rfs_defines.h"
24 #include "rfsu_defines.h"
26 typedef struct rfsfh rfskey_t;
28 struct hash_ent_struct {
29 #ifdef HASH_DOUBLE_SAFE
34 struct hash_ent_struct * next;
37 typedef struct hash_ent_struct hash_ent_t;
41 int used_entry; /* number of hash table entrie which contains valid data */
42 int valid_num; /* number of valid data including those on the chain */
43 int (*hash_func) (rfskey_t * key, int size);
44 /* it's not C++ class, so we have to get size from outside */
48 inline int hash_func1 (rfskey_t * key, int size);
49 inline int blk_hash_func (blkkey_t * key, int size);
50 int hash_tbl_init (hash_tbl_t * hash_tbl);
51 int hash_tbl_insert (hash_tbl_t * hash_tbl, rfskey_t * key, int entry, int mode);
52 int hash_tbl_delete (hash_tbl_t * hash_tbl, rfskey_t * key);
53 int hash_tbl_lookup (hash_tbl_t * hash_tbl, rfskey_t * key);
57 struct blk_hash_ent_struct {
58 #ifdef HASH_DOUBLE_SAFE
63 struct blk_hash_ent_struct * next;
66 typedef struct blk_hash_ent_struct blk_hash_ent_t;
73 int used_entry; /* number of hash table entrie which contains valid data */
74 int valid_num; /* number of valid data including those on the chain */
75 int (*hash_func) (blkkey_t * key, int size);
76 /* it's not C++ class, so we have to get size from outside */
80 int blk_hash_tbl_init (blk_hash_tbl_t * hash_tbl);
81 int blk_hash_tbl_insert (blk_hash_tbl_t * hash_tbl, blkkey_t * key, int entry, int mode);
82 //int blk_hash_tbl_delete (blk_hash_tbl_t * hash_tbl, blkkey_t * key);
83 int blk_hash_tbl_lookup (blk_hash_tbl_t * hash_tbl, blkkey_t * key);