9p: rdma: Set trans prior to requesting async connection ops
authorTom Tucker <tom@opengridcomputing.com>
Thu, 23 Oct 2008 21:30:13 +0000 (16:30 -0500)
committerEric Van Hensbergen <ericvh@gmail.com>
Wed, 5 Nov 2008 19:19:06 +0000 (13:19 -0600)
The RDMA connection manager is fundamentally asynchronous.
Since the async callback context is the client pointer, the
transport in the client struct needs to be set prior to calling
the first async op.

Signed-off-by: Tom Tucker <tom@opengridcomputing.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
net/9p/trans_rdma.c

index 8d6cc4777aae143145de4c65c658e45004bc8460..4e9d2e673cf4f3dabad45cb56eeb9a77b27baf22 100644 (file)
@@ -589,6 +589,9 @@ rdma_create_trans(struct p9_client *client, const char *addr, char *args)
        if (IS_ERR(rdma->cm_id))
                goto error;
 
+       /* Associate the client with the transport */
+       client->trans = rdma;
+
        /* Resolve the server's address */
        rdma->addr.sin_family = AF_INET;
        rdma->addr.sin_addr.s_addr = in_aton(addr);
@@ -669,7 +672,6 @@ rdma_create_trans(struct p9_client *client, const char *addr, char *args)
        if (err || (rdma->state != P9_RDMA_CONNECTED))
                goto error;
 
-       client->trans = rdma;
        client->status = Connected;
 
        return 0;