]> git.baikalelectronics.ru Git - kernel.git/commitdiff
vhost: remove unused lock check flag in vhost_dev_cleanup()
author夷则(Caspar) <jinli.zjl@alibaba-inc.com>
Sun, 24 Dec 2017 16:08:58 +0000 (00:08 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 1 Feb 2018 14:26:44 +0000 (16:26 +0200)
In commit ea5d404655ba ("vhost: fix release path lockdep checks"),
Michael added a flag to check whether we should hold a lock in
vhost_dev_cleanup(), however, in commit 47283bef7ed3 ("vhost: move
memory pointer to VQs"), RCU operations have been replaced by
mutex, we can remove the no-longer-used `locked' parameter now.

Signed-off-by: Caspar Zhang <jinli.zjl@alibaba-inc.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vhost/net.c
drivers/vhost/scsi.c
drivers/vhost/test.c
drivers/vhost/vhost.c
drivers/vhost/vhost.h
drivers/vhost/vsock.c

index c7bdeb6556469efb93e2a6a7e742da3a37ad7e69..a354d8d731e3f83c3cfdd72308271e64e489f354 100644 (file)
@@ -996,7 +996,7 @@ static int vhost_net_release(struct inode *inode, struct file *f)
        vhost_net_stop(n, &tx_sock, &rx_sock);
        vhost_net_flush(n);
        vhost_dev_stop(&n->dev);
-       vhost_dev_cleanup(&n->dev, false);
+       vhost_dev_cleanup(&n->dev);
        vhost_net_vq_reset(n);
        if (tx_sock)
                sockfd_put(tx_sock);
index 1e321e9fd59a7d4e716d591e854cac2252a6a944..7ad57094d7369278a3f67648bb69f4151fec1fdc 100644 (file)
@@ -1419,7 +1419,7 @@ static int vhost_scsi_release(struct inode *inode, struct file *f)
        mutex_unlock(&vs->dev.mutex);
        vhost_scsi_clear_endpoint(vs, &t);
        vhost_dev_stop(&vs->dev);
-       vhost_dev_cleanup(&vs->dev, false);
+       vhost_dev_cleanup(&vs->dev);
        /* Jobs can re-queue themselves in evt kick handler. Do extra flush. */
        vhost_scsi_flush(vs);
        kfree(vs->dev.vqs);
index 3cc98c07dcd39365d6a379ed2290074f56683bd0..906b8f0f19f7be83f5cff44f8797c6795888454c 100644 (file)
@@ -157,7 +157,7 @@ static int vhost_test_release(struct inode *inode, struct file *f)
 
        vhost_test_stop(n, &private);
        vhost_test_flush(n);
-       vhost_dev_cleanup(&n->dev, false);
+       vhost_dev_cleanup(&n->dev);
        /* We do an extra flush before freeing memory,
         * since jobs can re-queue themselves. */
        vhost_test_flush(n);
index 67fa3d153072e82129913e843f5a6f92d949d374..e5eba5acfd5558b417dc5549ce59b74135299aa2 100644 (file)
@@ -543,7 +543,7 @@ void vhost_dev_reset_owner(struct vhost_dev *dev, struct vhost_umem *umem)
 {
        int i;
 
-       vhost_dev_cleanup(dev, true);
+       vhost_dev_cleanup(dev);
 
        /* Restore memory to default empty mapping. */
        INIT_LIST_HEAD(&umem->umem_list);
@@ -610,8 +610,7 @@ static void vhost_clear_msg(struct vhost_dev *dev)
        spin_unlock(&dev->iotlb_lock);
 }
 
-/* Caller should have device mutex if and only if locked is set */
-void vhost_dev_cleanup(struct vhost_dev *dev, bool locked)
+void vhost_dev_cleanup(struct vhost_dev *dev)
 {
        int i;
 
index 749fe13e061ce8620dc14aa0d4d7c95d9b0cb467..d56b711577eb5f0f13488a756c399f498c3808ef 100644 (file)
@@ -177,7 +177,7 @@ bool vhost_dev_has_owner(struct vhost_dev *dev);
 long vhost_dev_check_owner(struct vhost_dev *);
 struct vhost_umem *vhost_dev_reset_owner_prepare(void);
 void vhost_dev_reset_owner(struct vhost_dev *, struct vhost_umem *);
-void vhost_dev_cleanup(struct vhost_dev *, bool locked);
+void vhost_dev_cleanup(struct vhost_dev *);
 void vhost_dev_stop(struct vhost_dev *);
 long vhost_dev_ioctl(struct vhost_dev *, unsigned int ioctl, void __user *argp);
 long vhost_vring_ioctl(struct vhost_dev *d, int ioctl, void __user *argp);
index 5a5e981bd8e4a2a8fb34393fa6a05978d59e7e6c..0d14e2ff19f16b18a2babdc3107f6ae7d1f35a9f 100644 (file)
@@ -599,7 +599,7 @@ static int vhost_vsock_dev_release(struct inode *inode, struct file *file)
        }
        spin_unlock_bh(&vsock->send_pkt_list_lock);
 
-       vhost_dev_cleanup(&vsock->dev, false);
+       vhost_dev_cleanup(&vsock->dev);
        kfree(vsock->dev.vqs);
        vhost_vsock_free(vsock);
        return 0;