/** * Attribute key hashing. */ static unsigned xattr_hash(const void *key) { const struct xattr *xa = key; unsigned hash; /* xa->uri can be NULL, xa->local cannot */ hash = (NULL == xa->uri) ? 0 : string_mix_hash(xa->uri); return hash ^ string_mix_hash(xa->local); }
static uint uhc_hash(const void *key) { const struct uhc *uhc = key; return string_mix_hash(uhc->host); }
/* * Get spinlock to use based on the signal name. */ spinlock_t * listener_get_lock(const char *name) { STATIC_ASSERT(IS_POWER_OF_2(LISTENER_HASH_MASK + 1)); return &listener_access[string_mix_hash(name) & LISTENER_HASH_MASK]; }