These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / staging / lustre / lustre / ptlrpc / connection.c
index 7e27397..da1f0b1 100644 (file)
@@ -42,7 +42,7 @@
 #include "ptlrpc_internal.h"
 
 static struct cfs_hash *conn_hash;
-static cfs_hash_ops_t conn_hash_ops;
+static struct cfs_hash_ops conn_hash_ops;
 
 struct ptlrpc_connection *
 ptlrpc_connection_get(lnet_process_id_t peer, lnet_nid_t self,
@@ -54,7 +54,7 @@ ptlrpc_connection_get(lnet_process_id_t peer, lnet_nid_t self,
        if (conn)
                goto out;
 
-       OBD_ALLOC_PTR(conn);
+       conn = kzalloc(sizeof(*conn), GFP_NOFS);
        if (!conn)
                return NULL;
 
@@ -76,7 +76,7 @@ ptlrpc_connection_get(lnet_process_id_t peer, lnet_nid_t self,
        /* coverity[overrun-buffer-val] */
        conn2 = cfs_hash_findadd_unique(conn_hash, &peer, &conn->c_hash);
        if (conn != conn2) {
-               OBD_FREE_PTR(conn);
+               kfree(conn);
                conn = conn2;
        }
 out:
@@ -173,7 +173,7 @@ conn_keycmp(const void *key, struct hlist_node *hnode)
        const lnet_process_id_t *conn_key;
 
        LASSERT(key != NULL);
-       conn_key = (lnet_process_id_t *)key;
+       conn_key = key;
        conn = hlist_entry(hnode, struct ptlrpc_connection, c_hash);
 
        return conn_key->nid == conn->c_peer.nid &&
@@ -227,15 +227,15 @@ conn_exit(struct cfs_hash *hs, struct hlist_node *hnode)
        LASSERTF(atomic_read(&conn->c_refcount) == 0,
                 "Busy connection with %d refs\n",
                 atomic_read(&conn->c_refcount));
-       OBD_FREE_PTR(conn);
+       kfree(conn);
 }
 
-static cfs_hash_ops_t conn_hash_ops = {
+static struct cfs_hash_ops conn_hash_ops = {
        .hs_hash        = conn_hashfn,
        .hs_keycmp      = conn_keycmp,
-       .hs_key  = conn_key,
+       .hs_key         = conn_key,
        .hs_object      = conn_object,
-       .hs_get  = conn_get,
+       .hs_get         = conn_get,
        .hs_put_locked  = conn_put_locked,
        .hs_exit        = conn_exit,
 };