* @brief Calculate hash value for address space lookup * * This function computes a hash value based on mount point and path string. * It uses a simple string hashing algorithm combined with mount point pointer. * * @param[in] mnt Pointer to the mount point structure * @param[in] path Path string to be hashed (can be NULL) * * @return Computed hash value within range [0, RT_PAGECACHE_HASH
| 517 | * - Modulo operation to fit hash table size |
| 518 | */ |
| 519 | static uint32_t dfs_aspace_hash(struct dfs_mnt *mnt, const char *path) |
| 520 | { |
| 521 | uint32_t val = 0; |
| 522 | |
| 523 | if (path) |
| 524 | { |
| 525 | while (*path) |
| 526 | { |
| 527 | val = ((val << 5) + val) + *path++; |
| 528 | } |
| 529 | } |
| 530 | |
| 531 | return (val ^ (unsigned long)mnt) & (RT_PAGECACHE_HASH_NR - 1); |
| 532 | } |
| 533 | |
| 534 | /** |
| 535 | * @brief Look up an address space in the page cache hash table |
no outgoing calls
no test coverage detected