[lustre-devel] [PATCH 25/40] lnet: libcfs: remove unused hash code

James Simmons jsimmons at infradead.org
Sun Apr 9 05:13:05 PDT 2023


From: Timothy Day <timday at amazon.com>

Two functions which hash then apply a mask
are removed.

WC-bug-id: https://jira.whamcloud.com/browse/LU-16518
Lustre-commit: 239e826876e5e2040 ("LU-16518 misc: use fixed hash code")
Signed-off-by: Timothy Day <timday at amazon.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49916
Reviewed-by: jsimmons <jsimmons at infradead.org>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 include/linux/libcfs/libcfs_hash.h | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/include/linux/libcfs/libcfs_hash.h b/include/linux/libcfs/libcfs_hash.h
index d3b4875..d60e002 100644
--- a/include/linux/libcfs/libcfs_hash.h
+++ b/include/linux/libcfs/libcfs_hash.h
@@ -829,24 +829,6 @@ static inline int __cfs_hash_theta(struct cfs_hash *hs)
 	return (hash & mask);
 }
 
-/*
- * Generic u32 hash algorithm.
- */
-static inline unsigned
-cfs_hash_u32_hash(const u32 key, unsigned int mask)
-{
-	return ((key * CFS_GOLDEN_RATIO_PRIME_32) & mask);
-}
-
-/*
- * Generic u64 hash algorithm.
- */
-static inline unsigned
-cfs_hash_u64_hash(const u64 key, unsigned int mask)
-{
-	return ((unsigned int)(key * CFS_GOLDEN_RATIO_PRIME_64) & mask);
-}
-
 /** iterate over all buckets in @bds (array of struct cfs_hash_bd) */
 #define cfs_hash_for_each_bd(bds, n, i)	\
 	for (i = 0; i < n && (bds)[i].bd_bucket != NULL; i++)
-- 
1.8.3.1



More information about the lustre-devel mailing list