cache: depessimize hashing macros/inlines
authormjg <mjg@FreeBSD.org>
Thu, 29 Dec 2016 08:41:25 +0000 (08:41 +0000)
committermjg <mjg@FreeBSD.org>
Thu, 29 Dec 2016 08:41:25 +0000 (08:41 +0000)
commit20712de9564b773bc67a9f1732a9aa132cd8435c
tree4befdbcaa68675981e65f47dfb84220f63669fac
parentfd6a71fa0c7ca1d180c7a32a4e78488eb4f50ac1
cache: depessimize hashing macros/inlines

All hash sizes are power-of-2, but the compiler does not know that for sure
and 'foo % size' forces doing a division.

Store the size - 1 and use 'foo & hash' instead which allows mere shift.
sys/kern/vfs_cache.c