BKDR Hash Function */
| 86 | |
| 87 | /* BKDR Hash Function */ |
| 88 | static unsigned int bkdr_hash(const char *str) |
| 89 | { |
| 90 | unsigned int seed = 131; /* 31 131 1313 13131 131313 etc..*/ |
| 91 | unsigned int hash = 0; |
| 92 | |
| 93 | while (*str) |
| 94 | { |
| 95 | hash = hash * seed + (*str++); |
| 96 | } |
| 97 | |
| 98 | return (hash % DFS_VNODE_HASH_NR); |
| 99 | } |
| 100 | |
| 101 | /** |
| 102 | * @brief Find a DFS vnode by its path. |