History

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.

Mike Christie committed 4 years ago

Commit b2ffa401 parent f3a1aad6 files · +11 −11Browse files

Unified · Split

6 files
  1. drivers/vhost/net.c +2 −2
  2. drivers/vhost/scsi.c +1 −1
  3. drivers/vhost/test.c +1 −1
  4. drivers/vhost/vhost.c +5 −5
  5. drivers/vhost/vhost.h +1 −1
  6. drivers/vhost/vsock.c +1 −1
drivers/vhost/net.c+2−2
@@ -1376,7 +1376,7 @@ static void vhost_net_stop(struct vhost_net *n, struct socket **tx_sock, · 1375 unmodified lines
13761376
13771377 static void vhost_net_flush(struct vhost_net *n)
13781378 {
1379− vhost_work_dev_flush(&n->dev);
1379+ vhost_dev_flush(&n->dev);
13801380 if (n->vqs[VHOST_NET_VQ_TX].ubufs) {
13811381 mutex_lock(&n->vqs[VHOST_NET_VQ_TX].vq.mutex);
13821382 n->tx_flush = true;
@@ -1565,7 +1565,7 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) · 182 unmodified lines
15651565 }
15661566
15671567 if (oldsock) {
1568− vhost_work_dev_flush(&n->dev);
1568+ vhost_dev_flush(&n->dev);
15691569 sockfd_put(oldsock);
15701570 }
15711571
drivers/vhost/scsi.c+1−1
@@ -1436,7 +1436,7 @@ static void vhost_scsi_flush(struct vhost_scsi *vs) · 1435 unmodified lines
14361436 kref_put(&old_inflight[i]->kref, vhost_scsi_done_inflight);
14371437
14381438 /* Flush both the vhost poll and vhost work */
1439− vhost_work_dev_flush(&vs->dev);
1439+ vhost_dev_flush(&vs->dev);
14401440
14411441 /* Wait for all reqs issued before the flush to be finished */
14421442 for (i = 0; i < VHOST_SCSI_MAX_VQ; i++)
drivers/vhost/test.c+1−1
@@ -146,7 +146,7 @@ static void vhost_test_stop(struct vhost_test *n, void **privatep) · 145 unmodified lines
146146
147147 static void vhost_test_flush(struct vhost_test *n)
148148 {
149− vhost_work_dev_flush(&n->dev);
149+ vhost_dev_flush(&n->dev);
150150 }
151151
152152 static int vhost_test_release(struct inode *inode, struct file *f)
drivers/vhost/vhost.c+5−5
@@ -231,7 +231,7 @@ void vhost_poll_stop(struct vhost_poll *poll) · 230 unmodified lines
231231 }
232232 EXPORT_SYMBOL_GPL(vhost_poll_stop);
233233
234−void vhost_work_dev_flush(struct vhost_dev *dev)
234+void vhost_dev_flush(struct vhost_dev *dev)
235235 {
236236 struct vhost_flush_struct flush;
237237
@@ -243,7 +243,7 @@ void vhost_work_dev_flush(struct vhost_dev *dev) · 5 unmodified lines
243243 wait_for_completion(&flush.wait_event);
244244 }
245245 }
246−EXPORT_SYMBOL_GPL(vhost_work_dev_flush);
246+EXPORT_SYMBOL_GPL(vhost_dev_flush);
247247
248248 void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work)
249249 {
@@ -530,7 +530,7 @@ static int vhost_attach_cgroups(struct vhost_dev *dev) · 280 unmodified lines
530530 attach.owner = current;
531531 vhost_work_init(&attach.work, vhost_attach_cgroups_work);
532532 vhost_work_queue(dev, &attach.work);
533− vhost_work_dev_flush(dev);
533+ vhost_dev_flush(dev);
534534 return attach.ret;
535535 }
536536
@@ -657,7 +657,7 @@ void vhost_dev_stop(struct vhost_dev *dev) · 120 unmodified lines
657657 vhost_poll_stop(&dev->vqs[i]->poll);
658658 }
659659
660− vhost_work_dev_flush(dev);
660+ vhost_dev_flush(dev);
661661 }
662662 EXPORT_SYMBOL_GPL(vhost_dev_stop);
663663
@@ -1724,7 +1724,7 @@ long vhost_vring_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *arg · 1060 unmodified lines
17241724 mutex_unlock(&vq->mutex);
17251725
17261726 if (pollstop && vq->handle_kick)
1727− vhost_work_dev_flush(vq->poll.dev);
1727+ vhost_dev_flush(vq->poll.dev);
17281728 return r;
17291729 }
17301730 EXPORT_SYMBOL_GPL(vhost_vring_ioctl);
drivers/vhost/vhost.h+1−1
@@ -45,7 +45,7 @@ void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, · 44 unmodified lines
4545 int vhost_poll_start(struct vhost_poll *poll, struct file *file);
4646 void vhost_poll_stop(struct vhost_poll *poll);
4747 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);
4949
5050 struct vhost_log {
5151 u64 addr;
drivers/vhost/vsock.c+1−1
@@ -705,7 +705,7 @@ out: · 704 unmodified lines
705705
706706 static void vhost_vsock_flush(struct vhost_vsock *vsock)
707707 {
708− vhost_work_dev_flush(&vsock->dev);
708+ vhost_dev_flush(&vsock->dev);
709709 }
710710
711711 static void vhost_vsock_reset_orphans(struct sock *sk)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t