diff options
author | Simon Derr <simon.derr@bull.net> | 2014-03-10 16:38:49 +0100 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2014-03-25 16:38:11 -0500 |
commit | afd8d65411551839b7ab14a539d00075b2793451 (patch) | |
tree | 0bb73953a08905dbc3ee1071ffeebe11bc6b94d6 /net | |
parent | 05a782d416944593ca0268d5718fe4b9cba5ef67 (diff) | |
download | op-kernel-dev-afd8d65411551839b7ab14a539d00075b2793451.zip op-kernel-dev-afd8d65411551839b7ab14a539d00075b2793451.tar.gz |
9P: Add cancelled() to the transport functions.
And move transport-specific code out of net/9p/client.c
Signed-off-by: Simon Derr <simon.derr@bull.net>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/9p/client.c | 9 | ||||
-rw-r--r-- | net/9p/trans_fd.c | 17 |
2 files changed, 20 insertions, 6 deletions
diff --git a/net/9p/client.c b/net/9p/client.c index ce26da9..40e5581 100644 --- a/net/9p/client.c +++ b/net/9p/client.c @@ -663,16 +663,13 @@ static int p9_client_flush(struct p9_client *c, struct p9_req_t *oldreq) if (IS_ERR(req)) return PTR_ERR(req); - /* * if we haven't received a response for oldreq, * remove it from the list */ - if (oldreq->status == REQ_STATUS_FLSH) { - spin_lock(&c->lock); - list_del(&oldreq->req_list); - spin_unlock(&c->lock); - } + if (oldreq->status == REQ_STATUS_FLSH) + if (c->trans_mod->cancelled) + c->trans_mod->cancelled(c, oldreq); p9_free_req(c, req); return 0; diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index 193efd5..fda4951 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c @@ -709,6 +709,20 @@ static int p9_fd_cancel(struct p9_client *client, struct p9_req_t *req) return ret; } +static int p9_fd_cancelled(struct p9_client *client, struct p9_req_t *req) +{ + p9_debug(P9_DEBUG_TRANS, "client %p req %p\n", client, req); + + /* we haven't received a response for oldreq, + * remove it from the list. + */ + spin_lock(&client->lock); + list_del(&req->req_list); + spin_unlock(&client->lock); + + return 0; +} + /** * parse_opts - parse mount options into p9_fd_opts structure * @params: options string passed from mount @@ -1050,6 +1064,7 @@ static struct p9_trans_module p9_tcp_trans = { .close = p9_fd_close, .request = p9_fd_request, .cancel = p9_fd_cancel, + .cancelled = p9_fd_cancelled, .owner = THIS_MODULE, }; @@ -1061,6 +1076,7 @@ static struct p9_trans_module p9_unix_trans = { .close = p9_fd_close, .request = p9_fd_request, .cancel = p9_fd_cancel, + .cancelled = p9_fd_cancelled, .owner = THIS_MODULE, }; @@ -1072,6 +1088,7 @@ static struct p9_trans_module p9_fd_trans = { .close = p9_fd_close, .request = p9_fd_request, .cancel = p9_fd_cancel, + .cancelled = p9_fd_cancelled, .owner = THIS_MODULE, }; |