aboutsummaryrefslogtreecommitdiffstats
path: root/src/hw/virtio-blk.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hw/virtio-blk.c')
-rw-r--r--src/hw/virtio-blk.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/hw/virtio-blk.c b/src/hw/virtio-blk.c
index ad162007..88d7e54a 100644
--- a/src/hw/virtio-blk.c
+++ b/src/hw/virtio-blk.c
@@ -32,9 +32,9 @@ struct virtiodrive_s {
static int
virtio_blk_op(struct disk_op_s *op, int write)
{
- struct virtiodrive_s *vdrive_gf =
+ struct virtiodrive_s *vdrive =
container_of(op->drive_fl, struct virtiodrive_s, drive);
- struct vring_virtqueue *vq = vdrive_gf->vq;
+ struct vring_virtqueue *vq = vdrive->vq;
struct virtio_blk_outhdr hdr = {
.type = write ? VIRTIO_BLK_T_OUT : VIRTIO_BLK_T_IN,
.ioprio = 0,
@@ -48,7 +48,7 @@ virtio_blk_op(struct disk_op_s *op, int write)
},
{
.addr = op->buf_fl,
- .length = vdrive_gf->drive.blksize * op->count,
+ .length = vdrive->drive.blksize * op->count,
},
{
.addr = (void*)(&status),
@@ -61,7 +61,7 @@ virtio_blk_op(struct disk_op_s *op, int write)
vring_add_buf(vq, sg, 2, 1, 0, 0);
else
vring_add_buf(vq, sg, 1, 2, 0, 0);
- vring_kick(&vdrive_gf->vp, vq, 1);
+ vring_kick(&vdrive->vp, vq, 1);
/* Wait for reply */
while (!vring_more_used(vq))
@@ -73,7 +73,7 @@ virtio_blk_op(struct disk_op_s *op, int write)
/* Clear interrupt status register. Avoid leaving interrupts stuck if
* VRING_AVAIL_F_NO_INTERRUPT was ignored and interrupts were raised.
*/
- vp_get_isr(&vdrive_gf->vp);
+ vp_get_isr(&vdrive->vp);
return status == VIRTIO_BLK_S_OK ? DISK_RET_SUCCESS : DISK_RET_EBADTRACK;
}
@@ -99,7 +99,7 @@ init_virtio_blk(void *data)
struct pci_device *pci = data;
u8 status = VIRTIO_CONFIG_S_ACKNOWLEDGE | VIRTIO_CONFIG_S_DRIVER;
dprintf(1, "found virtio-blk at %pP\n", pci);
- struct virtiodrive_s *vdrive = malloc_fseg(sizeof(*vdrive));
+ struct virtiodrive_s *vdrive = malloc_low(sizeof(*vdrive));
if (!vdrive) {
warn_noalloc();
return;