Skip to content

Commit f6f93f7

Browse files
夷则(Caspar)mstsirkin
authored andcommitted
vhost: remove unused lock check flag in vhost_dev_cleanup()
In commit ea5d404 ("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 47283be ("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>
1 parent ac964d7 commit f6f93f7

File tree

6 files changed

+7
-8
lines changed

6 files changed

+7
-8
lines changed

drivers/vhost/net.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ static int vhost_net_release(struct inode *inode, struct file *f)
996996
vhost_net_stop(n, &tx_sock, &rx_sock);
997997
vhost_net_flush(n);
998998
vhost_dev_stop(&n->dev);
999-
vhost_dev_cleanup(&n->dev, false);
999+
vhost_dev_cleanup(&n->dev);
10001000
vhost_net_vq_reset(n);
10011001
if (tx_sock)
10021002
sockfd_put(tx_sock);

drivers/vhost/scsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1419,7 +1419,7 @@ static int vhost_scsi_release(struct inode *inode, struct file *f)
14191419
mutex_unlock(&vs->dev.mutex);
14201420
vhost_scsi_clear_endpoint(vs, &t);
14211421
vhost_dev_stop(&vs->dev);
1422-
vhost_dev_cleanup(&vs->dev, false);
1422+
vhost_dev_cleanup(&vs->dev);
14231423
/* Jobs can re-queue themselves in evt kick handler. Do extra flush. */
14241424
vhost_scsi_flush(vs);
14251425
kfree(vs->dev.vqs);

drivers/vhost/test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ static int vhost_test_release(struct inode *inode, struct file *f)
157157

158158
vhost_test_stop(n, &private);
159159
vhost_test_flush(n);
160-
vhost_dev_cleanup(&n->dev, false);
160+
vhost_dev_cleanup(&n->dev);
161161
/* We do an extra flush before freeing memory,
162162
* since jobs can re-queue themselves. */
163163
vhost_test_flush(n);

drivers/vhost/vhost.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ void vhost_dev_reset_owner(struct vhost_dev *dev, struct vhost_umem *umem)
543543
{
544544
int i;
545545

546-
vhost_dev_cleanup(dev, true);
546+
vhost_dev_cleanup(dev);
547547

548548
/* Restore memory to default empty mapping. */
549549
INIT_LIST_HEAD(&umem->umem_list);
@@ -610,8 +610,7 @@ static void vhost_clear_msg(struct vhost_dev *dev)
610610
spin_unlock(&dev->iotlb_lock);
611611
}
612612

613-
/* Caller should have device mutex if and only if locked is set */
614-
void vhost_dev_cleanup(struct vhost_dev *dev, bool locked)
613+
void vhost_dev_cleanup(struct vhost_dev *dev)
615614
{
616615
int i;
617616

drivers/vhost/vhost.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ bool vhost_dev_has_owner(struct vhost_dev *dev);
177177
long vhost_dev_check_owner(struct vhost_dev *);
178178
struct vhost_umem *vhost_dev_reset_owner_prepare(void);
179179
void vhost_dev_reset_owner(struct vhost_dev *, struct vhost_umem *);
180-
void vhost_dev_cleanup(struct vhost_dev *, bool locked);
180+
void vhost_dev_cleanup(struct vhost_dev *);
181181
void vhost_dev_stop(struct vhost_dev *);
182182
long vhost_dev_ioctl(struct vhost_dev *, unsigned int ioctl, void __user *argp);
183183
long vhost_vring_ioctl(struct vhost_dev *d, int ioctl, void __user *argp);

drivers/vhost/vsock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ static int vhost_vsock_dev_release(struct inode *inode, struct file *file)
599599
}
600600
spin_unlock_bh(&vsock->send_pkt_list_lock);
601601

602-
vhost_dev_cleanup(&vsock->dev, false);
602+
vhost_dev_cleanup(&vsock->dev);
603603
kfree(vsock->dev.vqs);
604604
vhost_vsock_free(vsock);
605605
return 0;

0 commit comments

Comments
 (0)