Lines Matching defs:hash

61  * for future reference.  Each hash chain is ordered by LRU
62 * Cache is indexed by hash value obtained from (vp, name)
96 * NC_MOVETOFRONT is the move-to-front threshold: if the hash lookup
98 * its hash chain. The idea is to make sure that the most frequently
100 * front of their hash chains).
120 * from each hash chain), before having to cycle around and retry.
146 static int nc_hashsz; /* size of hash table */
147 static int nc_hashmask; /* size of hash table minus 1 */
241 * Remove entry from hash queue
267 * Cached directory free space hash function.
268 * Needs the free space handle and the dcp to get the hash table size
269 * Returns the hash index.
274 * Cached directory name entry hash function.
275 * Uses the name and returns in the input arguments the hash and the name
278 #define DNLC_DIR_HASH(name, hash, namelen) \
282 hash = *name; \
284 hash = (hash << 4) + hash + Xc; \
306 uint_t dnlc_dir_hash_size_shift = 3; /* 8 entries per hash bucket */
309 * dnlc_dir_hash_resize_shift determines when the hash tables
313 * before hash table readjustment. Note that with
326 int hash);
369 * Initialise the hash table.
370 * Compute hash size rounding to the next power of two.
440 int hash;
454 DNLCHASH(name, dp, hash, namlen);
462 ncp->hash = hash;
463 hp = &nc_hash[hash & nc_hashmask];
466 if (dnlc_search(dp, name, namlen, hash) != NULL) {
478 * Insert back into the hash chain.
507 int hash;
526 DNLCHASH(name, dp, hash, namlen);
536 ncp->hash = hash;
537 hp = &nc_hash[hash & nc_hashmask];
540 if ((tcp = dnlc_search(dp, name, namlen, hash)) != NULL) {
588 int hash, depth;
601 DNLCHASH(name, dp, hash, namlen);
603 hp = &nc_hash[hash & nc_hashmask];
608 if (ncp->hash == hash && /* fast signature check */
613 * Move this entry to the head of its hash chain
669 int hash;
673 DNLCHASH(name, dp, hash, namlen);
674 hp = &nc_hash[hash & nc_hashmask];
677 if (ncp = dnlc_search(dp, name, namlen, hash)) {
734 nch--; /* Do current hash chain again */
795 nch--; /* Do current hash chain again */
859 nch--; /* Do current hash chain again */
972 dnlc_search(vnode_t *dp, const char *name, uchar_t namlen, int hash)
977 hp = &nc_hash[hash & nc_hashmask];
980 if (ncp->hash == hash &&
1071 * Find the first non empty hash queue without locking.
1072 * Only look at each hash queue once to avoid an infinite loop.
1079 /* return if all hash queues are empty. */
1116 ncp = hp->hash_prev; /* pick the last one in the hash queue */
1121 * Remove from hash chain.
1149 int hash;
1169 DNLC_DIR_HASH(name, hash, namlen);
1170 dep = dcp->dc_namehash[hash & dcp->dc_nhash_mask];
1172 if ((dep->de_hash == hash) &&
1236 * Allocate the dircache struct, entry and free space hash tables.
1290 int hash;
1301 DNLC_DIR_HASH(name, hash, namlen);
1366 hp = &dcp->dc_namehash[hash & dcp->dc_nhash_mask];
1372 dep->de_hash = hash;
1515 uint_t nhtsize = dcp->dc_nhash_mask + 1; /* name hash table size */
1516 uint_t fhtsize = dcp->dc_fhash_mask + 1; /* free hash table size */
1520 * Free up the cached name entries and hash table
1522 for (i = 0; i < nhtsize; i++) { /* for each hash bucket */
1534 * Free up the free space entries and hash table
1536 for (i = 0; i < fhtsize; i++) { /* for each hash bucket */
1592 int hash;
1612 DNLC_DIR_HASH(name, hash, namlen);
1613 prevpp = &dcp->dc_namehash[hash & dcp->dc_nhash_mask];
1615 if (((*prevpp)->de_hash == hash) &&
1667 uint_t fhtsize; /* free hash table size */
1693 for (i = 0; i < fhtsize; i++) { /* for each hash bucket */
1790 int hash;
1802 DNLC_DIR_HASH(name, hash, namlen);
1803 dep = dcp->dc_namehash[hash & dcp->dc_nhash_mask];
1805 if ((dep->de_hash == hash) &&
1923 * Dynamically grow or shrink the size of the name hash table
1935 * Allocate new hash table
1942 * Note, the old hash table is still usable.
1956 for (i = 0; i < oldsize; i++) { /* for each hash bucket */
1968 * delete old hash table and set new one in place
1975 * Dynamically grow or shrink the size of the free space hash table
1986 * Allocate new hash table
1993 * Note, the old hash table is still usable.
2007 for (i = 0; i < oldsize; i++) { /* for each hash bucket */
2019 * delete old hash table and set new one in place