Whamcloud - gitweb
LU-336 Tighten matching criteria in module_loaded
[fs/lustre-release.git] / lustre / ptlrpc / connection.c
index d57ad7f..00b37a9 100644 (file)
@@ -165,16 +165,16 @@ void ptlrpc_connection_fini(void) {
  * Hash operations for net_peer<->connection
  */
 static unsigned
-conn_hashfn(cfs_hash_t *hs,  void *key, unsigned mask)
+conn_hashfn(cfs_hash_t *hs, const void *key, unsigned mask)
 {
         return cfs_hash_djb2_hash(key, sizeof(lnet_process_id_t), mask);
 }
 
 static int
-conn_keycmp(void *key, cfs_hlist_node_t *hnode)
+conn_keycmp(const void *key, cfs_hlist_node_t *hnode)
 {
         struct ptlrpc_connection *conn;
-        lnet_process_id_t *conn_key;
+        const lnet_process_id_t *conn_key;
 
         LASSERT(key != NULL);
         conn_key = (lnet_process_id_t*)key;
@@ -198,30 +198,26 @@ conn_object(cfs_hlist_node_t *hnode)
         return cfs_hlist_entry(hnode, struct ptlrpc_connection, c_hash);
 }
 
-static void *
-conn_get(cfs_hlist_node_t *hnode)
+static void
+conn_get(cfs_hash_t *hs, cfs_hlist_node_t *hnode)
 {
         struct ptlrpc_connection *conn;
 
         conn = cfs_hlist_entry(hnode, struct ptlrpc_connection, c_hash);
         cfs_atomic_inc(&conn->c_refcount);
-
-        return conn;
 }
 
-static void *
-conn_put_locked(cfs_hlist_node_t *hnode)
+static void
+conn_put_locked(cfs_hash_t *hs, cfs_hlist_node_t *hnode)
 {
         struct ptlrpc_connection *conn;
 
         conn = cfs_hlist_entry(hnode, struct ptlrpc_connection, c_hash);
         cfs_atomic_dec(&conn->c_refcount);
-
-        return conn;
 }
 
 static void
-conn_exit(cfs_hlist_node_t *hnode)
+conn_exit(cfs_hash_t *hs, cfs_hlist_node_t *hnode)
 {
         struct ptlrpc_connection *conn;