X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lnet%2Finclude%2Fuapi%2Flinux%2Flnet%2Flnet-types.h;h=da5b03c731363c8a55328b1a56ad2e07b8a0c99f;hp=f00d84f78f95a318b4066a2ead3744687e0f4a20;hb=96a0c378c2e0a0c8f7e21404252e66944e163100;hpb=f38529cd3a1722119e48abe0931c3e232d3cc1f7 diff --git a/lnet/include/uapi/linux/lnet/lnet-types.h b/lnet/include/uapi/linux/lnet/lnet-types.h index f00d84f..da5b03c 100644 --- a/lnet/include/uapi/linux/lnet/lnet-types.h +++ b/lnet/include/uapi/linux/lnet/lnet-types.h @@ -158,6 +158,16 @@ static inline int nid_same(const struct lnet_nid *n1, n1->nid_addr[3] == n2->nid_addr[3]; } +/* This can be used when we need to hash a nid */ +static inline unsigned long nidhash(lnet_nid_t nid) +{ + unsigned long hash = 0; + + hash ^= LNET_NIDNET(nid); + hash ^= LNET_NIDADDR(nid); + return hash; +} + struct lnet_counters_health { __u32 lch_rst_alloc; __u32 lch_resend_count;