Commit 78af31cc authored by Mike Christie's avatar Mike Christie Committed by Michael S. Tsirkin

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: default avatarMike Christie <michael.christie@oracle.com>
Message-Id: <20230626232307.97930-11-michael.christie@oracle.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 48ae70dd
...@@ -353,8 +353,9 @@ static void vhost_scsi_release_cmd(struct se_cmd *se_cmd) ...@@ -353,8 +353,9 @@ static void vhost_scsi_release_cmd(struct se_cmd *se_cmd)
if (se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) { if (se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) {
struct vhost_scsi_tmf *tmf = container_of(se_cmd, struct vhost_scsi_tmf *tmf = container_of(se_cmd,
struct vhost_scsi_tmf, se_cmd); struct vhost_scsi_tmf, se_cmd);
struct vhost_virtqueue *vq = &tmf->svq->vq;
vhost_work_queue(&tmf->vhost->dev, &tmf->vwork); vhost_vq_work_queue(vq, &tmf->vwork);
} else { } else {
struct vhost_scsi_cmd *cmd = container_of(se_cmd, struct vhost_scsi_cmd *cmd = container_of(se_cmd,
struct vhost_scsi_cmd, tvc_se_cmd); struct vhost_scsi_cmd, tvc_se_cmd);
...@@ -1332,11 +1333,9 @@ static void vhost_scsi_ctl_handle_kick(struct vhost_work *work) ...@@ -1332,11 +1333,9 @@ static void vhost_scsi_ctl_handle_kick(struct vhost_work *work)
} }
static void static void
vhost_scsi_send_evt(struct vhost_scsi *vs, vhost_scsi_send_evt(struct vhost_scsi *vs, struct vhost_virtqueue *vq,
struct vhost_scsi_tpg *tpg, struct vhost_scsi_tpg *tpg, struct se_lun *lun,
struct se_lun *lun, u32 event, u32 reason)
u32 event,
u32 reason)
{ {
struct vhost_scsi_evt *evt; struct vhost_scsi_evt *evt;
...@@ -1358,7 +1357,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, ...@@ -1358,7 +1357,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs,
} }
llist_add(&evt->list, &vs->vs_event_list); llist_add(&evt->list, &vs->vs_event_list);
vhost_work_queue(&vs->dev, &vs->vs_event_work); vhost_vq_work_queue(vq, &vs->vs_event_work);
} }
static void vhost_scsi_evt_handle_kick(struct vhost_work *work) 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) ...@@ -1372,7 +1371,8 @@ static void vhost_scsi_evt_handle_kick(struct vhost_work *work)
goto out; goto out;
if (vs->vs_events_missed) if (vs->vs_events_missed)
vhost_scsi_send_evt(vs, NULL, NULL, VIRTIO_SCSI_T_NO_EVENT, 0); vhost_scsi_send_evt(vs, vq, NULL, NULL, VIRTIO_SCSI_T_NO_EVENT,
0);
out: out:
mutex_unlock(&vq->mutex); mutex_unlock(&vq->mutex);
} }
...@@ -1991,7 +1991,7 @@ vhost_scsi_do_plug(struct vhost_scsi_tpg *tpg, ...@@ -1991,7 +1991,7 @@ vhost_scsi_do_plug(struct vhost_scsi_tpg *tpg,
goto unlock; goto unlock;
if (vhost_has_feature(vq, VIRTIO_SCSI_F_HOTPLUG)) if (vhost_has_feature(vq, VIRTIO_SCSI_F_HOTPLUG))
vhost_scsi_send_evt(vs, tpg, lun, vhost_scsi_send_evt(vs, vq, tpg, lun,
VIRTIO_SCSI_T_TRANSPORT_RESET, reason); VIRTIO_SCSI_T_TRANSPORT_RESET, reason);
unlock: unlock:
mutex_unlock(&vq->mutex); mutex_unlock(&vq->mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment