staging/lustre/libcfs: remove cfs_hash_long
authorPeng Tao <bergwolf@gmail.com>
Wed, 12 Feb 2014 11:21:39 +0000 (19:21 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Feb 2014 17:27:10 +0000 (09:27 -0800)
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
drivers/staging/lustre/include/linux/lnet/lib-lnet.h
drivers/staging/lustre/lnet/lnet/api-ni.c
drivers/staging/lustre/lnet/lnet/lib-ptl.c
drivers/staging/lustre/lustre/include/lustre_fid.h
drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
drivers/staging/lustre/lustre/obdclass/lu_object.c
drivers/staging/lustre/lustre/ptlrpc/gss/gss_svc_upcall.c

index 9d5ee1a69c0c899eb6801bb8a872085ec3b54fb2..e5d5db2556225a7e8f612decadc2736da3e00040 100644 (file)
@@ -65,8 +65,6 @@
 
 #include <linux/hash.h>
 
-#define cfs_hash_long(val, bits)    hash_long(val, bits)
-
 /** disable debug */
 #define CFS_HASH_DEBUG_NONE     0
 /** record hash depth and output to console when it's too deep,
index 3ac2bb5fd2db4637efd63cb4c5459b2fca817dc5..856fcfaafafa702f7140c435e86967230ffc8f95 100644 (file)
@@ -628,7 +628,7 @@ void lnet_ni_free(lnet_ni_t *ni);
 static inline int
 lnet_nid2peerhash(lnet_nid_t nid)
 {
-       return cfs_hash_long(nid, LNET_PEER_HASH_BITS);
+       return hash_long(nid, LNET_PEER_HASH_BITS);
 }
 
 static inline struct list_head *
index c562ff3e92838a51b2727a2612e5c8dee6be2ab0..a18fee56147b0c554bee1ea08c8e5e2e90bdf389 100644 (file)
@@ -770,7 +770,7 @@ lnet_nid_cpt_hash(lnet_nid_t nid, unsigned int number)
        if (number == 1)
                return 0;
 
-       val = cfs_hash_long(key, LNET_CPT_BITS);
+       val = hash_long(key, LNET_CPT_BITS);
        /* NB: LNET_CP_NUMBER doesn't have to be PO2 */
        if (val < number)
                return val;
index 6fffd5e96f9c4f25f4a147882cea7f50048d372c..920df69960a5f2aba606090d80baa28287d53ee2 100644 (file)
@@ -366,7 +366,7 @@ lnet_mt_match_head(struct lnet_match_table *mtable,
                unsigned long hash = mbits + id.nid + id.pid;
 
                LASSERT(lnet_ptl_is_unique(ptl));
-               hash = cfs_hash_long(hash, LNET_MT_HASH_BITS);
+               hash = hash_long(hash, LNET_MT_HASH_BITS);
                return &mtable->mt_mhash[hash];
        }
 }
index 84a897eed1df5e7c7346693aa9c961176d49bdd6..cf78761356a4b5be7dc378bbe0bce9f2540c0499 100644 (file)
@@ -685,7 +685,7 @@ static inline __u32 fid_hash(const struct lu_fid *f, int bits)
 {
        /* all objects with same id and different versions will belong to same
         * collisions list. */
-       return cfs_hash_long(fid_flatten(f), bits);
+       return hash_long(fid_flatten(f), bits);
 }
 
 /**
index 5f89864cda14416853a0eecfad66261ab1c6751d..2824d4a9a85b39422f8b4f75a715d96bc4baf7ff 100644 (file)
@@ -421,9 +421,9 @@ static unsigned ldlm_res_hop_fid_hash(struct cfs_hash *hs,
        } else {
                val = fid_oid(&fid);
        }
-       hash = cfs_hash_long(hash, hs->hs_bkt_bits);
+       hash = hash_long(hash, hs->hs_bkt_bits);
        /* give me another random factor */
-       hash -= cfs_hash_long((unsigned long)hs, val % 11 + 3);
+       hash -= hash_long((unsigned long)hs, val % 11 + 3);
 
        hash <<= hs->hs_cur_bits - hs->hs_bkt_bits;
        hash |= ldlm_res_hop_hash(hs, key, CFS_HASH_NBKT(hs) - 1);
index 492964a38e7cdb01d2b0094ca2d7a6a289ad71bc..8800384c061cc3ca9e0fae312caa30ebe7284778 100644 (file)
@@ -890,10 +890,10 @@ static unsigned lu_obj_hop_hash(struct cfs_hash *hs,
 
        hash = fid_flatten32(fid);
        hash += (hash >> 4) + (hash << 12); /* mixing oid and seq */
-       hash = cfs_hash_long(hash, hs->hs_bkt_bits);
+       hash = hash_long(hash, hs->hs_bkt_bits);
 
        /* give me another random factor */
-       hash -= cfs_hash_long((unsigned long)hs, fid_oid(fid) % 11 + 3);
+       hash -= hash_long((unsigned long)hs, fid_oid(fid) % 11 + 3);
 
        hash <<= hs->hs_cur_bits - hs->hs_bkt_bits;
        hash |= (fid_seq(fid) + fid_oid(fid)) & (CFS_HASH_NBKT(hs) - 1);
index 8d25a70585ddc6b86ceba439e8ea3dabb3dffff2..f0aba500764ed1841129b73abfba373f1b350086 100644 (file)
@@ -102,7 +102,7 @@ static inline unsigned long hash_mem(char *buf, int length, int bits)
                len++;
 
                if ((len & (BITS_PER_LONG/8-1)) == 0)
-                       hash = cfs_hash_long(hash^l, BITS_PER_LONG);
+                       hash = hash_long(hash^l, BITS_PER_LONG);
        } while (len);
 
        return hash >> (BITS_PER_LONG - bits);