Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 249133
b: refs/heads/master
c: 9bd0859
h: refs/heads/master
i:
  249131: 2cf829e
v: v3
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Apr 25, 2011
1 parent 291496e commit 3168117
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 46 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: 3880914aa68fec748e634522bd2fef448b0ea3bb
refs/heads/master: 9bd0859a246f5855ed8e4840711f6c4fc98e741a
58 changes: 13 additions & 45 deletions trunk/drivers/staging/hv/blkvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,53 +305,21 @@ static void blkvsc_init_rw(struct blkvsc_request *blkvsc_req)

blkvsc_req->cmd_len = 16;

if (blkvsc_req->sector_start > 0xffffffff) {
if (rq_data_dir(blkvsc_req->req)) {
blkvsc_req->write = 1;
blkvsc_req->cmnd[0] = WRITE_16;
} else {
blkvsc_req->write = 0;
blkvsc_req->cmnd[0] = READ_16;
}

blkvsc_req->cmnd[1] |=
(blkvsc_req->req->cmd_flags & REQ_FUA) ? 0x8 : 0;

*(unsigned long long *)&blkvsc_req->cmnd[2] =
cpu_to_be64(blkvsc_req->sector_start);
*(unsigned int *)&blkvsc_req->cmnd[10] =
cpu_to_be32(blkvsc_req->sector_count);
} else if ((blkvsc_req->sector_count > 0xff) ||
(blkvsc_req->sector_start > 0x1fffff)) {
if (rq_data_dir(blkvsc_req->req)) {
blkvsc_req->write = 1;
blkvsc_req->cmnd[0] = WRITE_10;
} else {
blkvsc_req->write = 0;
blkvsc_req->cmnd[0] = READ_10;
}

blkvsc_req->cmnd[1] |=
(blkvsc_req->req->cmd_flags & REQ_FUA) ? 0x8 : 0;

*(unsigned int *)&blkvsc_req->cmnd[2] =
cpu_to_be32(blkvsc_req->sector_start);
*(unsigned short *)&blkvsc_req->cmnd[7] =
cpu_to_be16(blkvsc_req->sector_count);
if (rq_data_dir(blkvsc_req->req)) {
blkvsc_req->write = 1;
blkvsc_req->cmnd[0] = WRITE_16;
} else {
if (rq_data_dir(blkvsc_req->req)) {
blkvsc_req->write = 1;
blkvsc_req->cmnd[0] = WRITE_6;
} else {
blkvsc_req->write = 0;
blkvsc_req->cmnd[0] = READ_6;
}

*(unsigned int *)&blkvsc_req->cmnd[1] =
cpu_to_be32(blkvsc_req->sector_start) >> 8;
blkvsc_req->cmnd[1] &= 0x1f;
blkvsc_req->cmnd[4] = (unsigned char)blkvsc_req->sector_count;
blkvsc_req->write = 0;
blkvsc_req->cmnd[0] = READ_16;
}

blkvsc_req->cmnd[1] |=
(blkvsc_req->req->cmd_flags & REQ_FUA) ? 0x8 : 0;

*(unsigned long long *)&blkvsc_req->cmnd[2] =
cpu_to_be64(blkvsc_req->sector_start);
*(unsigned int *)&blkvsc_req->cmnd[10] =
cpu_to_be32(blkvsc_req->sector_count);
}


Expand Down

0 comments on commit 3168117

Please sign in to comment.