#endif
#include "ptlrpc_internal.h"
+#include <class_hash.h>
-static cfs_hash_t *conn_hash = NULL;
-static cfs_hash_ops_t conn_hash_ops;
+static lustre_hash_t *conn_hash = NULL;
+static lustre_hash_ops_t conn_hash_ops;
struct ptlrpc_connection *
ptlrpc_connection_get(lnet_process_id_t peer, lnet_nid_t self,
struct ptlrpc_connection *conn, *conn2;
ENTRY;
- conn = cfs_hash_lookup(conn_hash, &peer);
+ conn = lustre_hash_lookup(conn_hash, &peer);
if (conn)
GOTO(out, conn);
* connection. The object which exists in the has will be
* returned and may be compared against out object.
*/
- conn2 = cfs_hash_findadd_unique(conn_hash, &peer, &conn->c_hash);
+ conn2 = lustre_hash_findadd_unique(conn_hash, &peer, &conn->c_hash);
if (conn != conn2) {
OBD_FREE_PTR(conn);
conn = conn2;
{
ENTRY;
- conn_hash = cfs_hash_create("CONN_HASH",
- HASH_CONN_CUR_BITS,
- HASH_CONN_MAX_BITS,
- &conn_hash_ops, CFS_HASH_REHASH);
+ conn_hash = lustre_hash_init("CONN_HASH",
+ HASH_CONN_CUR_BITS,
+ HASH_CONN_MAX_BITS,
+ &conn_hash_ops, LH_REHASH);
if (!conn_hash)
RETURN(-ENOMEM);
void ptlrpc_connection_fini(void) {
ENTRY;
- cfs_hash_destroy(conn_hash);
+ lustre_hash_exit(conn_hash);
EXIT;
}
* Hash operations for net_peer<->connection
*/
static unsigned
-conn_hashfn(cfs_hash_t *hs, void *key, unsigned mask)
+conn_hashfn(lustre_hash_t *lh, void *key, unsigned mask)
{
- return cfs_hash_djb2_hash(key, sizeof(lnet_process_id_t), mask);
+ return lh_djb2_hash(key, sizeof(lnet_process_id_t), mask);
}
static int
OBD_FREE_PTR(conn);
}
-static cfs_hash_ops_t conn_hash_ops = {
- .hs_hash = conn_hashfn,
- .hs_compare = conn_compare,
- .hs_key = conn_key,
- .hs_get = conn_get,
- .hs_put = conn_put,
- .hs_exit = conn_exit,
+static lustre_hash_ops_t conn_hash_ops = {
+ .lh_hash = conn_hashfn,
+ .lh_compare = conn_compare,
+ .lh_key = conn_key,
+ .lh_get = conn_get,
+ .lh_put = conn_put,
+ .lh_exit = conn_exit,
};