Skip to content

Commit

Permalink
9p: rdma: Set trans prior to requesting async connection ops
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tom Tucker authored and Eric Van Hensbergen committed Nov 5, 2008
1 parent 75fa677 commit 517ac45
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/9p/trans_rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 517ac45

Please sign in to comment.