Commit 474fe9f7 authored by Al Viro's avatar Al Viro

9p/trans_virtio: don't bother with p9_tag_lookup()

Just store the pointer to req instead of that to req->tc as opaque
data.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 527e9316
...@@ -143,7 +143,6 @@ static void p9_virtio_close(struct p9_client *client) ...@@ -143,7 +143,6 @@ static void p9_virtio_close(struct p9_client *client)
static void req_done(struct virtqueue *vq) static void req_done(struct virtqueue *vq)
{ {
struct virtio_chan *chan = vq->vdev->priv; struct virtio_chan *chan = vq->vdev->priv;
struct p9_fcall *rc;
unsigned int len; unsigned int len;
struct p9_req_t *req; struct p9_req_t *req;
unsigned long flags; unsigned long flags;
...@@ -152,8 +151,8 @@ static void req_done(struct virtqueue *vq) ...@@ -152,8 +151,8 @@ static void req_done(struct virtqueue *vq)
while (1) { while (1) {
spin_lock_irqsave(&chan->lock, flags); spin_lock_irqsave(&chan->lock, flags);
rc = virtqueue_get_buf(chan->vq, &len); req = virtqueue_get_buf(chan->vq, &len);
if (rc == NULL) { if (req == NULL) {
spin_unlock_irqrestore(&chan->lock, flags); spin_unlock_irqrestore(&chan->lock, flags);
break; break;
} }
...@@ -161,9 +160,6 @@ static void req_done(struct virtqueue *vq) ...@@ -161,9 +160,6 @@ static void req_done(struct virtqueue *vq)
spin_unlock_irqrestore(&chan->lock, flags); spin_unlock_irqrestore(&chan->lock, flags);
/* Wakeup if anyone waiting for VirtIO ring space. */ /* Wakeup if anyone waiting for VirtIO ring space. */
wake_up(chan->vc_wq); wake_up(chan->vc_wq);
p9_debug(P9_DEBUG_TRANS, ": rc %p\n", rc);
p9_debug(P9_DEBUG_TRANS, ": lookup tag %d\n", rc->tag);
req = p9_tag_lookup(chan->client, rc->tag);
p9_client_cb(chan->client, req, REQ_STATUS_RCVD); p9_client_cb(chan->client, req, REQ_STATUS_RCVD);
} }
} }
...@@ -284,7 +280,7 @@ p9_virtio_request(struct p9_client *client, struct p9_req_t *req) ...@@ -284,7 +280,7 @@ p9_virtio_request(struct p9_client *client, struct p9_req_t *req)
if (in) if (in)
sgs[out_sgs + in_sgs++] = chan->sg + out; sgs[out_sgs + in_sgs++] = chan->sg + out;
err = virtqueue_add_sgs(chan->vq, sgs, out_sgs, in_sgs, req->tc, err = virtqueue_add_sgs(chan->vq, sgs, out_sgs, in_sgs, req,
GFP_ATOMIC); GFP_ATOMIC);
if (err < 0) { if (err < 0) {
if (err == -ENOSPC) { if (err == -ENOSPC) {
...@@ -469,7 +465,7 @@ p9_virtio_zc_request(struct p9_client *client, struct p9_req_t *req, ...@@ -469,7 +465,7 @@ p9_virtio_zc_request(struct p9_client *client, struct p9_req_t *req,
} }
BUG_ON(out_sgs + in_sgs > ARRAY_SIZE(sgs)); BUG_ON(out_sgs + in_sgs > ARRAY_SIZE(sgs));
err = virtqueue_add_sgs(chan->vq, sgs, out_sgs, in_sgs, req->tc, err = virtqueue_add_sgs(chan->vq, sgs, out_sgs, in_sgs, req,
GFP_ATOMIC); GFP_ATOMIC);
if (err < 0) { if (err < 0) {
if (err == -ENOSPC) { if (err == -ENOSPC) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment