X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=kernel%2Fdrivers%2Fstaging%2Flustre%2Flustre%2Fptlrpc%2Fconnection.c;h=da1f0b1ac3e38a7e88f664e7f9a61c24e9b6a907;hb=e09b41010ba33a20a87472ee821fa407a5b8da36;hp=7e27397ce384c258976d53bed4e84a1c39801234;hpb=f93b97fd65072de626c074dbe099a1fff05ce060;p=kvmfornfv.git diff --git a/kernel/drivers/staging/lustre/lustre/ptlrpc/connection.c b/kernel/drivers/staging/lustre/lustre/ptlrpc/connection.c index 7e27397ce..da1f0b1ac 100644 --- a/kernel/drivers/staging/lustre/lustre/ptlrpc/connection.c +++ b/kernel/drivers/staging/lustre/lustre/ptlrpc/connection.c @@ -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, };