Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vhost: rename vhost_work_dev_flush

This patch renames vhost_work_dev_flush to just vhost_dev_flush to
relfect that it flushes everything on the device and that drivers
don't know/care that polls are based on vhost_works. Drivers just
flush the entire device and polls, and works for vhost-scsi
management TMFs and IO net virtqueues, etc all are flushed.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20220517180850.198915-9-michael.christie@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

authored by

Mike Christie and committed by
Michael S. Tsirkin
b2ffa407 f3a1aad9

+11 -11
+2 -2
drivers/vhost/net.c
··· 1376 1376 1377 1377 static void vhost_net_flush(struct vhost_net *n) 1378 1378 { 1379 - vhost_work_dev_flush(&n->dev); 1379 + vhost_dev_flush(&n->dev); 1380 1380 if (n->vqs[VHOST_NET_VQ_TX].ubufs) { 1381 1381 mutex_lock(&n->vqs[VHOST_NET_VQ_TX].vq.mutex); 1382 1382 n->tx_flush = true; ··· 1565 1565 } 1566 1566 1567 1567 if (oldsock) { 1568 - vhost_work_dev_flush(&n->dev); 1568 + vhost_dev_flush(&n->dev); 1569 1569 sockfd_put(oldsock); 1570 1570 } 1571 1571
+1 -1
drivers/vhost/scsi.c
··· 1436 1436 kref_put(&old_inflight[i]->kref, vhost_scsi_done_inflight); 1437 1437 1438 1438 /* Flush both the vhost poll and vhost work */ 1439 - vhost_work_dev_flush(&vs->dev); 1439 + vhost_dev_flush(&vs->dev); 1440 1440 1441 1441 /* Wait for all reqs issued before the flush to be finished */ 1442 1442 for (i = 0; i < VHOST_SCSI_MAX_VQ; i++)
+1 -1
drivers/vhost/test.c
··· 146 146 147 147 static void vhost_test_flush(struct vhost_test *n) 148 148 { 149 - vhost_work_dev_flush(&n->dev); 149 + vhost_dev_flush(&n->dev); 150 150 } 151 151 152 152 static int vhost_test_release(struct inode *inode, struct file *f)
+5 -5
drivers/vhost/vhost.c
··· 231 231 } 232 232 EXPORT_SYMBOL_GPL(vhost_poll_stop); 233 233 234 - void vhost_work_dev_flush(struct vhost_dev *dev) 234 + void vhost_dev_flush(struct vhost_dev *dev) 235 235 { 236 236 struct vhost_flush_struct flush; 237 237 ··· 243 243 wait_for_completion(&flush.wait_event); 244 244 } 245 245 } 246 - EXPORT_SYMBOL_GPL(vhost_work_dev_flush); 246 + EXPORT_SYMBOL_GPL(vhost_dev_flush); 247 247 248 248 void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work) 249 249 { ··· 530 530 attach.owner = current; 531 531 vhost_work_init(&attach.work, vhost_attach_cgroups_work); 532 532 vhost_work_queue(dev, &attach.work); 533 - vhost_work_dev_flush(dev); 533 + vhost_dev_flush(dev); 534 534 return attach.ret; 535 535 } 536 536 ··· 657 657 vhost_poll_stop(&dev->vqs[i]->poll); 658 658 } 659 659 660 - vhost_work_dev_flush(dev); 660 + vhost_dev_flush(dev); 661 661 } 662 662 EXPORT_SYMBOL_GPL(vhost_dev_stop); 663 663 ··· 1724 1724 mutex_unlock(&vq->mutex); 1725 1725 1726 1726 if (pollstop && vq->handle_kick) 1727 - vhost_work_dev_flush(vq->poll.dev); 1727 + vhost_dev_flush(vq->poll.dev); 1728 1728 return r; 1729 1729 } 1730 1730 EXPORT_SYMBOL_GPL(vhost_vring_ioctl);
+1 -1
drivers/vhost/vhost.h
··· 45 45 int vhost_poll_start(struct vhost_poll *poll, struct file *file); 46 46 void vhost_poll_stop(struct vhost_poll *poll); 47 47 void vhost_poll_queue(struct vhost_poll *poll); 48 - void vhost_work_dev_flush(struct vhost_dev *dev); 48 + void vhost_dev_flush(struct vhost_dev *dev); 49 49 50 50 struct vhost_log { 51 51 u64 addr;
+1 -1
drivers/vhost/vsock.c
··· 705 705 706 706 static void vhost_vsock_flush(struct vhost_vsock *vsock) 707 707 { 708 - vhost_work_dev_flush(&vsock->dev); 708 + vhost_dev_flush(&vsock->dev); 709 709 } 710 710 711 711 static void vhost_vsock_reset_orphans(struct sock *sk)