Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281310
b: refs/heads/master
c: 6e8087a
h: refs/heads/master
v: v3
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Dec 8, 2011
1 parent 25e1b83 commit 287a85f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 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: 4219001fc97d9a0fef153ea86ee819482be84c03
refs/heads/master: 6e8087a4fae41ae1518babbf1ef46f105d702bfd
9 changes: 6 additions & 3 deletions trunk/drivers/staging/hv/storvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -893,12 +893,14 @@ static int do_bounce_buffer(struct scatterlist *sgl, unsigned int sg_count)

static struct scatterlist *create_bounce_buffer(struct scatterlist *sgl,
unsigned int sg_count,
unsigned int len)
unsigned int len,
int write)
{
int i;
int num_pages;
struct scatterlist *bounce_sgl;
struct page *page_buf;
unsigned int buf_len = ((write == WRITE_TYPE) ? 0 : PAGE_SIZE);

num_pages = ALIGN(len, PAGE_SIZE) >> PAGE_SHIFT;

Expand All @@ -910,7 +912,7 @@ static struct scatterlist *create_bounce_buffer(struct scatterlist *sgl,
page_buf = alloc_page(GFP_ATOMIC);
if (!page_buf)
goto cleanup;
sg_set_page(&bounce_sgl[i], page_buf, 0, 0);
sg_set_page(&bounce_sgl[i], page_buf, buf_len, 0);
}

return bounce_sgl;
Expand Down Expand Up @@ -1348,7 +1350,8 @@ static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd)
if (do_bounce_buffer(sgl, scsi_sg_count(scmnd)) != -1) {
cmd_request->bounce_sgl =
create_bounce_buffer(sgl, scsi_sg_count(scmnd),
scsi_bufflen(scmnd));
scsi_bufflen(scmnd),
vm_srb->data_in);
if (!cmd_request->bounce_sgl) {
scmnd->host_scribble = NULL;
mempool_free(cmd_request,
Expand Down

0 comments on commit 287a85f

Please sign in to comment.