Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263632
b: refs/heads/master
c: b49d8b5
h: refs/heads/master
v: v3
  • Loading branch information
Aneesh Kumar K.V authored and Eric Van Hensbergen committed Sep 6, 2011
1 parent 14c763a commit eb1a2ed
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 45089142b1497dab2327d60f6c71c40766fc3ea4
refs/heads/master: b49d8b5d7007a673796f3f99688b46931293873e
17 changes: 12 additions & 5 deletions trunk/net/9p/trans_virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ p9_virtio_request(struct p9_client *client, struct p9_req_t *req)
{
int in, out, inp, outp;
struct virtio_chan *chan = client->trans;
char *rdata = (char *)req->rc+sizeof(struct p9_fcall);
unsigned long flags;
size_t pdata_off = 0;
struct trans_rpage_info *rpinfo = NULL;
Expand Down Expand Up @@ -346,7 +345,8 @@ p9_virtio_request(struct p9_client *client, struct p9_req_t *req)
* Arrange in such a way that server places header in the
* alloced memory and payload onto the user buffer.
*/
inp = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM, rdata, 11);
inp = pack_sg_list(chan->sg, out,
VIRTQUEUE_NUM, req->rc->sdata, 11);
/*
* Running executables in the filesystem may result in
* a read request with kernel buffer as opposed to user buffer.
Expand All @@ -366,8 +366,8 @@ p9_virtio_request(struct p9_client *client, struct p9_req_t *req)
}
in += inp;
} else {
in = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM, rdata,
req->rc->capacity);
in = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM,
req->rc->sdata, req->rc->capacity);
}

err = virtqueue_add_buf(chan->vq, chan->sg, out, in, req->tc);
Expand Down Expand Up @@ -592,7 +592,14 @@ static struct p9_trans_module p9_virtio_trans = {
.close = p9_virtio_close,
.request = p9_virtio_request,
.cancel = p9_virtio_cancel,
.maxsize = PAGE_SIZE*VIRTQUEUE_NUM,

/*
* We leave one entry for input and one entry for response
* headers. We also skip one more entry to accomodate, address
* that are not at page boundary, that can result in an extra
* page in zero copy.
*/
.maxsize = PAGE_SIZE * (VIRTQUEUE_NUM - 3),
.pref = P9_TRANS_PREF_PAYLOAD_SEP,
.def = 0,
.owner = THIS_MODULE,
Expand Down

0 comments on commit eb1a2ed

Please sign in to comment.