Skip to content

Commit 78af31c

Browse files
mikechristiemstsirkin
authored andcommitted
vhost_scsi: convert to vhost_vq_work_queue
Convert from vhost_work_queue to vhost_vq_work_queue so we can remove vhost_work_queue. Signed-off-by: Mike Christie <michael.christie@oracle.com> Message-Id: <20230626232307.97930-11-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
1 parent 48ae70d commit 78af31c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

drivers/vhost/scsi.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,9 @@ static void vhost_scsi_release_cmd(struct se_cmd *se_cmd)
353353
if (se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) {
354354
struct vhost_scsi_tmf *tmf = container_of(se_cmd,
355355
struct vhost_scsi_tmf, se_cmd);
356+
struct vhost_virtqueue *vq = &tmf->svq->vq;
356357

357-
vhost_work_queue(&tmf->vhost->dev, &tmf->vwork);
358+
vhost_vq_work_queue(vq, &tmf->vwork);
358359
} else {
359360
struct vhost_scsi_cmd *cmd = container_of(se_cmd,
360361
struct vhost_scsi_cmd, tvc_se_cmd);
@@ -1332,11 +1333,9 @@ static void vhost_scsi_ctl_handle_kick(struct vhost_work *work)
13321333
}
13331334

13341335
static void
1335-
vhost_scsi_send_evt(struct vhost_scsi *vs,
1336-
struct vhost_scsi_tpg *tpg,
1337-
struct se_lun *lun,
1338-
u32 event,
1339-
u32 reason)
1336+
vhost_scsi_send_evt(struct vhost_scsi *vs, struct vhost_virtqueue *vq,
1337+
struct vhost_scsi_tpg *tpg, struct se_lun *lun,
1338+
u32 event, u32 reason)
13401339
{
13411340
struct vhost_scsi_evt *evt;
13421341

@@ -1358,7 +1357,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs,
13581357
}
13591358

13601359
llist_add(&evt->list, &vs->vs_event_list);
1361-
vhost_work_queue(&vs->dev, &vs->vs_event_work);
1360+
vhost_vq_work_queue(vq, &vs->vs_event_work);
13621361
}
13631362

13641363
static void vhost_scsi_evt_handle_kick(struct vhost_work *work)
@@ -1372,7 +1371,8 @@ static void vhost_scsi_evt_handle_kick(struct vhost_work *work)
13721371
goto out;
13731372

13741373
if (vs->vs_events_missed)
1375-
vhost_scsi_send_evt(vs, NULL, NULL, VIRTIO_SCSI_T_NO_EVENT, 0);
1374+
vhost_scsi_send_evt(vs, vq, NULL, NULL, VIRTIO_SCSI_T_NO_EVENT,
1375+
0);
13761376
out:
13771377
mutex_unlock(&vq->mutex);
13781378
}
@@ -1991,7 +1991,7 @@ vhost_scsi_do_plug(struct vhost_scsi_tpg *tpg,
19911991
goto unlock;
19921992

19931993
if (vhost_has_feature(vq, VIRTIO_SCSI_F_HOTPLUG))
1994-
vhost_scsi_send_evt(vs, tpg, lun,
1994+
vhost_scsi_send_evt(vs, vq, tpg, lun,
19951995
VIRTIO_SCSI_T_TRANSPORT_RESET, reason);
19961996
unlock:
19971997
mutex_unlock(&vq->mutex);

0 commit comments

Comments
 (0)