diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2008-05-02 22:50:45 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-05-02 07:50:45 -0400 |
commit | cb38fa23c17519faf46a76d2f71a8430705fe474 (patch) | |
tree | 8a2a4ac0c4d8091cc15216871bc74e98337bfa41 /drivers/block/virtio_blk.c | |
parent | 81473132878f8a1d0c6a78cffa0cf84c8a19c1be (diff) |
virtio: de-structify virtio_block status byte
Ron Minnich points out that a struct containing a char is not always
sizeof(char); simplest to remove the structure to avoid confusion.
Cc: "ron minnich" <rminnich@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/block/virtio_blk.c')
-rw-r--r-- | drivers/block/virtio_blk.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 0cfbe8c594a5..fb283af38023 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c | |||
@@ -35,7 +35,7 @@ struct virtblk_req | |||
35 | struct list_head list; | 35 | struct list_head list; |
36 | struct request *req; | 36 | struct request *req; |
37 | struct virtio_blk_outhdr out_hdr; | 37 | struct virtio_blk_outhdr out_hdr; |
38 | struct virtio_blk_inhdr in_hdr; | 38 | u8 status; |
39 | }; | 39 | }; |
40 | 40 | ||
41 | static void blk_done(struct virtqueue *vq) | 41 | static void blk_done(struct virtqueue *vq) |
@@ -48,7 +48,7 @@ static void blk_done(struct virtqueue *vq) | |||
48 | spin_lock_irqsave(&vblk->lock, flags); | 48 | spin_lock_irqsave(&vblk->lock, flags); |
49 | while ((vbr = vblk->vq->vq_ops->get_buf(vblk->vq, &len)) != NULL) { | 49 | while ((vbr = vblk->vq->vq_ops->get_buf(vblk->vq, &len)) != NULL) { |
50 | int uptodate; | 50 | int uptodate; |
51 | switch (vbr->in_hdr.status) { | 51 | switch (vbr->status) { |
52 | case VIRTIO_BLK_S_OK: | 52 | case VIRTIO_BLK_S_OK: |
53 | uptodate = 1; | 53 | uptodate = 1; |
54 | break; | 54 | break; |
@@ -101,7 +101,7 @@ static bool do_req(struct request_queue *q, struct virtio_blk *vblk, | |||
101 | sg_init_table(vblk->sg, VIRTIO_MAX_SG); | 101 | sg_init_table(vblk->sg, VIRTIO_MAX_SG); |
102 | sg_set_buf(&vblk->sg[0], &vbr->out_hdr, sizeof(vbr->out_hdr)); | 102 | sg_set_buf(&vblk->sg[0], &vbr->out_hdr, sizeof(vbr->out_hdr)); |
103 | num = blk_rq_map_sg(q, vbr->req, vblk->sg+1); | 103 | num = blk_rq_map_sg(q, vbr->req, vblk->sg+1); |
104 | sg_set_buf(&vblk->sg[num+1], &vbr->in_hdr, sizeof(vbr->in_hdr)); | 104 | sg_set_buf(&vblk->sg[num+1], &vbr->status, sizeof(vbr->status)); |
105 | 105 | ||
106 | if (rq_data_dir(vbr->req) == WRITE) { | 106 | if (rq_data_dir(vbr->req) == WRITE) { |
107 | vbr->out_hdr.type |= VIRTIO_BLK_T_OUT; | 107 | vbr->out_hdr.type |= VIRTIO_BLK_T_OUT; |